From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (NAM02-DM3-obe.outbound.protection.outlook.com [40.107.95.55]) by mx.groups.io with SMTP id smtpd.web10.15908.1621448417833008753 for ; Wed, 19 May 2021 11:20:18 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@amd.com header.s=selector1 header.b=eJdKssGW; 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.95.55, mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fs6RL/IDqptecxcynseNxkv8dLIJ2UjBzhCG4w2Q/QhqlTF4ezfBU4v1F5w7wbNfiPWKw0kESRc0olvSixPu+YiJtxDqe8k8dLVfDJSHmZS/2DuvfsQPy7hZFAdwxaa61xpW6YYYLWzDhCkTbgW2zrVs3gBM3bAhpzH5ZugSXqSG/mFD8C5jOSuYWkL+VJU3OwmtraNcF5m/3DazTrhB41iVtwSD9hw46svDHRS9KCNOwOv+/eqQjlMHHdnV0oxEpGns35VzCJCEElJybyS0/pf+idOTmdCXPaG420LJ/iUzEo2d1YlqkIzx90Z8J7QzRez9z3G8oPixkfIrn3R9qw== 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=ddPS7/iKvqwwOkQm6Injn2NhneCI+vMTAtaH6sO607I=; b=Os/A+aQRARK4XibfLdRElvDmEe11sdm0XlVIYKvHP8HsEU7PQOXUYZ9M7ykFLBL8wiGvIz4xHItCJm25WyRLV0dKf8t0FialjAvwwVrdq1jwGdipPqWJS0kCTCPlC8hb5eyVSpNHb671NIO9QFuQfV3yRDGr1SJwMVsVY2u2WddFAGegEusrfKtJ9TkwzTe+Q4NcYZX0IIV2elgEnrWSGGxvm2rE7d2v3Ser9YiRRY1hUfLaZmStVvROO+Ptoy2j073bP/h6x96z9Sv99lu/ewmAv1+RQNtT8a9WT+PG732Rb8z6hv0wJ1ytjN+bkJKTJ5q+9k+9ozmxa7xUKnVqfw== 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=ddPS7/iKvqwwOkQm6Injn2NhneCI+vMTAtaH6sO607I=; b=eJdKssGWpMj/tKtHehFtVYeq7c2LvvYfJKJDqQoVDSACsIUjK+H1MsVlD7MYLmWEh2XhlBazGitpIobEkf1BejuXq4gV3HjsNBioZo9AMTj3HSVnKorC6BMjPXOtYSndasEBRoS03gRpEfkbZ/oLtG2ewxB6x1jb3GBlDa6gJEQ= 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 SN1PR12MB2365.namprd12.prod.outlook.com (2603:10b6:802:2e::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25; Wed, 19 May 2021 18:20:14 +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.032; Wed, 19 May 2021 18:20:14 +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 v3 13/13] OvmfPkg/BaseMemEncryptSevLib: remove Flush parameter Date: Wed, 19 May 2021 13:19:49 -0500 Message-ID: <20210519181949.6574-14-brijesh.singh@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210519181949.6574-1-brijesh.singh@amd.com> References: <20210519181949.6574-1-brijesh.singh@amd.com> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SN7PR04CA0212.namprd04.prod.outlook.com (2603:10b6:806:127::7) 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 SN7PR04CA0212.namprd04.prod.outlook.com (2603:10b6:806:127::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4129.25 via Frontend Transport; Wed, 19 May 2021 18:20:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: be52bb13-ce5a-4ef1-023c-08d91af2bf71 X-MS-TrafficTypeDiagnostic: SN1PR12MB2365: 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: EIaEi0xcy5pGjtda89kPKgln97YWLAZS9SkX+ZwaOSJ8aYw3ozEH+2uioP21omi3BwNnaGNubgFQbNJ0npCTYmdqaPwXvHHkN0jmm4uI1NL25Ty9ecfhmLtdKzpbBZn3YCI2KzyRlRSiMFxt0WPUEKPRPoGfC2NVFGnGJE7pTKSVbFywvWXbg7tMqrbvvT2s6/pq+wPd7pC+RrhHqTKek23+t7s6N5zcVCKer/R+ss9DlG4DOGCF1JP1r0pWy6wQPuWFoyJQomGz/ByP227CXA0W4/CyD6UUlh+oRd5tY8gWpdFfpENDsWMWpf2xbBx4MUe3XPLM3QDcNihIS5N6UU1YZY0oMVHcfnJeeS53p5jmuHd732FffniFkaimCbLOXZkwVez2Vg/+UpPxjOzcIkdiVk7xIrZISAZXgQfjJQta34mErQGD4ahGLzrYmNYBtPQOJjJwG2ovcMF1d/ck9TPoduePk5b/IJ/SswFxUp0UyBsXet4va4Kvg+PphgrY14g8Bg3lYMJg6f2N7I8ujdXAZMSacB9A5wVuPHtW45FUHbXoaTU7mvcJU7Qp8IVg40lYr4JEdfC4uXzdN40nt6zxsnm3TXNqozhW6PrUtXhwMafYPoEtMYhtDasT0oXrsDNfnksB0QCpAZ8KWbJ6SXvy7AprHouafiGojyhOscVS8gWC4cCStm/7UODJw6Efkqsdt/Gvo9E/SmjParoi0TyK+pvgT8+mr7a+MF4aich/TmTPN3LmGovaX7oyDdJ6Xo+yp2uKMShQOiWFrVjGCw== 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)(136003)(346002)(396003)(366004)(376002)(39840400004)(16526019)(4326008)(6916009)(956004)(2616005)(478600001)(1076003)(2906002)(5660300002)(6486002)(19627235002)(966005)(54906003)(66946007)(66476007)(316002)(8676002)(66556008)(8936002)(83380400001)(30864003)(36756003)(38100700002)(38350700002)(86362001)(26005)(7696005)(52116002)(186003)(44832011)(6666004)(213903007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?38r3p4tf0/rb1yVG47T6dWBmP1NpS3roDJ6aL+GxhZoMt17kXKwPs+ksgLtO?= =?us-ascii?Q?i6bKXbyB8TmLL4pOZ8zegkPoyz3tNLJUNLSmpIpmWBQ7jslWVDAyImiiS82f?= =?us-ascii?Q?58E0/vXC5biDPcAHfE+pE41dDmVS9QeTUApueV50fLfPIliwFAsDM1nCrKE6?= =?us-ascii?Q?TgnE2Tezrsdp+pK5FtBkuIbAXFEC/zgKTNMMG+6tz0TUq0cSbduwq4q7qMzI?= =?us-ascii?Q?NxfzSsN4hzDYsupCotpoYMWaCtdCw8fTeGBWhB3hwiVrQgYLnITXdlBnpvZC?= =?us-ascii?Q?3CEq1iZR31960CwSiygHXrM8fFrZbCQ7Hv58MrybLy9unpZX8h+6eC4vuSR/?= =?us-ascii?Q?hnFtElzHtjZlCFYlgFqdBgUNW5wm7GhcKMywez3CkRUWiS4CwgdhtZkcH2hK?= =?us-ascii?Q?Et3lj8pOSajPCUolh+22RbMZ0DK37Ajb4SSb2lh9+qPtj8FP0No9Ndd78j9b?= =?us-ascii?Q?xaH235KY0fi6CO8T4AzvRpw4MTrXDgvEYyYbw0CV6xfhGCMtBYKVa1Qeq+qc?= =?us-ascii?Q?h2kCiaoj14XZ1JyXHCBEVdm0qBVVvMH81rlOt2boR6cV47Sv51a0uC19nPE0?= =?us-ascii?Q?MCqA/rJucuydQuS9MafCL/aZEbw7bzoMmpdnMsANUe9WdQazpsUFMlBxlji6?= =?us-ascii?Q?kZMozO5k/Id7SZWxZCjiLgIk8NtC+G2siU0LAgNOhwA0fEPIsJp+A05mD6VG?= =?us-ascii?Q?eX1x7rS6I6IRsBSuwRxdwUN5W0IqYkutWUDhms0UL/tddsecQXhqTyGnCJeo?= =?us-ascii?Q?RZarl3xs9CQFCi7xxTIvmZRyE3X/Q/1RphbkT0Zc642xrHekNy/KKev2Q2Mk?= =?us-ascii?Q?33iyDbEmDW4QrvpJMaSNhI4ApM3qsnY8wMCd35MF03V3KZRQACd9H8gdDbUR?= =?us-ascii?Q?fGHSBGVlh9J8RUUfbzlqouMCBFqXtYAs+A0JWGNpJhcmiYjnOVlBVoGq7+Fd?= =?us-ascii?Q?OtJC0mTr1J2gMDB1pBAu4tqBOyANfEvyDIuAqbhwlTV5FOoDPNBT8aE87jrZ?= =?us-ascii?Q?Rgs7taKvrKc0JA6niSPnLXrABIe5GRRQkHg4caWQ5aONgHwZAA+tAwMUDbOX?= =?us-ascii?Q?HkQmoyEmKkvRUmgTiM8Dg6k2CKcjNxZai72Cv8Y8hdguJ/zS3YL+2eCq2P2E?= =?us-ascii?Q?XdblkuE8VCy5klp1KxkeFFrvCJB1gbtFGTrSMwjHLOHVeBuZsdZJSRk8HjJK?= =?us-ascii?Q?O17MKA3g16mkLVKVnLwRfWhkiYLMIT79TuHeF+Ft0jeFe20Ic54FKc6DpCDy?= =?us-ascii?Q?3Lbe8qunZxhpBkvhyT091Pp8BCkwmFnWy3Znu5SdfMNYqku6TuxKqthtB/pr?= =?us-ascii?Q?Y+N8aMRQhDkJQ6x2Xt1kHNAo?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: be52bb13-ce5a-4ef1-023c-08d91af2bf71 X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2021 18:20:14.7417 (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: I8E8TiL6XBHF06CHYjkjOIcuXW3Mz7jG4JeILkAeOGqS/mlciCcvI9W1NJDCIWVsYjv7UHs6nuzI2NPSXTPj+w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR12MB2365 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 Reviewed-by: Laszlo Ersek 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