From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com []) by mx.groups.io with SMTP id smtpd.web09.10434.1619783538721945423 for ; Fri, 30 Apr 2021 04:52:22 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@amd.com header.s=selector1 header.b=gG6uwxyK; spf=permerror, err=parse error for token &{10 18 %{i}._ip.%{h}._ehlo.%{d}._spf.vali.email}: invalid domain name (domain: amd.com, ip: , mailfrom: brijesh.singh@amd.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bq077Z0NLTlmGr4p+bhkyu5b9T5M8JQIjlZ7yvilUF25tu0vgSTqsUP+cNF2Eiu0N2SKMaIms1bsg0QmbDDnAFD8pU2DqhsQIlnCJWdvQ2ckzIXuygxvWMhp0/q+jRlA9sHmiG0o46rHXwESIOHMltlKWkO2juRqVi2iGyrJe0B+B+kOEna+USQzItLUBZYMce2g0P+sTd216rRIebX3KcA/4IpiiO+ZUcWYQ/QCKJyZAusJYYjK6Dk31cVwIjgPEOUBrKgY9CC3jsq784VyYVE40Wv7WDg4/mIeBzueQGCDSdsZaGw4lS7Z/VfzjdlFu31iZ4pi6oRiBdjTJMElYg== 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=YFMowrhnR2HwSvz/CptjmjzY0cJJl7kh/1O4tNKcwNk=; b=c/qxQkXNjQwTDdF86BEtW2uBp9EVpKKiZ2oAhz0zzfXsIJdyZfiChvX8b7/AaI+Qyfkpccpm21pJUd+W1SM9/OdLg5oTKj/iMML1cHprRY1bktmFuzJv5dUTjRswMzTiwrZftce2BUHes+xSi3bsOrWvbJvpFPfa2iI0jVJBxlqPOwHNKr1Pe8lTZ7QGCBnxC+/CHuEccbHCoSVtNt6ZWD3Pk2EtEesxfnn4cwXvCKtP6uWwRtZqZ8AnAw0RXm70nCgd2/FzlXAxbRKA+kuhZtmEiJUfMje4x7DZs4c13tQsEDRS1rUn6/pY64yve/sIzscxZ3tBrngeXVGq44v0MQ== 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=YFMowrhnR2HwSvz/CptjmjzY0cJJl7kh/1O4tNKcwNk=; b=gG6uwxyKb0ryhKoA3a27vRCnF2kV+0aU0vLpkBsq2mJPjHpuHW1k2F6Gfe+PW6lhM75XRHRLIogHjVQoFHGBXx4Znk1xJd7ZKtA2p1UmLiwPK7ky0mVDibQiv5NhHOYRKGNTS6h13+a4eKUDFeldt2jDk6ABJ8E1/jxPEZsoLGs= 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 SA0PR12MB4349.namprd12.prod.outlook.com (2603:10b6:806:98::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4065.23; Fri, 30 Apr 2021 11:52:20 +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.4065.027; Fri, 30 Apr 2021 11:52:20 +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 RFC v2 08/28] OvmfPkg/BaseMemEncryptSevLib: Remove CacheFlush parameter Date: Fri, 30 Apr 2021 06:51:28 -0500 Message-Id: <20210430115148.22267-9-brijesh.singh@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210430115148.22267-1-brijesh.singh@amd.com> References: <20210430115148.22267-1-brijesh.singh@amd.com> X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: SA0PR12CA0006.namprd12.prod.outlook.com (2603:10b6:806:6f::11) 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 SA0PR12CA0006.namprd12.prod.outlook.com (2603:10b6:806:6f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4087.27 via Frontend Transport; Fri, 30 Apr 2021 11:52:20 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a48aec71-cc77-4c99-9619-08d90bce693f X-MS-TrafficTypeDiagnostic: SA0PR12MB4349: 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: hIHA4tgU7llxZ7ET58MBUeg2VE2xm9SGBPWVf4O5W8Gddfylx3Lnrgn+RIrD20UCVoBdhwnKR76R6kP6+sR41MUKAAFKyWAaAOgHQCrWZhlPQETJOYrY9Gj/5v5z5eW0VCgmWtvfiht9bXvGSG4hygFBWF000X/+LAzJDSgltFyHxcvajTK3PVuAtBJ7WEmfiWK7Z4UAN6rxfWLT33/18C1V8lEtrWEMcwGJXT29KM7lr+pY58APqsmfiPf0EeO9wq7PsIdO1MHkSZ7LFXNQ7GXwTWsWzmfpfl9K1TO+x4g2eVnGxXjsM0VAePCI8jMQJ36C75kSlGvDCb60bRlgqFXaLCYs0TMxlJ3sR/BuZlcaYSOOKFQwTZA3ocjt/L8Mf0+Sa8c8Ib4r7vfRk7OovsDO4WrAgOQ1wXjwdQCSlhUYFli/HSsOfeCe16sWYHR6iOdOhhTyzdw2/OFKJnJiRgXyOU6evQmkhxWpElTfJcEhR3iXnXq65oEu+8EaBYXMIFjFw/fpekPfKDj3oJYxWpdllpTpHAbfsDJ/6y+ktrF6C+XfgkKdrd5NmWDuwatQKYKV+A2IqYDUJHX8IDrbbiqwxlZEzdpD2ZzmWuj/Rf3Py/DuAK36CqqbRBGQL0RMHukOQZAEaBd9bL09Zzt3WMz8SEA8YVgO6jQpjYE+GQRKH8k3SwDkLd1TkbrjHUAT59pik3f27hYujoE6BZhYylS80sF1EwpbSjSvUge/96LJODyIAqNXb+mtRRtfR+QWFAHIGQY7vnjZ9Q4phbvq3Q== 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)(39860400002)(366004)(396003)(346002)(136003)(376002)(966005)(38100700002)(2616005)(26005)(1076003)(86362001)(316002)(30864003)(6916009)(8936002)(2906002)(4326008)(52116002)(66946007)(5660300002)(186003)(54906003)(44832011)(36756003)(66556008)(8676002)(66476007)(16526019)(83380400001)(478600001)(956004)(7696005)(38350700002)(6486002)(213903007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?5+JZBDDDHNjEJfM7Pw+XTgn/SbcT7JEYeHPAZvX9gNKTcvr/oxmh4zoGTwxY?= =?us-ascii?Q?QHd5XqS11aIMNWuq2VsSN8gCyC0GRQo7FvghcEy8YT9FiCDA2t8iozfPROuz?= =?us-ascii?Q?htWkgO72VgBRS3bYx95Jw63LRn8dCiFd7M8ylLbUNjOui67fRWq1losqmdNP?= =?us-ascii?Q?Y11bR/ygIJZbhfbBAKEqUwIz8zjFge8cUtu7EXwEDpQ2Dh4slbXkPAOBKRmP?= =?us-ascii?Q?qnTX17DA2BldK0wKeUzJK2kRnrFeW6HAAHC+27WEzFcXB1IqE5pHdLuArK0D?= =?us-ascii?Q?k1+/zyzVMc7kiRQYojjOcjBwYyqCqzhKgK83rXwJR37nNHmAtKpiqmuJ8HiX?= =?us-ascii?Q?5za/wpAEB14VHGm1JEJpUm6gZEEwGYEbHB/WS9jl45AOFUdhIGveg25+9u6d?= =?us-ascii?Q?7zY4iYMuFtFrdM5NyVqx49bnEhScQSZmrjhg5JOc8Rtd2cvTYQF1nu8cUbgn?= =?us-ascii?Q?0hDwfdYqjgYsZMpOFW3aDW6BwameZP7DOjKv2GH0dOkHnFpfeWtuIrwWVNJL?= =?us-ascii?Q?4eEwgd9N5CCaQoV6cyhSUzC1k9DyC157rjhTcLkb1ihfqLQZ2Q5FenVZSzS2?= =?us-ascii?Q?tJkfZalsQTj4JxGbPGC/hTWlRy/7dIDm71UI/hbV5hYWPiFlK4wtsPpa17eO?= =?us-ascii?Q?t7gh3YXkf6PLZ9pceXbj+tndWSvsbGopUDXSaOYaVrqSQWIn0qmSeivlkOX6?= =?us-ascii?Q?6icL6xSYU9ft2ydi2n4YXaCHRV0kN5SAWxn83543L/PoGtTdp4YZ6sPZK1dh?= =?us-ascii?Q?a3spAfjiexw/vTIVZ7ryD1Yih0m1o/QuPOjKfVxv+lwgHFATVPXj6lH7SIpQ?= =?us-ascii?Q?tGgHod14dNxxIPS/6XDwzFfFTrTpyuShjY04PVVJl1Fbc9r+skyEFa9G4l8w?= =?us-ascii?Q?q6q+tfQ2hhHRM9WWqK6sqHepffSupLoZmzDmekm/AlhmCUA9Ikj5ElXtXOO+?= =?us-ascii?Q?aeY8JKZUisWSIl3CNaYD81nk6S/t5fkubYMjIhL7qR3VKWd4VjhbDATMzi7a?= =?us-ascii?Q?+Heinl6GBHLGbZprOt1/CCjj2uVpfw7JV17On1W4lGYEmYAXBKAc0aUuBP7q?= =?us-ascii?Q?5lGbeH+uAs1of2iz2r0kVMdI2AnoUh7bH+kvUeQxmZDT14wqpUXHrh3XxWBB?= =?us-ascii?Q?X9R0bSGJtWcg4efOvmWZYpNUzym4auGDqNl5z63EqxVZ6SG4pOIG2J7foU8x?= =?us-ascii?Q?3jsP+O+8ZxJ6lxg8tcKX45OEHu1jLiucYxcDZSFiTH3Zy1NhY1fmIIYrsqqy?= =?us-ascii?Q?EtVu1rzLh/IMq0crVUnqgodfspAgrFDj7x50hTK5GMMhVCFtgkyPSOTUQD//?= =?us-ascii?Q?veMOKQPhR6y5tvEW8zJ4ga0C?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: a48aec71-cc77-4c99-9619-08d90bce693f X-MS-Exchange-CrossTenant-AuthSource: SN6PR12MB2718.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Apr 2021 11:52:20.8358 (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: nwejc44sOKbm2uIkAyxj71agDO6Id2S6QPg0yk53EntkBAueoLu5RxW+vql/tagydItCyk41XbSGy9KVl1twCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4349 Content-Type: text/plain BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3275 The CacheFlush parameter is used to provide 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 CacheFlush parameter from MemEncryptSev{Set,Clear}PageEncMask(). 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/AmdSevDxe/AmdSevDxe.c | 3 +-- OvmfPkg/Include/Library/MemEncryptSevLib.h | 10 ++-------- OvmfPkg/IoMmuDxe/AmdSevIoMmu.c | 6 ++---- OvmfPkg/Library/BaseMemEncryptSevLib/Ia32/MemEncryptSevLib.c | 10 ++-------- OvmfPkg/Library/BaseMemEncryptSevLib/X64/MemEncryptSevLib.c | 16 ++++------------ OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c | 14 ++++---------- OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c | 8 ++------ OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h | 10 ++-------- OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c | 3 +-- OvmfPkg/PlatformPei/AmdSev.c | 3 +-- 10 files changed, 21 insertions(+), 62 deletions(-) diff --git a/OvmfPkg/AmdSevDxe/AmdSevDxe.c b/OvmfPkg/AmdSevDxe/AmdSevDxe.c index 80831b81fa..41e4b291d0 100644 --- a/OvmfPkg/AmdSevDxe/AmdSevDxe.c +++ b/OvmfPkg/AmdSevDxe/AmdSevDxe.c @@ -120,8 +120,7 @@ AmdSevDxeEntryPoint ( Status = 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/Include/Library/MemEncryptSevLib.h b/OvmfPkg/Include/Library/MemEncryptSevLib.h index c19f92afc6..9b15d80931 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 memory region. - @param[in] Flush Flush the caches before clearing the bit - (mostly TRUE except MMIO addresses) @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 ); /** @@ -128,8 +125,6 @@ MemEncryptSevClearPageEncMask ( address of a memory region. @param[in] NumPages The number of pages from start memory region. - @param[in] Flush Flush the caches before setting the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were set for the memory region. @@ -142,8 +137,7 @@ EFIAPI MemEncryptSevSetPageEncMask ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS BaseAddress, - IN UINTN NumPages, - IN BOOLEAN Flush + IN UINTN NumPages ); diff --git a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c index 49ffa24488..b30628078f 100644 --- a/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c +++ b/OvmfPkg/IoMmuDxe/AmdSevIoMmu.c @@ -252,8 +252,7 @@ IoMmuMap ( Status = MemEncryptSevClearPageEncMask ( 0, MapInfo->PlainTextAddress, - MapInfo->NumberOfPages, - TRUE + MapInfo->NumberOfPages ); ASSERT_EFI_ERROR (Status); if (EFI_ERROR (Status)) { @@ -407,8 +406,7 @@ IoMmuUnmapWorker ( Status = 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 4e8a997d42..34e7c59e2c 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 memory region. - @param[in] Flush Flush the caches before clearing the bit - (mostly TRUE except MMIO addresses) @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 memory region. - @param[in] Flush Flush the caches before setting the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were set for the memory 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 6786573aea..5c260c546e 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 memory region. - @param[in] Flush Flush the caches before clearing the bit - (mostly TRUE except MMIO addresses) @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) ); } @@ -63,8 +59,6 @@ MemEncryptSevClearPageEncMask ( address of a memory region. @param[in] NumPages The number of pages from start memory region. - @param[in] Flush Flush the caches before setting the bit - (mostly TRUE except MMIO addresses) @retval RETURN_SUCCESS The attributes were set for the memory 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) ); } diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c index 3bcc92f2e9..707db5a74a 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/PeiDxeVirtualMemory.c @@ -830,8 +830,6 @@ Done: @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @retval RETURN_SUCCESS The attributes were cleared for the memory region. @@ -844,8 +842,7 @@ EFIAPI InternalMemEncryptSevSetMemoryDecrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { @@ -854,7 +851,7 @@ InternalMemEncryptSevSetMemoryDecrypted ( PhysicalAddress, Length, ClearCBit, - Flush, + TRUE, FALSE ); } @@ -868,8 +865,6 @@ InternalMemEncryptSevSetMemoryDecrypted ( @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @retval RETURN_SUCCESS The attributes were set for the memory region. @@ -882,8 +877,7 @@ EFIAPI InternalMemEncryptSevSetMemoryEncrypted ( IN PHYSICAL_ADDRESS Cr3BaseAddress, IN PHYSICAL_ADDRESS PhysicalAddress, - IN UINTN Length, - IN BOOLEAN Flush + IN UINTN Length ) { return SetMemoryEncDec ( @@ -891,7 +885,7 @@ InternalMemEncryptSevSetMemoryEncrypted ( PhysicalAddress, Length, SetCBit, - Flush, + TRUE, FALSE ); } diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SecVirtualMemory.c index bca5e3febb..24d19d3ca1 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 start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @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/BaseMemEncryptSevLib/X64/VirtualMemory.h b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/VirtualMemory.h index 99ee7ea0e8..832ff10a33 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 start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @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 ); /** @@ -85,8 +82,6 @@ InternalMemEncryptSevSetMemoryDecrypted ( @param[in] PhysicalAddress The physical address that is the start address of a memory region. @param[in] Length The length of memory region - @param[in] Flush Flush the caches before applying the - encryption mask @retval RETURN_SUCCESS The attributes were set for the memory region. @@ -99,8 +94,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/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c index fdf2380974..c7cc5b0389 100644 --- a/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c +++ b/OvmfPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.c @@ -283,8 +283,7 @@ SmmCpuFeaturesSmmRelocationComplete ( Status = 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 dddffdebda..a8bf610022 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -72,8 +72,7 @@ AmdSevEsInitialize ( DecryptStatus = MemEncryptSevClearPageEncMask ( 0, GhcbBasePa + EFI_PAGES_TO_SIZE (PageCount), - 1, - TRUE + 1 ); ASSERT_RETURN_ERROR (DecryptStatus); } -- 2.17.1