public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Laszlo Ersek <lersek@redhat.com>
To: Brijesh Singh <brijesh.singh@amd.com>, edk2-devel@lists.01.org
Cc: Tom Lendacky <thomas.lendacky@amd.com>,
	Jordan Justen <jordan.l.justen@intel.com>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>
Subject: Re: [PATCH v1 1/4] OvmfPkg: IommuDxe: Do not clear C-bit in Allocate() and Free()
Date: Tue, 1 Aug 2017 22:42:38 +0200	[thread overview]
Message-ID: <c94a3f0c-d5b4-3708-fbea-30fc1cd56438@redhat.com> (raw)
In-Reply-To: <1501529474-20550-2-git-send-email-brijesh.singh@amd.com>

On 07/31/17 21:31, Brijesh Singh wrote:
> As per the discussion [1], the buffer allocated using IOMMU->AllocateBuffer()
> need not result in a buffer that is immediately usable for the
> DMA device operation. Client is required to call Map() unconditionally
> with BusMasterCommonBuffer before performing the desired DMA bus
> master operation.
> 
> [1]https://lists.01.org/pipermail/edk2-devel/2017-July/012652.html
> 
> Suggested-by: Laszlo Ersek <lersek@redhat.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Cc: Jordan Justen <jordan.l.justen@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> ---
>  OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 14 --------------
>  1 file changed, 14 deletions(-)
> 
> diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c
> index 9e78058b7242..cc3c979d4484 100644
> --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c
> +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c
> @@ -333,12 +333,6 @@ IoMmuAllocateBuffer (
>                    );
>    if (!EFI_ERROR (Status)) {
>      *HostAddress = (VOID *) (UINTN) PhysicalAddress;
> -
> -    //
> -    // Clear memory encryption mask
> -    //
> -    Status = MemEncryptSevClearPageEncMask (0, PhysicalAddress, Pages, TRUE);
> -    ASSERT_EFI_ERROR(Status);
>    }
>  
>    DEBUG ((DEBUG_VERBOSE, "%a Address 0x%Lx Pages 0x%Lx\n", __FUNCTION__, PhysicalAddress, Pages));
> @@ -365,14 +359,6 @@ IoMmuFreeBuffer (
>    IN  VOID                                     *HostAddress
>    )
>  {
> -  EFI_STATUS  Status;
> -
> -  //
> -  // Set memory encryption mask
> -  //
> -  Status = MemEncryptSevSetPageEncMask (0, (EFI_PHYSICAL_ADDRESS)(UINTN)HostAddress, Pages, TRUE);
> -  ASSERT_EFI_ERROR(Status);
> -
>    DEBUG ((DEBUG_VERBOSE, "%a Address 0x%Lx Pages 0x%Lx\n", __FUNCTION__, (UINTN)HostAddress, Pages));
>    return gBS->FreePages ((EFI_PHYSICAL_ADDRESS) (UINTN) HostAddress, Pages);
>  }
> 

This looks good to me, but "IommuDxe" in the subject should be spelled
"IoMmuDxe". With that change,

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

Thanks
Laszlo


  reply	other threads:[~2017-08-01 20:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-31 19:31 [PATCH v1 0/4] OvmfPkg : IoMmuDxe: BusMasterCommonBuffer support when SEV is active Brijesh Singh
2017-07-31 19:31 ` [PATCH v1 1/4] OvmfPkg: IommuDxe: Do not clear C-bit in Allocate() and Free() Brijesh Singh
2017-08-01 20:42   ` Laszlo Ersek [this message]
2017-07-31 19:31 ` [PATCH v1 2/4] OvmfPkg: IommuDxe: Provide support for mapping BusMasterCommonBuffer operation Brijesh Singh
2017-07-31 19:49   ` Ard Biesheuvel
2017-07-31 20:27     ` Brijesh Singh
2017-08-01 20:52       ` Laszlo Ersek
2017-08-01 21:59   ` Laszlo Ersek
2017-08-01 23:51     ` Brijesh Singh
2017-08-02  8:41       ` Laszlo Ersek
2017-07-31 19:31 ` [PATCH v1 3/4] OvmfPkg: IommuDxe: Zero the shared page(s) on Unmap() Brijesh Singh
2017-07-31 19:38   ` Brijesh Singh
2017-08-02  7:37   ` Laszlo Ersek
2017-08-02 11:22     ` Brijesh Singh
2017-08-02 12:52       ` Laszlo Ersek
2017-07-31 19:31 ` [PATCH v1 4/4] OvmfPkg : QemuFwCfgLib: Map DMA buffer with CommonBuffer when SEV is enable Brijesh Singh
2017-08-02  8:09   ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c94a3f0c-d5b4-3708-fbea-30fc1cd56438@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox