From nobody Sat Apr 27 16:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+97419+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97419+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1671081511; cv=none; d=zohomail.com; s=zohoarc; b=EgI/i/6Zlk4H3a8hNZG3erZnqElNBTX/UNVBeyI6uAHRDiu2ntQpdW7GkDjnHzouKfrhKPps4iFeL8l/tYXemxSAFPT0KU33T0TnwOVB531KFAIxrgoz5oi/ZfyFwgsqL+/RH9POXUPVqG7if82ySjSK8vOs4cBh3ZmaDx8aolw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671081511; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=vB5zz4AgYv30iINC2kWSP0/qDTaba4pOjBOQebEwPx0=; b=Le82BG1qT0MPRP5v8P0xDQT3wNeh50EJ/yJke9fDJOm4HQ20jubNQ7VitFzCHviMBmJpRmqXXMvu2kajTopbKIH03a6PhAxkyuu134V7ZBRO85duyqmOdS0bhJhgX3hq56VEyjEdDJEOcjNJ6jBjJlOeTKXCA/4ejEnp2IJC9Cs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97419+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1671081511546491.9363816156359; Wed, 14 Dec 2022 21:18:31 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id kYqmYY1788612xbFSJyU2tKk; Wed, 14 Dec 2022 21:18:31 -0800 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.126116.1671081508064919692 for ; Wed, 14 Dec 2022 21:18:30 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="316224091" X-IronPort-AV: E=Sophos;i="5.96,246,1665471600"; d="scan'208";a="316224091" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 21:18:30 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="642777951" X-IronPort-AV: E=Sophos;i="5.96,246,1665471600"; d="scan'208";a="642777951" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.170.19]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 21:18:27 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann , Jiewen Yao Subject: [edk2-devel] [PATCH V3 1/4] OvmfPkg/IoMmuDxe: Reserve shared memory region for DMA operation Date: Thu, 15 Dec 2022 13:18:07 +0800 Message-Id: <20221215051810.2027-2-min.m.xu@intel.com> In-Reply-To: <20221215051810.2027-1-min.m.xu@intel.com> References: <20221215051810.2027-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: tB1vf5NAtFNju99AgpyVnMU6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1671081511; bh=YNsVOfkUSYDqRox9ZLM42n1MmwGV2OKHnKiQpbGgs2U=; h=Cc:Date:From:Reply-To:Subject:To; b=w4aWWmskKJednFACPXor8sb3QReoepJrUFGz19Llqrq3IMh0pTMXeiCkHd548mFK/EQ iT6OHJzleDhPPvSf2ROdItF11cWHMD+qDx5INA0r+5QzwxKXXRbBwYduR21DTfGnuMrZs y49Ch9qGG6Ag7nHKaqyzmAX8ZEadcVJLg4Y= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1671081512169100005 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4171 A typical QEMU fw_cfg read bytes with IOMMU for td guest is that: (QemuFwCfgReadBytes@QemuFwCfgLib.c is the example) 1) Allocate DMA Access buffer 2) Map actual data buffer 3) start the transfer and wait for the transfer to complete 4) Free DMA Access buffer 5) Un-map actual data buffer In step 1/2, Private memories are allocated, converted to shared memories. In Step 4/5 the shared memories are converted to private memories and accepted again. The final step is to free the pages. This is time-consuming and impacts td guest's boot perf (both direct boot and grub boot) badly. In a typical grub boot, there are about 5000 calls of page allocation and private/share conversion. Most of page size is less than 32KB. This patch allocates a memory region and initializes it into pieces of memory with different sizes. A piece of such memory consists of 2 parts: the first page is of private memory, and the other pages are shared memory. This is to meet the layout of common buffer. When allocating bounce buffer in IoMmuMap(), IoMmuAllocateBounceBuffer() is called to allocate the buffer. Accordingly when freeing bounce buffer in IoMmuUnmapWorker(), IoMmuFreeBounceBuffer() is called to free the bounce buffer. CommonBuffer is allocated by IoMmuAllocateCommonBuffer and accordingly freed by IoMmuFreeCommonBuffer. This feature is tested in Intel TDX pre-production platform. It saves up to hundreds of ms in a grub boot. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Min Xu Reviewed-by: Tom Lendacky --- OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 142 +++++----- OvmfPkg/IoMmuDxe/IoMmuBuffer.c | 465 +++++++++++++++++++++++++++++++ OvmfPkg/IoMmuDxe/IoMmuDxe.inf | 1 + OvmfPkg/IoMmuDxe/IoMmuInternal.h | 179 ++++++++++++ 4 files changed, 716 insertions(+), 71 deletions(-) create mode 100644 OvmfPkg/IoMmuDxe/IoMmuBuffer.c create mode 100644 OvmfPkg/IoMmuDxe/IoMmuInternal.h diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c index 6b65897f032a..77e46bbf4a60 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c @@ -15,18 +15,7 @@ #include #include #include "AmdSevIoMmu.h" - -#define MAP_INFO_SIG SIGNATURE_64 ('M', 'A', 'P', '_', 'I', 'N', 'F', 'O') - -typedef struct { - UINT64 Signature; - LIST_ENTRY Link; - EDKII_IOMMU_OPERATION Operation; - UINTN NumberOfBytes; - UINTN NumberOfPages; - EFI_PHYSICAL_ADDRESS CryptedAddress; - EFI_PHYSICAL_ADDRESS PlainTextAddress; -} MAP_INFO; +#include "IoMmuInternal.h" =20 // // List of the MAP_INFO structures that have been set up by IoMmuMap() and= not @@ -35,7 +24,10 @@ typedef struct { // STATIC LIST_ENTRY mMapInfos =3D INITIALIZE_LIST_HEAD_VARIABLE (mMapInfos); =20 -#define COMMON_BUFFER_SIG SIGNATURE_64 ('C', 'M', 'N', 'B', 'U', 'F', 'F'= , 'R') +// +// Indicate if the feature of reserved memory is supported in DMA operatio= n. +// +BOOLEAN mReservedSharedMemSupported =3D FALSE; =20 // // ASCII names for EDKII_IOMMU_OPERATION constants, for debug logging. @@ -50,30 +42,6 @@ mBusMasterOperationName[EdkiiIoMmuOperationMaximum] =3D { "CommonBuffer64" }; =20 -// -// The following structure enables Map() and Unmap() to perform in-place -// decryption and encryption, respectively, for BusMasterCommonBuffer[64] -// operations, without dynamic memory allocation or release. -// -// Both COMMON_BUFFER_HEADER and COMMON_BUFFER_HEADER.StashBuffer are allo= cated -// by AllocateBuffer() and released by FreeBuffer(). -// -#pragma pack (1) -typedef struct { - UINT64 Signature; - - // - // Always allocated from EfiBootServicesData type memory, and always - // encrypted. - // - VOID *StashBuffer; - - // - // Followed by the actual common buffer, starting at the next page. - // -} COMMON_BUFFER_HEADER; -#pragma pack () - /** Provides the controller-specific addresses required to access system mem= ory from a DMA bus master. On SEV/TDX guest, the DMA operations must be perf= ormed on @@ -139,6 +107,8 @@ IoMmuMap ( return EFI_INVALID_PARAMETER; } =20 + Status =3D EFI_SUCCESS; + // // Allocate a MAP_INFO structure to remember the mapping when Unmap() is // called later. @@ -153,11 +123,12 @@ IoMmuMap ( // Initialize the MAP_INFO structure, except the PlainTextAddress field // ZeroMem (&MapInfo->Link, sizeof MapInfo->Link); - MapInfo->Signature =3D MAP_INFO_SIG; - MapInfo->Operation =3D Operation; - MapInfo->NumberOfBytes =3D *NumberOfBytes; - MapInfo->NumberOfPages =3D EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes); - MapInfo->CryptedAddress =3D (UINTN)HostAddress; + MapInfo->Signature =3D MAP_INFO_SIG; + MapInfo->Operation =3D Operation; + MapInfo->NumberOfBytes =3D *NumberOfBytes; + MapInfo->NumberOfPages =3D EFI_SIZE_TO_PAGES (MapInfo->NumberOfBytes= ); + MapInfo->CryptedAddress =3D (UINTN)HostAddress; + MapInfo->ReservedMemBitmap =3D 0; =20 // // In the switch statement below, we point "MapInfo->PlainTextAddress" t= o the @@ -185,12 +156,11 @@ IoMmuMap ( // // Allocate the implicit plaintext bounce buffer. // - Status =3D gBS->AllocatePages ( - AllocateType, - EfiBootServicesData, - MapInfo->NumberOfPages, - &MapInfo->PlainTextAddress - ); + Status =3D IoMmuAllocateBounceBuffer ( + AllocateType, + EfiBootServicesData, + MapInfo + ); if (EFI_ERROR (Status)) { goto FreeMapInfo; } @@ -241,7 +211,8 @@ IoMmuMap ( // Point "DecryptionSource" to the stash buffer so that we decrypt // it to the original location, after the switch statement. // - DecryptionSource =3D CommonBufferHeader->StashBuffer; + DecryptionSource =3D CommonBufferHeader->StashBuffer; + MapInfo->ReservedMemBitmap =3D CommonBufferHeader->ReservedMemBitmap; break; =20 default: @@ -264,12 +235,16 @@ IoMmuMap ( } else if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr)= )) { // // Set the memory shared bit. + // If MapInfo->ReservedMemBitmap is 0, it means the bounce buffer is n= ot allocated + // from the pre-allocated shared memory, so it must be converted to sh= ared memory here. // - Status =3D MemEncryptTdxSetPageSharedBit ( - 0, - MapInfo->PlainTextAddress, - MapInfo->NumberOfPages - ); + if (MapInfo->ReservedMemBitmap =3D=3D 0) { + Status =3D MemEncryptTdxSetPageSharedBit ( + 0, + MapInfo->PlainTextAddress, + MapInfo->NumberOfPages + ); + } } else { ASSERT (FALSE); } @@ -311,12 +286,13 @@ IoMmuMap ( =20 DEBUG (( DEBUG_VERBOSE, - "%a: Mapping=3D0x%p Device(PlainText)=3D0x%Lx Crypted=3D0x%Lx Pages=3D= 0x%Lx\n", + "%a: Mapping=3D0x%p Device(PlainText)=3D0x%Lx Crypted=3D0x%Lx Pages=3D= 0x%Lx, ReservedMemBitmap=3D0x%Lx\n", __FUNCTION__, MapInfo, MapInfo->PlainTextAddress, MapInfo->CryptedAddress, - (UINT64)MapInfo->NumberOfPages + (UINT64)MapInfo->NumberOfPages, + MapInfo->ReservedMemBitmap )); =20 return EFI_SUCCESS; @@ -435,11 +411,13 @@ IoMmuUnmapWorker ( // Restore the memory shared bit mask on the area we used to hold the // plaintext. // - Status =3D MemEncryptTdxClearPageSharedBit ( - 0, - MapInfo->PlainTextAddress, - MapInfo->NumberOfPages - ); + if (MapInfo->ReservedMemBitmap =3D=3D 0) { + Status =3D MemEncryptTdxClearPageSharedBit ( + 0, + MapInfo->PlainTextAddress, + MapInfo->NumberOfPages + ); + } } else { ASSERT (FALSE); } @@ -470,8 +448,9 @@ IoMmuUnmapWorker ( (VOID *)(UINTN)MapInfo->PlainTextAddress, EFI_PAGES_TO_SIZE (MapInfo->NumberOfPages) ); + if (!MemoryMapLocked) { - gBS->FreePages (MapInfo->PlainTextAddress, MapInfo->NumberOfPages); + IoMmuFreeBounceBuffer (MapInfo); } } =20 @@ -551,6 +530,7 @@ IoMmuAllocateBuffer ( VOID *StashBuffer; UINTN CommonBufferPages; COMMON_BUFFER_HEADER *CommonBufferHeader; + UINT32 ReservedMemBitmap; =20 DEBUG (( DEBUG_VERBOSE, @@ -620,12 +600,13 @@ IoMmuAllocateBuffer ( PhysicalAddress =3D SIZE_4GB - 1; } =20 - Status =3D gBS->AllocatePages ( - AllocateMaxAddress, - MemoryType, - CommonBufferPages, - &PhysicalAddress - ); + Status =3D IoMmuAllocateCommonBuffer ( + MemoryType, + CommonBufferPages, + &PhysicalAddress, + &ReservedMemBitmap + ); + if (EFI_ERROR (Status)) { goto FreeStashBuffer; } @@ -633,8 +614,9 @@ IoMmuAllocateBuffer ( CommonBufferHeader =3D (VOID *)(UINTN)PhysicalAddress; PhysicalAddress +=3D EFI_PAGE_SIZE; =20 - CommonBufferHeader->Signature =3D COMMON_BUFFER_SIG; - CommonBufferHeader->StashBuffer =3D StashBuffer; + CommonBufferHeader->Signature =3D COMMON_BUFFER_SIG; + CommonBufferHeader->StashBuffer =3D StashBuffer; + CommonBufferHeader->ReservedMemBitmap =3D ReservedMemBitmap; =20 *HostAddress =3D (VOID *)(UINTN)PhysicalAddress; =20 @@ -707,7 +689,7 @@ IoMmuFreeBuffer ( // Release the common buffer itself. Unmap() has re-encrypted it in-plac= e, so // no need to zero it. // - return gBS->FreePages ((UINTN)CommonBufferHeader, CommonBufferPages); + return IoMmuFreeCommonBuffer (CommonBufferHeader, CommonBufferPages); } =20 /** @@ -878,6 +860,11 @@ IoMmuUnmapAllMappings ( TRUE // MemoryMapLocked ); } + + // + // Release the reserved shared memory as well. + // + IoMmuReleaseReservedSharedMem (TRUE); } =20 /** @@ -936,6 +923,19 @@ InstallIoMmuProtocol ( goto CloseExitBootEvent; } =20 + // + // Currently only Tdx guest support Reserved shared memory for DMA opera= tion. + // + if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { + mReservedSharedMemSupported =3D TRUE; + Status =3D IoMmuInitReservedSharedMem (); + if (EFI_ERROR (Status)) { + mReservedSharedMemSupported =3D FALSE; + } else { + DEBUG ((DEBUG_INFO, "%a: Feature of reserved memory for DMA is suppo= rted.\n", __FUNCTION__)); + } + } + return EFI_SUCCESS; =20 CloseExitBootEvent: diff --git a/OvmfPkg/IoMmuDxe/IoMmuBuffer.c b/OvmfPkg/IoMmuDxe/IoMmuBuffer.c new file mode 100644 index 000000000000..2675223aa0df --- /dev/null +++ b/OvmfPkg/IoMmuDxe/IoMmuBuffer.c @@ -0,0 +1,465 @@ +/** @file + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#include +#include +#include +#include +#include +#include +#include "IoMmuInternal.h" + +extern BOOLEAN mReservedSharedMemSupported; + +#define SIZE_OF_MEM_RANGE(MemRange) (MemRange->HeaderSize + MemRange->Dat= aSize) + +#define RESERVED_MEM_BITMAP_4K_MASK 0xf +#define RESERVED_MEM_BITMAP_32K_MASK 0xff0 +#define RESERVED_MEM_BITMAP_128K_MASK 0x3000 +#define RESERVED_MEM_BITMAP_1M_MASK 0x40000 +#define RESERVED_MEM_BITMAP_2M_MASK 0x180000 +#define RESERVED_MEM_BITMAP_MASK 0x1fffff + +/** + * mReservedMemRanges describes the layout of the reserved memory. + * The reserved memory consists of disfferent size of memory region. + * The pieces of memory with the same size are managed by one entry + * in the mReservedMemRanges. All the pieces of memories are managed by + * mReservedMemBitmap which is a UINT32. It means it can manage at most + * 32 pieces of memory. Because of the layout of CommonBuffer + * (1-page header + n-page data), a piece of reserved memory consists of + * 2 parts: Header + Data. + * + * So put all these together, mReservedMemRanges and mReservedMemBitmap + * are designed to manage the reserved memory. + * + * Use the second entry of mReservedMemRanges as an example. + * { RESERVED_MEM_BITMAP_32K_MASK, 4, 8, SIZE_32KB, SIZE_4KB, 0 }, + * - RESERVED_MEM_BITMAP_32K_MASK is 0xff0. It means bit4-11 in mReservedM= emBitmap + * is reserved for 32K size memory. + * - 4 is the shift of mReservedMemBitmap. + * - 8 means there are 8 pieces of 32K size memory. + * - SIZE_32KB indicates the size of Data part. + * - SIZE_4KB is the size of Header part. + * - 0 is the start address of this memory range which will be populated w= hen + * the reserved memory is initialized. + * + * The size and count of the memory region are derived from the experience= . For + * a typical grub boot, there are about 5100 IoMmu/DMA operation. Most of = these + * DMA operation require the memory with size less than 32K (~5080). But w= e find + * in grub boot there may be 2 DMA operation which require for the memory = larger + * than 1M. And these 2 DMA operation occur concurrently. So we reserve 2 = pieces + * of memory with size of SIZE_2MB. This is for the best boot performance. + * + * If all the reserved memory are exausted, then it will fall back to the = legacy + * memory allocation as before. + */ +STATIC IOMMU_RESERVED_MEM_RANGE mReservedMemRanges[] =3D { + { RESERVED_MEM_BITMAP_4K_MASK, 0, 4, SIZE_4KB, SIZE_4KB, 0 }, + { RESERVED_MEM_BITMAP_32K_MASK, 4, 8, SIZE_32KB, SIZE_4KB, 0 }, + { RESERVED_MEM_BITMAP_128K_MASK, 12, 2, SIZE_128KB, SIZE_4KB, 0 }, + { RESERVED_MEM_BITMAP_1M_MASK, 14, 1, SIZE_1MB, SIZE_4KB, 0 }, + { RESERVED_MEM_BITMAP_2M_MASK, 15, 2, SIZE_2MB, SIZE_4KB, 0 }, +}; + +// +// Bitmap of the allocation of reserved memory. +// +STATIC UINT32 mReservedMemBitmap =3D 0; + +// +// Start address of the reserved memory region. +// +STATIC EFI_PHYSICAL_ADDRESS mReservedSharedMemAddress =3D 0; + +// +// Total size of the reserved memory region. +// +STATIC UINT32 mReservedSharedMemSize =3D 0; + +/** + * Calculate the size of reserved memory. + * + * @retval UINT32 Size of the reserved memory + */ +STATIC +UINT32 +CalcuateReservedMemSize ( + VOID + ) +{ + UINT32 Index; + IOMMU_RESERVED_MEM_RANGE *MemRange; + + if (mReservedSharedMemSize !=3D 0) { + return mReservedSharedMemSize; + } + + for (Index =3D 0; Index < ARRAY_SIZE (mReservedMemRanges); Index++) { + MemRange =3D &mReservedMemRanges[Index]; + mReservedSharedMemSize +=3D (SIZE_OF_MEM_RANGE (MemRange) * MemRange->= Slots); + } + + return mReservedSharedMemSize; +} + +/** + * Allocate a memory region and convert it to be shared. This memory regio= n will be + * used in the DMA operation. + * + * The pre-alloc memory contains pieces of memory regions with different s= ize. The + * allocation of the shared memory regions are indicated by a 32-bit bitma= p (mReservedMemBitmap). + * + * The memory regions are consumed by IoMmuAllocateBuffer (in which Common= Buffer is allocated) and + * IoMmuMap (in which bounce buffer is allocated). + * + * The CommonBuffer contains 2 parts, one page for CommonBufferHeader whic= h is private memory, + * the other part is shared memory. So the layout of a piece of memory reg= ion after initialization + * looks like: + * + * |------------|----------------------------| + * | Header | Data | <-- a piece of pre-all= oc memory region + * | 4k, private| 4k/32k/128k/etc, shared | + * |-----------------------------------------| + * + * @retval EFI_SUCCESS Successfully initialize the reserved memory. + * @retval EFI_UNSUPPORTED This feature is not supported. + */ +EFI_STATUS +IoMmuInitReservedSharedMem ( + VOID + ) +{ + EFI_STATUS Status; + UINT32 Index1, Index2; + UINTN TotalPages; + IOMMU_RESERVED_MEM_RANGE *MemRange; + EFI_PHYSICAL_ADDRESS PhysicalAddress; + + if (!mReservedSharedMemSupported) { + return EFI_UNSUPPORTED; + } + + TotalPages =3D EFI_SIZE_TO_PAGES (CalcuateReservedMemSize ()); + + PhysicalAddress =3D (EFI_PHYSICAL_ADDRESS)(UINTN)AllocatePages (TotalPag= es); + DEBUG (( + DEBUG_VERBOSE, + "%a: ReservedMem (%d pages) address =3D 0x%llx\n", + __FUNCTION__, + TotalPages, + PhysicalAddress + )); + + mReservedMemBitmap =3D 0; + mReservedSharedMemAddress =3D PhysicalAddress; + + for (Index1 =3D 0; Index1 < ARRAY_SIZE (mReservedMemRanges); Index1++) { + MemRange =3D &mReservedMemRanges[Index1]; + MemRange->StartAddressOfMemRange =3D PhysicalAddress; + + for (Index2 =3D 0; Index2 < MemRange->Slots; Index2++) { + Status =3D MemEncryptTdxSetPageSharedBit ( + 0, + (UINT64)(UINTN)(MemRange->StartAddressOfMemRange + Index2= * SIZE_OF_MEM_RANGE (MemRange) + MemRange->HeaderSize), + EFI_SIZE_TO_PAGES (MemRange->DataSize) + ); + ASSERT (!EFI_ERROR (Status)); + } + + PhysicalAddress +=3D (MemRange->Slots * SIZE_OF_MEM_RANGE (MemRange)); + } + + return EFI_SUCCESS; +} + +/** + * Release the pre-alloc shared memory. + * + * @retval EFI_SUCCESS Successfully release the shared memory + */ +EFI_STATUS +IoMmuReleaseReservedSharedMem ( + BOOLEAN MemoryMapLocked + ) +{ + EFI_STATUS Status; + UINT32 Index1, Index2; + IOMMU_RESERVED_MEM_RANGE *MemRange; + + if (!mReservedSharedMemSupported) { + return EFI_SUCCESS; + } + + for (Index1 =3D 0; Index1 < ARRAY_SIZE (mReservedMemRanges); Index1++) { + MemRange =3D &mReservedMemRanges[Index1]; + for (Index2 =3D 0; Index2 < MemRange->Slots; Index2++) { + Status =3D MemEncryptTdxClearPageSharedBit ( + 0, + (UINT64)(UINTN)(MemRange->StartAddressOfMemRange + Index2= * SIZE_OF_MEM_RANGE (MemRange) + MemRange->HeaderSize), + EFI_SIZE_TO_PAGES (MemRange->DataSize) + ); + ASSERT (!EFI_ERROR (Status)); + } + } + + if (!MemoryMapLocked) { + FreePages ((VOID *)(UINTN)mReservedSharedMemAddress, EFI_SIZE_TO_PAGES= (CalcuateReservedMemSize ())); + mReservedSharedMemAddress =3D 0; + mReservedMemBitmap =3D 0; + } + + mReservedSharedMemSupported =3D FALSE; + + return EFI_SUCCESS; +} + +/** + * Allocate from the reserved memory pool. + * If the reserved shared memory is exausted or there is no suitalbe size,= it turns + * to the LegacyAllocateBuffer. + * + * @param Type Allocate type + * @param MemoryType The memory type to be allocated + * @param Pages Pages to be allocated. + * @param ReservedMemBitmap Bitmap of the allocated memory region + * @param PhysicalAddress Pointer to the data part of allocated memory= region + * + * @retval EFI_SUCCESS Successfully allocate the buffer + * @retval Other As the error code indicates + */ +STATIC +EFI_STATUS +InternalAllocateBuffer ( + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN Pages, + IN OUT UINT32 *ReservedMemBitmap, + IN OUT EFI_PHYSICAL_ADDRESS *PhysicalAddress + ) +{ + UINT32 MemBitmap; + UINT8 Index; + IOMMU_RESERVED_MEM_RANGE *MemRange; + UINTN PagesOfLastMemRange; + + *ReservedMemBitmap =3D 0; + + if (Pages =3D=3D 0) { + ASSERT (FALSE); + return EFI_INVALID_PARAMETER; + } + + if (!mReservedSharedMemSupported) { + goto LegacyAllocateBuffer; + } + + if (mReservedSharedMemAddress =3D=3D 0) { + goto LegacyAllocateBuffer; + } + + PagesOfLastMemRange =3D 0; + + for (Index =3D 0; Index < ARRAY_SIZE (mReservedMemRanges); Index++) { + if ((Pages > PagesOfLastMemRange) && (Pages <=3D EFI_SIZE_TO_PAGES (mR= eservedMemRanges[Index].DataSize))) { + break; + } + + PagesOfLastMemRange =3D EFI_SIZE_TO_PAGES (mReservedMemRanges[Index].D= ataSize); + } + + if (Index =3D=3D ARRAY_SIZE (mReservedMemRanges)) { + // There is no suitable size of reserved memory. Turn to legacy alloca= te. + goto LegacyAllocateBuffer; + } + + MemRange =3D &mReservedMemRanges[Index]; + + if ((mReservedMemBitmap & MemRange->BitmapMask) =3D=3D MemRange->BitmapM= ask) { + // The reserved memory is exausted. Turn to legacy allocate. + goto LegacyAllocateBuffer; + } + + MemBitmap =3D (mReservedMemBitmap & MemRange->BitmapMask) >> MemRange->S= hift; + + for (Index =3D 0; Index < MemRange->Slots; Index++) { + if ((MemBitmap & (UINT8)(1<Slots); + + *PhysicalAddress =3D MemRange->StartAddressOfMemRange + Index * SIZE_O= F_MEM_RANGE (MemRange) + MemRange->HeaderSize; + *ReservedMemBitmap =3D (UINT32)(1 << (Index + MemRange->Shift)); + + DEBUG (( + DEBUG_VERBOSE, + "%a: range-size: %lx, start-address=3D0x%llx, pages=3D0x%llx, bits=3D0= x%lx, bitmap: %lx =3D> %lx\n", + __FUNCTION__, + MemRange->DataSize, + *PhysicalAddress, + Pages, + *ReservedMemBitmap, + mReservedMemBitmap, + mReservedMemBitmap | *ReservedMemBitmap + )); + + return EFI_SUCCESS; + +LegacyAllocateBuffer: + + *ReservedMemBitmap =3D 0; + return gBS->AllocatePages (Type, MemoryType, Pages, PhysicalAddress); +} + +/** + * Allocate reserved shared memory for bounce buffer. + * + * @param Type Allocate type + * @param MemoryType The memory type to be allocated + * @param MapInfo Pointer to the MAP_INFO + * + * @retval EFI_SUCCESS Successfully allocate the bounce buffer + * @retval Other As the error code indicates + + */ +EFI_STATUS +IoMmuAllocateBounceBuffer ( + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN OUT MAP_INFO *MapInfo + ) +{ + EFI_STATUS Status; + UINT32 ReservedMemBitmap; + + ReservedMemBitmap =3D 0; + Status =3D InternalAllocateBuffer ( + Type, + MemoryType, + MapInfo->NumberOfPages, + &ReservedMemBitmap, + &MapInfo->PlainTextAddress + ); + MapInfo->ReservedMemBitmap =3D ReservedMemBitmap; + mReservedMemBitmap |=3D ReservedMemBitmap; + + ASSERT (Status =3D=3D EFI_SUCCESS); + + return Status; +} + +/** + * Free the bounce buffer allocated in IoMmuAllocateBounceBuffer. + * + * @param MapInfo Pointer to the MAP_INFO + * @return EFI_SUCCESS Successfully free the bounce buffer. + */ +EFI_STATUS +IoMmuFreeBounceBuffer ( + IN OUT MAP_INFO *MapInfo + ) +{ + if (MapInfo->ReservedMemBitmap =3D=3D 0) { + gBS->FreePages (MapInfo->PlainTextAddress, MapInfo->NumberOfPages); + } else { + DEBUG (( + DEBUG_VERBOSE, + "%a: PlainTextAddress=3D0x%Lx, bits=3D0x%Lx, bitmap: %Lx =3D> %Lx\n", + __FUNCTION__, + MapInfo->PlainTextAddress, + MapInfo->ReservedMemBitmap, + mReservedMemBitmap, + mReservedMemBitmap & ((UINT32)(~MapInfo->ReservedMemBitmap)) + )); + MapInfo->PlainTextAddress =3D 0; + mReservedMemBitmap &=3D (UINT32)(~MapInfo->ReservedMemBitmap); + MapInfo->ReservedMemBitmap =3D 0; + } + + return EFI_SUCCESS; +} + +/** + * Allocate CommonBuffer from pre-allocated shared memory. + * + * @param MemoryType Memory type + * @param CommonBufferPages Pages of CommonBuffer + * @param PhysicalAddress Allocated physical address + * @param ReservedMemBitmap Bitmap which indicates the allocation of res= erved memory + * + * @retval EFI_SUCCESS Successfully allocate the common buffer + * @retval Other As the error code indicates + */ +EFI_STATUS +IoMmuAllocateCommonBuffer ( + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN CommonBufferPages, + OUT EFI_PHYSICAL_ADDRESS *PhysicalAddress, + OUT UINT32 *ReservedMemBitmap + ) +{ + EFI_STATUS Status; + + Status =3D InternalAllocateBuffer ( + AllocateMaxAddress, + MemoryType, + CommonBufferPages, + ReservedMemBitmap, + PhysicalAddress + ); + ASSERT (Status =3D=3D EFI_SUCCESS); + + mReservedMemBitmap |=3D *ReservedMemBitmap; + + if (*ReservedMemBitmap !=3D 0) { + *PhysicalAddress -=3D SIZE_4KB; + } + + return Status; +} + +/** + * Free CommonBuffer which is allocated by IoMmuAllocateCommonBuffer(). + * + * @param CommonBufferHeader Pointer to the CommonBufferHeader + * @param CommonBufferPages Pages of CommonBuffer + * + * @retval EFI_SUCCESS Successfully free the common buffer + * @retval Other As the error code indicates + */ +EFI_STATUS +IoMmuFreeCommonBuffer ( + IN COMMON_BUFFER_HEADER *CommonBufferHeader, + IN UINTN CommonBufferPages + ) +{ + if (!mReservedSharedMemSupported) { + goto LegacyFreeCommonBuffer; + } + + if (CommonBufferHeader->ReservedMemBitmap =3D=3D 0) { + goto LegacyFreeCommonBuffer; + } + + DEBUG (( + DEBUG_VERBOSE, + "%a: CommonBuffer=3D0x%Lx, bits=3D0x%Lx, bitmap: %Lx =3D> %Lx\n", + __FUNCTION__, + (UINT64)(UINTN)CommonBufferHeader + SIZE_4KB, + CommonBufferHeader->ReservedMemBitmap, + mReservedMemBitmap, + mReservedMemBitmap & ((UINT32)(~CommonBufferHeader->ReservedMemBitmap)) + )); + + mReservedMemBitmap &=3D (UINT32)(~CommonBufferHeader->ReservedMemBitmap); + return EFI_SUCCESS; + +LegacyFreeCommonBuffer: + return gBS->FreePages ((UINTN)CommonBufferHeader, CommonBufferPages); +} diff --git a/OvmfPkg/IoMmuDxe/IoMmuDxe.inf b/OvmfPkg/IoMmuDxe/IoMmuDxe.inf index e10be1dcff49..2192145ea661 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuDxe.inf +++ b/OvmfPkg/IoMmuDxe/IoMmuDxe.inf @@ -21,6 +21,7 @@ AmdSevIoMmu.c AmdSevIoMmu.h IoMmuDxe.c + IoMmuBuffer.c =20 [Packages] MdePkg/MdePkg.dec diff --git a/OvmfPkg/IoMmuDxe/IoMmuInternal.h b/OvmfPkg/IoMmuDxe/IoMmuInter= nal.h new file mode 100644 index 000000000000..936c35aa536c --- /dev/null +++ b/OvmfPkg/IoMmuDxe/IoMmuInternal.h @@ -0,0 +1,179 @@ +/** @file + + Copyright (c) 2022, Intel Corporation. All rights reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef IOMMU_INTERNAL_H_ +#define IOMMU_INTERNAL_H_ + +#include +#include +#include +#include + +#define MAP_INFO_SIG SIGNATURE_64 ('M', 'A', 'P', '_', 'I', 'N', 'F', 'O') + +typedef struct { + UINT64 Signature; + LIST_ENTRY Link; + EDKII_IOMMU_OPERATION Operation; + UINTN NumberOfBytes; + UINTN NumberOfPages; + EFI_PHYSICAL_ADDRESS CryptedAddress; + EFI_PHYSICAL_ADDRESS PlainTextAddress; + UINT32 ReservedMemBitmap; +} MAP_INFO; + +#define COMMON_BUFFER_SIG SIGNATURE_64 ('C', 'M', 'N', 'B', 'U', 'F', 'F'= , 'R') + +#pragma pack (1) +// +// The following structure enables Map() and Unmap() to perform in-place +// decryption and encryption, respectively, for BusMasterCommonBuffer[64] +// operations, without dynamic memory allocation or release. +// +// Both COMMON_BUFFER_HEADER and COMMON_BUFFER_HEADER.StashBuffer are allo= cated +// by AllocateBuffer() and released by FreeBuffer(). +// +typedef struct { + UINT64 Signature; + + // + // Always allocated from EfiBootServicesData type memory, and always + // encrypted. + // + VOID *StashBuffer; + + // + // Bitmap of reserved memory + // + UINT32 ReservedMemBitmap; + + // + // Followed by the actual common buffer, starting at the next page. + // +} COMMON_BUFFER_HEADER; + +// +// This data structure defines a memory range in the reserved memory regio= n. +// Please refer to IoMmuInitReservedSharedMem() for detailed information. +// +// The memory region looks like: +// |------------|----------------------------| +// | Header | Data | +// | 4k, private| 4k/32k/128k/etc, shared | +// |-----------------------------------------| +// +typedef struct { + UINT32 BitmapMask; + UINT32 Shift; + UINT32 Slots; + UINT32 DataSize; + UINT32 HeaderSize; + EFI_PHYSICAL_ADDRESS StartAddressOfMemRange; +} IOMMU_RESERVED_MEM_RANGE; +#pragma pack() + +/** + * Allocate a memory region and convert it to be shared. This memory regio= n will be + * used in the DMA operation. + * + * The pre-alloc memory contains pieces of memory regions with different s= ize. The + * allocation of the shared memory regions are indicated by a 32-bit bitma= p (mReservedMemBitmap). + * + * The memory regions are consumed by IoMmuAllocateBuffer (in which Common= Buffer is allocated) and + * IoMmuMap (in which bounce buffer is allocated). + * + * The CommonBuffer contains 2 parts, one page for CommonBufferHeader whic= h is private memory, + * the other part is shared memory. So the layout of a piece of memory reg= ion after initialization + * looks like: + * + * |------------|----------------------------| + * | Header | Data | <-- a piece of pre-all= oc memory region + * | 4k, private| 4k/32k/128k/etc, shared | + * |-----------------------------------------| + * + * @retval EFI_SUCCESS Successfully initialize the reserved memory. + * @retval EFI_UNSUPPORTED This feature is not supported. + */ +EFI_STATUS +IoMmuInitReservedSharedMem ( + VOID + ); + +/** + * Release the pre-alloc shared memory. + * + * @retval EFI_SUCCESS Successfully release the shared memory + */ +EFI_STATUS +IoMmuReleaseReservedSharedMem ( + BOOLEAN MemoryMapLocked + ); + +/** + * Allocate reserved shared memory for bounce buffer. + * + * @param Type Allocate type + * @param MemoryType The memory type to be allocated + * @param MapInfo Pointer to the MAP_INFO + * + * @retval EFI_SUCCESS Successfully allocate the bounce buffer + * @retval Other As the error code indicates + */ +EFI_STATUS +IoMmuAllocateBounceBuffer ( + IN EFI_ALLOCATE_TYPE Type, + IN EFI_MEMORY_TYPE MemoryType, + IN OUT MAP_INFO *MapInfo + ); + +/** + * Free the bounce buffer allocated in IoMmuAllocateBounceBuffer. + * + * @param MapInfo Pointer to the MAP_INFO + * @return EFI_SUCCESS Successfully free the bounce buffer. + */ +EFI_STATUS +IoMmuFreeBounceBuffer ( + IN OUT MAP_INFO *MapInfo + ); + +/** + * Allocate CommonBuffer from pre-allocated shared memory. + * + * @param MemoryType Memory type + * @param CommonBufferPages Pages of CommonBuffer + * @param PhysicalAddress Allocated physical address + * @param ReservedMemBitmap Bitmap which indicates the allocation of res= erved memory + * + * @retval EFI_SUCCESS Successfully allocate the common buffer + * @retval Other As the error code indicates + */ +EFI_STATUS +IoMmuAllocateCommonBuffer ( + IN EFI_MEMORY_TYPE MemoryType, + IN UINTN CommonBufferPages, + OUT EFI_PHYSICAL_ADDRESS *PhysicalAddress, + OUT UINT32 *ReservedMemBitmap + ); + +/** + * Free CommonBuffer which is allocated by IoMmuAllocateCommonBuffer(). + * + * @param CommonBufferHeader Pointer to the CommonBufferHeader + * @param CommonBufferPages Pages of CommonBuffer + * + * @retval EFI_SUCCESS Successfully free the common buffer + * @retval Other As the error code indicates + */ +EFI_STATUS +IoMmuFreeCommonBuffer ( + IN COMMON_BUFFER_HEADER *CommonBufferHeader, + IN UINTN CommonBufferPages + ); + +#endif --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97419): https://edk2.groups.io/g/devel/message/97419 Mute This Topic: https://groups.io/mt/95683530/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat Apr 27 16:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+97420+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97420+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1671081514; cv=none; d=zohomail.com; s=zohoarc; b=TpHVRHtkiL+1tzz9K6vA7SEbrFyMNBmi63W3YKfCelOqEVVp+Lna4eYR5PgOxWG48LZYgPyK0uKNtrxNm9qoLn4QqrOpGc0l4Ma2WfIuCDwP7qyrOKq34N2xI88W84/ZnUwfejszLUa7yNSauea/yQH9/w22ZYsV2zXcx1VhrAE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671081514; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=CwXYHJq7qOHvF8bhfWK/nFiPaIOj1ftnW0YMqhUAPBs=; b=gZ8mtc3wATyO3liDYRP93X+wEjDz7yW4uJK/Sf5UnaAyd3vrhmIltv9y35evbZGz2u3fmsD/1auRs7u6CWpfzScdohfJ0udIRZnxnzrFLPA9TjpmPn1K8drPUp3/oMQDdYIqxMvcZA1l6ofOhOwsdr0AGp/fvf41SgUqzboFWbA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97420+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1671081514064258.9902902024361; Wed, 14 Dec 2022 21:18:34 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id vy77YY1788612xYCZsh2VJhG; Wed, 14 Dec 2022 21:18:33 -0800 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.126116.1671081508064919692 for ; Wed, 14 Dec 2022 21:18:32 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="316224113" X-IronPort-AV: E=Sophos;i="5.96,246,1665471600"; d="scan'208";a="316224113" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 21:18:32 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="642778007" X-IronPort-AV: E=Sophos;i="5.96,246,1665471600"; d="scan'208";a="642778007" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.170.19]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 21:18:30 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann , Jiewen Yao Subject: [edk2-devel] [PATCH V3 2/4] OvmfPkg/IoMmuDxe: Rename AmdSevIoMmu to CcIoMmu Date: Thu, 15 Dec 2022 13:18:08 +0800 Message-Id: <20221215051810.2027-3-min.m.xu@intel.com> In-Reply-To: <20221215051810.2027-1-min.m.xu@intel.com> References: <20221215051810.2027-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: 12CPjNNsWy8Ru8HDh3QfPrrlx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1671081513; bh=Lngi7KqFZRtZL+k3c7KNt1live3JrTMpLRcOA4CkedE=; h=Cc:Date:From:Reply-To:Subject:To; b=pCeMoBC+AtU84BBI8GoPrBKUduN9P3p2pB+gGF/Jzg60Re/e1pO48LTRZ6tonQCQdQF hqRkh7sNJyNrNrAQzvW09NGyUwywcfJdqMqP9HolxgaNC5qSA8p9ZZLhZbPDs5hl1NMh4 Vh4SE1Ob4CKOAAWo7pimzofZ3AHN9ZYOYo8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1671081516127100011 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4171 IoMmuDxe once was designed to support DMA operation when SEV is enabled. After TDX is enabled in IoMmuDxe, some files' name in IoMmuDxe need to be more general. So this patch rename: AmdSevIoMmu.h -> CcIoMmu.h AmdSevIoMmu.c -> CcIoMmu.c Accordingly there are some udates in IoMmuDxe.c and IoMmuDxe.inf. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Min Xu Reviewed-by: Tom Lendacky --- OvmfPkg/IoMmuDxe/{AmdSevIoMmu.c =3D> CcIoMmu.c} | 2 +- OvmfPkg/IoMmuDxe/{AmdSevIoMmu.h =3D> CcIoMmu.h} | 0 OvmfPkg/IoMmuDxe/IoMmuDxe.c | 2 +- OvmfPkg/IoMmuDxe/IoMmuDxe.inf | 5 ++--- 4 files changed, 4 insertions(+), 5 deletions(-) rename OvmfPkg/IoMmuDxe/{AmdSevIoMmu.c =3D> CcIoMmu.c} (96%) rename OvmfPkg/IoMmuDxe/{AmdSevIoMmu.h =3D> CcIoMmu.h} (100%) diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/CcIoMmu.c similarity index 96% rename from OvmfPkg/IoMmuDxe/AmdSevIoMmu.c rename to OvmfPkg/IoMmuDxe/CcIoMmu.c index 77e46bbf4a60..1479af469881 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c +++ b/OvmfPkg/IoMmuDxe/CcIoMmu.c @@ -14,7 +14,7 @@ =20 #include #include -#include "AmdSevIoMmu.h" +#include "CcIoMmu.h" #include "IoMmuInternal.h" =20 // diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.h b/OvmfPkg/IoMmuDxe/CcIoMmu.h similarity index 100% rename from OvmfPkg/IoMmuDxe/AmdSevIoMmu.h rename to OvmfPkg/IoMmuDxe/CcIoMmu.h diff --git a/OvmfPkg/IoMmuDxe/IoMmuDxe.c b/OvmfPkg/IoMmuDxe/IoMmuDxe.c index 86777dd05c26..aab6d8b90687 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuDxe.c +++ b/OvmfPkg/IoMmuDxe/IoMmuDxe.c @@ -9,7 +9,7 @@ =20 **/ =20 -#include "AmdSevIoMmu.h" +#include "CcIoMmu.h" =20 EFI_STATUS EFIAPI diff --git a/OvmfPkg/IoMmuDxe/IoMmuDxe.inf b/OvmfPkg/IoMmuDxe/IoMmuDxe.inf index 2192145ea661..17fca5285692 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuDxe.inf +++ b/OvmfPkg/IoMmuDxe/IoMmuDxe.inf @@ -18,8 +18,8 @@ ENTRY_POINT =3D IoMmuDxeEntryPoint =20 [Sources] - AmdSevIoMmu.c - AmdSevIoMmu.h + CcIoMmu.c + CcIoMmu.h IoMmuDxe.c IoMmuBuffer.c =20 @@ -27,7 +27,6 @@ MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec OvmfPkg/OvmfPkg.dec -# UefiCpuPkg/UefiCpuPkg.dec =20 [LibraryClasses] BaseLib --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97420): https://edk2.groups.io/g/devel/message/97420 Mute This Topic: https://groups.io/mt/95683531/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat Apr 27 16:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+97421+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97421+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1671081516; cv=none; d=zohomail.com; s=zohoarc; b=g73m1VDzOmnrgny7aWSLqnyQryAKqYCNfBjZxa+eCtFq1jYGPttmvKuZ02dZmMqMrOGcLcr26tPV77v8cZYE2hQy6UOCRFVeTnjtcOWVYtW6eF9H67UXQh9qJVtdOq/5dwpulhl6HZwqyiQywfL9rFhbzz2rgfB2Maf/WfkXNRU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671081516; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=wEmNk7KfbiDV0uTcimrm2QS0kfYOg7pYBwIs4ppwYxk=; b=EC8qaGzHtV2SOebLe8Ivxv+nkM7jFB7P9oodPpDVR333nib7OSJjuLteizhTUl11xFZYwtBb33VBQcVwpDqk8JS7vmJAbJ7SWmKmm2dpmmCO9/3Ick29/X0k2ZVG8MAxnZI0zrPOUi/LCx/T5f5ZQO2dK8sTuTZ+labzBqup6Ao= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97421+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 167108151626342.83133440982817; Wed, 14 Dec 2022 21:18:36 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id bvP9YY1788612xFup72I8b6U; Wed, 14 Dec 2022 21:18:35 -0800 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.126116.1671081508064919692 for ; Wed, 14 Dec 2022 21:18:35 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="316224135" X-IronPort-AV: E=Sophos;i="5.96,246,1665471600"; d="scan'208";a="316224135" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 21:18:35 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="642778058" X-IronPort-AV: E=Sophos;i="5.96,246,1665471600"; d="scan'208";a="642778058" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.170.19]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 21:18:32 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Tom Lendacky , Erdem Aktas , James Bottomley , Jiewen Yao , Min Xu , Gerd Hoffmann , Jiewen Yao Subject: [edk2-devel] [PATCH V3 3/4] OvmfPkg/IoMmuDxe: Add SEV support for reserved shared memory Date: Thu, 15 Dec 2022 13:18:09 +0800 Message-Id: <20221215051810.2027-4-min.m.xu@intel.com> In-Reply-To: <20221215051810.2027-1-min.m.xu@intel.com> References: <20221215051810.2027-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: eekJ3NqkFzGUAVioft7O4E93x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1671081515; bh=Vak1VoE7Xuk1Mnxr4J76CwZbCA6X7j41oTh5qaUk280=; h=Cc:Date:From:Reply-To:Subject:To; b=SSTWEPSRHJgl9ul7RTe3FqHoS7TnJzw6WCSu3XGOSHZmf3B3X6cpCDFCreEtjvfVwH8 bynfrGm5MO1I6rrTNgXdJFwdD64GLOaNP6ZR4AkZ5+3g16ksWs6iv6R0JfcCvLDRxe+tr S7btte+NqKoArhX3Y4B9rPkmuVeULXZ9i2o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1671081518151100014 Content-Type: text/plain; charset="utf-8" From: Tom Lendacky Add support to use the reserved shared memory within the IoMmu library. This improves boot times for all SEV guests, with SEV-SNP benefiting the most as it avoids the page state change call to the hypervisor. Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Min Xu Cc: Gerd Hoffmann Acked-by: Jiewen Yao Signed-off-by: Tom Lendacky Reviewed-by: Tom Lendacky --- OvmfPkg/IoMmuDxe/CcIoMmu.c | 82 +++++++++++++++++----------------- OvmfPkg/IoMmuDxe/IoMmuBuffer.c | 54 +++++++++++++++++----- 2 files changed, 83 insertions(+), 53 deletions(-) diff --git a/OvmfPkg/IoMmuDxe/CcIoMmu.c b/OvmfPkg/IoMmuDxe/CcIoMmu.c index 1479af469881..7c2843cd238a 100644 --- a/OvmfPkg/IoMmuDxe/CcIoMmu.c +++ b/OvmfPkg/IoMmuDxe/CcIoMmu.c @@ -223,30 +223,32 @@ IoMmuMap ( goto FreeMapInfo; } =20 - if (CC_GUEST_IS_SEV (PcdGet64 (PcdConfidentialComputingGuestAttr))) { + if (MapInfo->ReservedMemBitmap =3D=3D 0) { // - // Clear the memory encryption mask on the plaintext buffer. - // - Status =3D MemEncryptSevClearPageEncMask ( - 0, - MapInfo->PlainTextAddress, - MapInfo->NumberOfPages - ); - } else if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr)= )) { - // - // Set the memory shared bit. // If MapInfo->ReservedMemBitmap is 0, it means the bounce buffer is n= ot allocated // from the pre-allocated shared memory, so it must be converted to sh= ared memory here. // - if (MapInfo->ReservedMemBitmap =3D=3D 0) { + if (CC_GUEST_IS_SEV (PcdGet64 (PcdConfidentialComputingGuestAttr))) { + // + // Clear the memory encryption mask on the plaintext buffer. + // + Status =3D MemEncryptSevClearPageEncMask ( + 0, + MapInfo->PlainTextAddress, + MapInfo->NumberOfPages + ); + } else if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAtt= r))) { + // + // Set the memory shared bit. + // Status =3D MemEncryptTdxSetPageSharedBit ( 0, MapInfo->PlainTextAddress, MapInfo->NumberOfPages ); + } else { + ASSERT (FALSE); } - } else { - ASSERT (FALSE); } =20 ASSERT_EFI_ERROR (Status); @@ -396,30 +398,30 @@ IoMmuUnmapWorker ( break; } =20 - if (CC_GUEST_IS_SEV (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - // - // Restore the memory encryption mask on the area we used to hold the - // plaintext. - // - Status =3D MemEncryptSevSetPageEncMask ( - 0, - MapInfo->PlainTextAddress, - MapInfo->NumberOfPages - ); - } else if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr)= )) { - // - // Restore the memory shared bit mask on the area we used to hold the - // plaintext. - // - if (MapInfo->ReservedMemBitmap =3D=3D 0) { + if (MapInfo->ReservedMemBitmap =3D=3D 0) { + if (CC_GUEST_IS_SEV (PcdGet64 (PcdConfidentialComputingGuestAttr))) { + // + // Restore the memory encryption mask on the area we used to hold the + // plaintext. + // + Status =3D MemEncryptSevSetPageEncMask ( + 0, + MapInfo->PlainTextAddress, + MapInfo->NumberOfPages + ); + } else if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAtt= r))) { + // + // Restore the memory shared bit mask on the area we used to hold the + // plaintext. + // Status =3D MemEncryptTdxClearPageSharedBit ( 0, MapInfo->PlainTextAddress, MapInfo->NumberOfPages ); + } else { + ASSERT (FALSE); } - } else { - ASSERT (FALSE); } =20 ASSERT_EFI_ERROR (Status); @@ -924,16 +926,14 @@ InstallIoMmuProtocol ( } =20 // - // Currently only Tdx guest support Reserved shared memory for DMA opera= tion. + // For CC guests, use reserved shared memory for DMA operation. // - if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { - mReservedSharedMemSupported =3D TRUE; - Status =3D IoMmuInitReservedSharedMem (); - if (EFI_ERROR (Status)) { - mReservedSharedMemSupported =3D FALSE; - } else { - DEBUG ((DEBUG_INFO, "%a: Feature of reserved memory for DMA is suppo= rted.\n", __FUNCTION__)); - } + mReservedSharedMemSupported =3D TRUE; + Status =3D IoMmuInitReservedSharedMem (); + if (EFI_ERROR (Status)) { + mReservedSharedMemSupported =3D FALSE; + } else { + DEBUG ((DEBUG_INFO, "%a: Feature of reserved memory for DMA is support= ed.\n", __FUNCTION__)); } =20 return EFI_SUCCESS; diff --git a/OvmfPkg/IoMmuDxe/IoMmuBuffer.c b/OvmfPkg/IoMmuDxe/IoMmuBuffer.c index 2675223aa0df..83c7c5958340 100644 --- a/OvmfPkg/IoMmuDxe/IoMmuBuffer.c +++ b/OvmfPkg/IoMmuDxe/IoMmuBuffer.c @@ -9,7 +9,9 @@ #include #include #include +#include #include +#include #include #include "IoMmuInternal.h" =20 @@ -139,6 +141,7 @@ IoMmuInitReservedSharedMem ( UINTN TotalPages; IOMMU_RESERVED_MEM_RANGE *MemRange; EFI_PHYSICAL_ADDRESS PhysicalAddress; + UINT64 SharedAddress; =20 if (!mReservedSharedMemSupported) { return EFI_UNSUPPORTED; @@ -163,12 +166,25 @@ IoMmuInitReservedSharedMem ( MemRange->StartAddressOfMemRange =3D PhysicalAddress; =20 for (Index2 =3D 0; Index2 < MemRange->Slots; Index2++) { - Status =3D MemEncryptTdxSetPageSharedBit ( - 0, - (UINT64)(UINTN)(MemRange->StartAddressOfMemRange + Index2= * SIZE_OF_MEM_RANGE (MemRange) + MemRange->HeaderSize), - EFI_SIZE_TO_PAGES (MemRange->DataSize) - ); - ASSERT (!EFI_ERROR (Status)); + SharedAddress =3D (UINT64)(UINTN)(MemRange->StartAddressOfMemRange += Index2 * SIZE_OF_MEM_RANGE (MemRange) + MemRange->HeaderSize); + + if (CC_GUEST_IS_SEV (PcdGet64 (PcdConfidentialComputingGuestAttr))) { + Status =3D MemEncryptSevClearPageEncMask ( + 0, + SharedAddress, + EFI_SIZE_TO_PAGES (MemRange->DataSize) + ); + ASSERT (!EFI_ERROR (Status)); + } else if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestA= ttr))) { + Status =3D MemEncryptTdxSetPageSharedBit ( + 0, + SharedAddress, + EFI_SIZE_TO_PAGES (MemRange->DataSize) + ); + ASSERT (!EFI_ERROR (Status)); + } else { + ASSERT (FALSE); + } } =20 PhysicalAddress +=3D (MemRange->Slots * SIZE_OF_MEM_RANGE (MemRange)); @@ -190,6 +206,7 @@ IoMmuReleaseReservedSharedMem ( EFI_STATUS Status; UINT32 Index1, Index2; IOMMU_RESERVED_MEM_RANGE *MemRange; + UINT64 SharedAddress; =20 if (!mReservedSharedMemSupported) { return EFI_SUCCESS; @@ -198,12 +215,25 @@ IoMmuReleaseReservedSharedMem ( for (Index1 =3D 0; Index1 < ARRAY_SIZE (mReservedMemRanges); Index1++) { MemRange =3D &mReservedMemRanges[Index1]; for (Index2 =3D 0; Index2 < MemRange->Slots; Index2++) { - Status =3D MemEncryptTdxClearPageSharedBit ( - 0, - (UINT64)(UINTN)(MemRange->StartAddressOfMemRange + Index2= * SIZE_OF_MEM_RANGE (MemRange) + MemRange->HeaderSize), - EFI_SIZE_TO_PAGES (MemRange->DataSize) - ); - ASSERT (!EFI_ERROR (Status)); + SharedAddress =3D (UINT64)(UINTN)(MemRange->StartAddressOfMemRange += Index2 * SIZE_OF_MEM_RANGE (MemRange) + MemRange->HeaderSize); + + if (CC_GUEST_IS_SEV (PcdGet64 (PcdConfidentialComputingGuestAttr))) { + Status =3D MemEncryptSevSetPageEncMask ( + 0, + SharedAddress, + EFI_SIZE_TO_PAGES (MemRange->DataSize) + ); + ASSERT (!EFI_ERROR (Status)); + } else if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestA= ttr))) { + Status =3D MemEncryptTdxClearPageSharedBit ( + 0, + SharedAddress, + EFI_SIZE_TO_PAGES (MemRange->DataSize) + ); + ASSERT (!EFI_ERROR (Status)); + } else { + ASSERT (FALSE); + } } } =20 --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97421): https://edk2.groups.io/g/devel/message/97421 Mute This Topic: https://groups.io/mt/95683532/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- From nobody Sat Apr 27 16:56:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+97422+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97422+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1671081519; cv=none; d=zohomail.com; s=zohoarc; b=keut2RUHojbI/s6EYK87svY+My/WOB7h/OHKvE21VLM3mb9eGPStb5d+X+1ULO8LA1evSMU+R9gj6xXeFTa0Ng0dr89Fc2x90mLdsJGF2aLQLF8B4Oad5DF0Tpj4p76nmdXqL1XSlXCmSntb7SoBRxaNqM5METF28UUd+SaZX30= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671081519; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=wpa/gZs1gXxQfgagn2neLDnucyZ6TdLQ8xZqU0Abtb8=; b=QmngghVQIso1ALA5l0HSz8H1rVrshD8jpEUJwVsZaTs6pcJMoCCAj+AgVsV0SWvbj5L/dtIxngS8SptXYvcjDWBYy9dlcCa6LoznLqJ+40x0veyeWZINt1fbYOveQBymInSBGO4Vizl42ECOYyWaWqdtBphMNQhRSPzjbJ/5Ykk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97422+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 167108151989239.64131519186162; Wed, 14 Dec 2022 21:18:39 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id vsQVYY1788612xy0JDOKmeJf; Wed, 14 Dec 2022 21:18:39 -0800 X-Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.126116.1671081508064919692 for ; Wed, 14 Dec 2022 21:18:38 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="316224155" X-IronPort-AV: E=Sophos;i="5.96,246,1665471600"; d="scan'208";a="316224155" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 21:18:38 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10561"; a="642778105" X-IronPort-AV: E=Sophos;i="5.96,246,1665471600"; d="scan'208";a="642778105" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.170.19]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2022 21:18:35 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Michael D Kinney , Liming Gao , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky , Jiewen Yao Subject: [edk2-devel] [PATCH V3 4/4] Maintainers: Update OvmfPkg/IoMmuDxe Date: Thu, 15 Dec 2022 13:18:10 +0800 Message-Id: <20221215051810.2027-5-min.m.xu@intel.com> In-Reply-To: <20221215051810.2027-1-min.m.xu@intel.com> References: <20221215051810.2027-1-min.m.xu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,min.m.xu@intel.com X-Gm-Message-State: iXWndt2DQsF51FWz6ZshgBXtx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1671081519; bh=+Cpsecmla9Xi880Qej1P0yKu3Xf0uFcJ+EY4DMoOB38=; h=Cc:Date:From:Reply-To:Subject:To; b=GA2zQFunAdut4OO53T822+Xd5NkvFtoftZYfK3TdffE5/GdbGNyrDYsUraEOKJbPRgD 8cHWxV49ylue4WoPXb98K0HWod0ezZ7QCj7/PVqk7yuV8m8HWNfae6jIqdWMm4cGoNaQF 6Ephk/bk6Oixsijdx/53trIEQk3WCMv+EOE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1671081520142100018 Content-Type: text/plain; charset="utf-8" From: Min M Xu https://bugzilla.tianocore.org/show_bug.cgi?id=3D4171 AmdSevIoMmu.* is renamed as CcIoMmu*. The related section in Maintainers.txt should be updated as well. Cc: Michael D Kinney Cc: Liming Gao Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Reviewed-by: Jiewen Yao Signed-off-by: Min Xu Reviewed-by: Tom Lendacky --- Maintainers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maintainers.txt b/Maintainers.txt index 7e98083685bc..9293a3bb91be 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -478,7 +478,7 @@ F: OvmfPkg/AmdSev/ F: OvmfPkg/AmdSevDxe/ F: OvmfPkg/Include/Guid/ConfidentialComputingSecret.h F: OvmfPkg/Include/Library/MemEncryptSevLib.h -F: OvmfPkg/IoMmuDxe/AmdSevIoMmu.* +F: OvmfPkg/IoMmuDxe/CcIoMmu.* F: OvmfPkg/Library/BaseMemEncryptSevLib/ F: OvmfPkg/Library/PlatformBootManagerLibGrub/ F: OvmfPkg/Library/CcExitLib/ --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97422): https://edk2.groups.io/g/devel/message/97422 Mute This Topic: https://groups.io/mt/95683535/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-