From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (NAM11-DM6-obe.outbound.protection.outlook.com [40.107.223.73]) by mx.groups.io with SMTP id smtpd.web08.6094.1620863212737952951 for ; Wed, 12 May 2021 16:46:52 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=FAXGs4xA; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: 40.107.223.73, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nAJTwAxj5eAqFoHGeW+Ityf9FTwqdWd8xRmv0t6GXjULREjzk2Fti6jynMxNBIiKkBJUo7iIAwCDF5z5HQrGnnxxeIatwmw36BvLOMTee49gsrlNjS/pc6fVexz6YZDtOYsaRZ2FaSD50dJbu9q/fM8Ku7n9nHHbsVqp8qWNO/CHzDW6pEXLCh9r3Tm+qcg20k2tnTsVTlvU4xBDNzb4Y4/gefk2V/z2bRN0bTYYaez0GVgA4fOcfpf0Al/mmV/4QSS3+Ji46LVe1jBG6qrNNpe/YABkd9jFSwPQUdU7hRFalXyRk2jbBdCyzEI26bHHt/rqS6Ced7ciAon2nn9Tbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g6z800AL5Ddb/AbQzRPgsUmL+3pQQg9GQIseQAj5YDk=; b=Q3Hb7u9G31ynu/0qolD8dKphMVZUuB2i/ZnvKcXw/yhRwfvqfL7IVqFD8V5EbyzO7HFtalJQo3lVUiCrTnMJiSQq3/DgNdB2kzsFJ/Slu127rcIrAujQD/Fw5eS5tqe07JK4d9tx2X4yV8THnom2JmlSiJymmjeBkdNUetNbd1C2oNJRqpaDVAPmeqhg9E5Im1OlMzhVMa5EoMYbb7HuRrr2Gk9EFpkP+g82QwzXkGvE0lMRGQmyEaZiGF83DtO6V+sCAXZwZrZgCBsF8vrgUO1cuvToNdY2BgXVeYeNjQSM965XQ/pz116SRCaIn1OYzORC2KpV92Q+1en6O2Tu/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g6z800AL5Ddb/AbQzRPgsUmL+3pQQg9GQIseQAj5YDk=; b=FAXGs4xAEzJF6JkniTbLCmIrlSGoCIfoA3z1NvGUUiS7FoX10Osn/F+pRSbvGKpSNMNOs4ce8veQ6vga4WEVMZXtzxZdhP5TvvlRSZJDtnNyKaeajOvPrbfbRed5ujvvg5pX8x+oAy05LRPv+05CaoWyqzgIAcWFATtKsD4pZes= Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=amd.com; Received: from SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) by SN1PR12MB2445.namprd12.prod.outlook.com (2603:10b6:802:31::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4108.26; Wed, 12 May 2021 23:46:49 +0000 Received: from SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::9898:5b48:a062:db94]) by SN6PR12MB2718.namprd12.prod.outlook.com ([fe80::9898:5b48:a062:db94%6]) with mapi id 15.20.4129.025; Wed, 12 May 2021 23:46:49 +0000 From: "Brijesh Singh" To: devel@edk2.groups.io CC: Brijesh Singh , James Bottomley , Min Xu , Jiewen Yao , Tom Lendacky , Jordan Justen , Ard Biesheuvel , Laszlo Ersek , Erdem Aktas Subject: [PATCH v2 13/13] OvmfPkg/BaseMemEncryptSevLib: remove Flush parameter Date: Wed, 12 May 2021 18:46:15 -0500 Message-ID: <20210512234615.1726-14-brijesh.singh@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210512234615.1726-1-brijesh.singh@amd.com> References: <20210512234615.1726-1-brijesh.singh@amd.com> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SA0PR13CA0003.namprd13.prod.outlook.com (2603:10b6:806:130::8) To SN6PR12MB2718.namprd12.prod.outlook.com (2603:10b6:805:6f::22) Return-Path: brijesh.singh@amd.com MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from sbrijesh-desktop.amd.com (165.204.77.1) by SA0PR13CA0003.namprd13.prod.outlook.com (2603:10b6:806:130::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4150.11 via Frontend Transport; Wed, 12 May 2021 23:46:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73b6d3de-1381-47ae-0439-08d915a034f4 X-MS-TrafficTypeDiagnostic: SN1PR12MB2445: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: nfnwO+vgu9OIvxZU4euPGA9lT6qOgZJ+IQwXVMuJkCSr6Qsljwt+3jnIbFcARXdyXZBb8OhK4ZI/P0dE/+UEsQjSD3TXpFJVZwdMbGLwV0X0Qrb0epynoSftQOpG6s+FgL8CLultpvtJ6TXDxvbe68jrMuN/yJBDpxT6OvlG1Q7KNwuBO2qURCRwQcTrPN7DltVhCPbhTiyeyc3kyPrCWCDR8+ukMIIDtag48cV0Q+r/NYbFawX7DzYB1yw1fnguP/49YVSQUCa92hWnjDlZDaketFtEzBO4KGN3Fi5emALkP+IGYLX4v07OY7Cd0PJ3fb/g3bXN5Caun3C4fr4EncH0McGfwkxyKsRx5jvw6bX69ekLIvBuWM7HAltbWALkqDHgNpHLZt3aFtZRDAXCiDR3j+XuIOEcitAPoeGjCWNDJ9xQoPU32K3Rw/90RXc4NgQaiG//zXDMcfW4lh/cLyNAHe5oPeXqxK6Ftq+uEiyhOfbmFdUH7okwLtTxbPC69g70fdoHYyTLJVNvpc/J3yD4We81xzuig2Wbkun16FF0+iZi9VJM7cn4qTafUsMn+CNjuqCoJs9MjriLDv5wTa8RRvU0fGwG0CY1Gg3FQwHb54l7yDE11wXzToZefm8Gd8+rMpygQLpFCa3u8uRtbODjt13giYI45CZZ9t/k34rjbdMwjERigGYS4NbTKfJpKqznufLVyPLg5glGhfdAEBfxMAo/1bWe5E5BpBAWDfYGsgGQhoCnpUE/ZM3as8yrWkBv+ICZCCPtIsVEa1n1Tw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN6PR12MB2718.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(136003)(39850400004)(396003)(346002)(366004)(6486002)(54906003)(8936002)(2616005)(7696005)(478600001)(2906002)(966005)(8676002)(30864003)(19627235002)(956004)(5660300002)(1076003)(44832011)(83380400001)(52116002)(186003)(66476007)(6666004)(66946007)(36756003)(26005)(16526019)(86362001)(38350700002)(38100700002)(66556008)(316002)(6916009)(4326008)(213903007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?P7d6TlqIy+UblwVlJ62KUgEwCZPSkLZsyYKUwds7lzEYbdHlW20pHk9wl2W9?= =?us-ascii?Q?xcAKXS/BjWgG1Z8zM31xSheo/NpeX/MsV8GakdB/nVnTbP4BKWV3aJ5hsuQn?= =?us-ascii?Q?KtacbTjxLFwnxKEi8akD5PKMzjZ2zXKpO+6s3x3CFbpRjt0d6c85mmxv5JdH?= =?us-ascii?Q?CRyCYVJaWUNVPeLyONjZmd8waMhC/RPVA9+gtVodUGNnmmrpUUccZHLOiGXs?= =?us-ascii?Q?iDDLdJwebbsiI6NQ7uDkN6P8ktCUDVTzYYBt7nUNuZY3FKpKh5b4+cwcPqia?= =?us-ascii?Q?zdIPxFjldJY53lh0tCL+5ltp/P26c89vh2HP3aC3gb3muh40C6cHF2Y8oQWb?= =?us-ascii?Q?t0S6gz5BDJ2ZmZzGqFE9B8/LaeZTzqNxVUoa8a37zXBnxeDnAoilHFghfy8I?= =?us-ascii?Q?jesd6POMJLwRmQ743BoJb8r3C/F8piuUbKFstXwN5ewogiAhMJNAQTjqGdzM?= =?us-ascii?Q?7a12MBx7Trmwcx/BBmmeh9E5nOefF3804sB0Yn2KXnmKAxfzlqa9HdnoOfxF?= =?us-ascii?Q?MJ3G/M8ou0L3i2Y/nR1CohjpvXHgA7WJAi3T5wXDBh1Fk1fOw/ztOwxWNHmQ?= =?us-ascii?Q?Y4YFMRwApwsnnoSratxqwmSu8PCxCSD2xSQoVW8ySV8ZPFiWsb2zpLiCYO0P?= =?us-ascii?Q?GhrhQ7iCfw5Shg+Z8yoDSO75f14g3LkTwDop+TT/1DExaA5owmqfP7809Ffr?= =?us-ascii?Q?LEuw2GTvxlRgqXL/L3ZkCRuH3GNUcRSKeXNCc+wmfr7QFs1pb0+Moz5PT1KQ?= =?us-ascii?Q?KztGg2JEjI1u/nXAdK1Ose9gzuxsxSgFiXFeSSOUMlck0woczkI45fcoFRVL?= =?us-ascii?Q?7QwrM4UpeDbmBHnDyAJRPAHk4/qklpIv1wXLCIpyTEtLru8Xsx2SLtClWyC/?= =?us-ascii?Q?v2m2RNI7DafS0DNO7kR3uaDmTgD68h9yrfneacJdNSJrcKzE4aS+Aha9ftjh?= =?us-ascii?Q?0w7mvD7HiOO0e3PsDeTKY9dx1XLBhN1huQLAqbtT2Cjm8xLrxpmzVkEhHE1N?= =?us-ascii?Q?EG1dLYlK3xrURjeN38alZ6TKFzEVYPMd2bFQRwqNrCvfVlUUaJfwPChJWPkP?= =?us-ascii?Q?6lIJuKj7b8ABnQgHL/3SimlFI2Y45VwiuyikIv+O0mpkzQGpimfKlllWR5eF?= =?us-ascii?Q?E9nSVNGJ4s4FmjDmLXKUgVU/3FWkHm9x2TXsqi4fjvCtmEcCTDRzhxCY0QTJ?= =?us-ascii?Q?Fh+A52L1uPH2vf8TDRd0nwocAHmuoj8ijWdWPbLm+rHaZnn8H3m3+hMrsrad?= =?us-ascii?Q?q3It4KiIRgEXXBdJz7HHx88A76xeY5ET2wWbRw2SNpHgNVoxDtAwv6Bpq6Zu?= =?us-ascii?Q?Kwu6drn7NTTXZLarwT4py4gh?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 73b6d3de-1381-47ae-0439-08d915a034f4 X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 May 2021 23:46:47.9262 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 05hmuQ13fSWvYWz3al1MZ9pLSPdQn8ro9W8QwRiKBA7aYlpIloJIQyaSE1+8ckekfwkbaF3zREdo0dZcwSAcRA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2445 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3275 The Flush parameter is used to provide a hint whether the specified range is Mmio address. Now that we have a dedicated helper to clear the memory encryption mask for the Mmio address range, its safe to remove the Flush parameter from MemEncryptSev{Set,Clear}PageEncMask(). Since the address specified in the MemEncryptSev{Set,Clear}PageEncMask() points to a system RAM, thus a cache flush is required during the encryption mask update. Cc: James Bottomley Cc: Min Xu Cc: Jiewen Yao Cc: Tom Lendacky Cc: Jordan Justen Cc: Ard Biesheuvel Cc: Laszlo Ersek Cc: Erdem Aktas Signed-off-by: Brijesh Singh --- OvmfPkg/Include/Library/MemEncryptSevLib.h | 10 ++-------- .../BaseMemEncryptSevLib/X64/VirtualMemory.h | 10 ++-------- OvmfPkg/AmdSevDxe/AmdSevDxe.c | 3 +-- OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 6 ++---- .../BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c | 10 ++-------- .../BaseMemEncryptSevLib/X64/MemEncryptSevLib.c | 16 ++++------------ .../X64/PeiDxeVirtualMemory.c | 14 ++++---------- .../BaseMemEncryptSevLib/X64/SecVirtualMemory.c | 8 ++------ .../SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 3 +-- OvmfPkg/PlatformPei/AmdSev.c | 3 +-- 10 files changed, 21 insertions(+), 62 deletions(-) diff --git a/OvmfPkg/Include/Library/MemEncryptSevLib.h b/OvmfPkg/Include/L= ibrary/MemEncryptSevLib.h index b91490d5d44d..76d06c206c8b 100644 --- a/OvmfPkg/Include/Library/MemEncryptSevLib.h +++ b/OvmfPkg/Include/Library/MemEncryptSevLib.h @@ -100,8 +100,6 @@ MemEncryptSevIsEnabled ( address of a memory region. @param[in] NumPages The number of pages from start memor= y region. - @param[in] Flush Flush the caches before clearing the= bit - (mostly TRUE except MMIO addresses) =20 @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -114,8 +112,7 @@ EFIAPI MemEncryptSevClearPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ); =20 /** @@ -128,8 +125,6 @@ MemEncryptSevClearPageEncMask ( address of a memory region. @param[in] NumPages The number of pages from start memor= y region. - @param[in] Flush Flush the caches before setting the = bit - (mostly TRUE except MMIO addresses) =20 @retval RETURN_SUCCESS The attributes were set for the memo= ry region. @@ -142,8 +137,7 @@ EFIAPI MemEncryptSevSetPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ); =20 =20 diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h b/Ovm= fPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h index 8dc39e647b90..21bbbd1c4f9c 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h @@ -58,8 +58,6 @@ InternalGetMemEncryptionAddressMask ( @param[in] PhysicalAddress The physical address that is the sta= rt address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask =20 @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -72,8 +70,7 @@ EFIAPI InternalMemEncryptSevSetMemoryDecrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ); =20 /** @@ -85,8 +82,6 @@ InternalMemEncryptSevSetMemoryDecrypted ( @param[in] PhysicalAddress The physical address that is the sta= rt address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask =20 @retval RETURN_SUCCESS The attributes were set for the memo= ry region. @@ -99,8 +94,7 @@ EFIAPI InternalMemEncryptSevSetMemoryEncrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ); =20 /** diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c index 80831b81facf..c66c4e9b9272 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -120,8 +120,7 @@ AmdSevDxeEntryPoint ( Status =3D MemEncryptSevClearPageEncMask ( 0, // Cr3BaseAddress -- use current CR3 MapPagesBase, // BaseAddress - MapPagesCount, // NumPages - TRUE // Flush + MapPagesCount // NumPages ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: MemEncryptSevClearPageEncMask(): %r\n", diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.= c index 49ffa2448811..b30628078f73 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c @@ -252,8 +252,7 @@ IoMmuMap ( Status =3D MemEncryptSevClearPageEncMask ( 0, MapInfo->PlainTextAddress, - MapInfo->NumberOfPages, - TRUE + MapInfo->NumberOfPages ); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { @@ -407,8 +406,7 @@ IoMmuUnmapWorker ( Status =3D MemEncryptSevSetPageEncMask ( 0, MapInfo->PlainTextAddress, - MapInfo->NumberOfPages, - TRUE + MapInfo->NumberOfPages ); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c b= /OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c index 169d3118e44f..be260e0d1014 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c @@ -25,8 +25,6 @@ address of a memory region. @param[in] NumPages The number of pages from start memor= y region. - @param[in] Flush Flush the caches before clearing the= bit - (mostly TRUE except MMIO addresses) =20 @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -39,8 +37,7 @@ EFIAPI MemEncryptSevClearPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ) { // @@ -59,8 +56,6 @@ MemEncryptSevClearPageEncMask ( address of a memory region. @param[in] NumPages The number of pages from start memor= y region. - @param[in] Flush Flush the caches before setting the = bit - (mostly TRUE except MMIO addresses) =20 @retval RETURN_SUCCESS The attributes were set for the memo= ry region. @@ -73,8 +68,7 @@ EFIAPI MemEncryptSevSetPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ) { // diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c b/= OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c index a2bf698bcde7..a57e8fd37fa7 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c @@ -27,8 +27,6 @@ address of a memory region. @param[in] NumPages The number of pages from start memor= y region. - @param[in] Flush Flush the caches before clearing the= bit - (mostly TRUE except MMIO addresses) =20 @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -41,15 +39,13 @@ EFIAPI MemEncryptSevClearPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ) { return InternalMemEncryptSevSetMemoryDecrypted ( Cr3BaseAddress, BaseAddress, - EFI_PAGES_TO_SIZE (NumPages), - Flush + EFI_PAGES_TO_SIZE (NumPages) ); } =20 @@ -63,8 +59,6 @@ MemEncryptSevClearPageEncMask ( address of a memory region. @param[in] NumPages The number of pages from start memor= y region. - @param[in] Flush Flush the caches before setting the = bit - (mostly TRUE except MMIO addresses) =20 @retval RETURN_SUCCESS The attributes were set for the memo= ry region. @@ -77,15 +71,13 @@ EFIAPI MemEncryptSevSetPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ) { return InternalMemEncryptSevSetMemoryEncrypted ( Cr3BaseAddress, BaseAddress, - EFI_PAGES_TO_SIZE (NumPages), - Flush + EFI_PAGES_TO_SIZE (NumPages) ); } =20 diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c= b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c index a18d336a8789..c696745f9d26 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c @@ -828,8 +828,6 @@ SetMemoryEncDec ( @param[in] PhysicalAddress The physical address that is the sta= rt address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask =20 @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -842,8 +840,7 @@ EFIAPI InternalMemEncryptSevSetMemoryDecrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { =20 @@ -852,7 +849,7 @@ InternalMemEncryptSevSetMemoryDecrypted ( PhysicalAddress, Length, ClearCBit, - Flush + TRUE ); } =20 @@ -865,8 +862,6 @@ InternalMemEncryptSevSetMemoryDecrypted ( @param[in] PhysicalAddress The physical address that is the sta= rt address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask =20 @retval RETURN_SUCCESS The attributes were set for the memo= ry region. @@ -879,8 +874,7 @@ EFIAPI InternalMemEncryptSevSetMemoryEncrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { return SetMemoryEncDec ( @@ -888,7 +882,7 @@ InternalMemEncryptSevSetMemoryEncrypted ( PhysicalAddress, Length, SetCBit, - Flush + TRUE ); } =20 diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c b/= OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c index e0d3a15e8503..a155c8729bfb 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c @@ -42,8 +42,6 @@ InternalGetMemEncryptionAddressMask ( @param[in] PhysicalAddress The physical address that is the sta= rt address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask =20 @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -56,8 +54,7 @@ EFIAPI InternalMemEncryptSevSetMemoryDecrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { // @@ -89,8 +86,7 @@ EFIAPI InternalMemEncryptSevSetMemoryEncrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { // diff --git a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c b/OvmfPk= g/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index fdf2380974fa..c7cc5b0389c8 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -283,8 +283,7 @@ SmmCpuFeaturesSmmRelocationComplete ( Status =3D MemEncryptSevSetPageEncMask ( 0, // Cr3BaseAddress -- use current CR3 MapPagesBase, // BaseAddress - MapPagesCount, // NumPages - TRUE // Flush + MapPagesCount // NumPages ); if (EFI_ERROR (Status)) { DEBUG ((DEBUG_ERROR, "%a: MemEncryptSevSetPageEncMask(): %r\n", diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index dddffdebda4b..a8bf610022ba 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -72,8 +72,7 @@ AmdSevEsInitialize ( DecryptStatus =3D MemEncryptSevClearPageEncMask ( 0, GhcbBasePa + EFI_PAGES_TO_SIZE (PageCount), - 1, - TRUE + 1 ); ASSERT_RETURN_ERROR (DecryptStatus); } --=20 2.17.1