From nobody Tue Apr 23 22:58:17 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+96247+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+96247+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1668151057; cv=none; d=zohomail.com; s=zohoarc; b=StFswPnT/pmG6xCSh5he7Q0OQJvXvXu1vwHSrbrPJzbD3oP44PoNOlDQUsoUu+IvJezAYZ+pH3+6t2z1x5ScW8wvXrJ6UvGR7ZzVFkDosNbkkbleeEyrEmcb9b0QI74pzhI2myWaHBU14miRJ4PiGSKYsBiPt1CdIesXaaZm/3o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668151057; 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=01Rb727pQRxLciu0YL1HM9JhY4zpVtF14DYrh/5HMWI=; b=MjIXBVJ5GzUg3MRS7ML6LauiX/FLt6n1zw+PSmUuwld5i2NS/xK8Rhbbt5ZgKrCv+hAawxZDF3eMMv8q1xa8k2JDr89hWMiOKOFHV65qhnZJO35IaO3HPy8yBbPUtvZmM9JRyugAIQlYmQRr5v5fk1baIEcyL3Gtm6LAVYZ6lTg= 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+96247+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 1668151057650466.85353488991825; Thu, 10 Nov 2022 23:17:37 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id CSiFYY1788612xuY4oWMbuNJ; Thu, 10 Nov 2022 23:17:36 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.2924.1668151047526679574 for ; Thu, 10 Nov 2022 23:17:30 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="294901403" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="294901403" X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 23:17:29 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="966732322" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="966732322" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.36]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 23:17:26 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Guo Dong , Sean Rhodes , James Lu , Gua Guo , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [edk2-devel] [PATCH V6 1/3] OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib Date: Fri, 11 Nov 2022 15:17:08 +0800 Message-Id: <20221111071710.1596-2-min.m.xu@intel.com> In-Reply-To: <20221111071710.1596-1-min.m.xu@intel.com> References: <20221111071710.1596-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: ql0bk0LYkNKvWZ2GJWPAoBvwx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1668151056; bh=QD+CyaZi4CO18FVz2dz2n9O2AhprSSgUs2K7omVc09U=; h=Cc:Date:From:Reply-To:Subject:To; b=jj/rssNG4J+w0mYoHi24PJTSrsQUEhaJADgIGvd5xFA5mezm+47/buxCBiu3wiNEAkx UQmVL9S9oTxxO1LfHwOlLORdDsxKKrGtb8/AtTz4hBi08dT2vPPa4pEBC3/R4zJyKmkl7 Lv7KYAxOTPb5NJJBqaOoQQ/+dyuPnrubnOs= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1668151059757100011 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4123 VmgExitLib once was designed to provide interfaces to support #VC handler and issue VMGEXIT instruction. After TDVF (enable TDX feature in OVMF) is introduced, this library is updated to support #VE as well. Now the name of VmgExitLib cannot reflect what the lib does. This patch renames VmgExitLib to CcExitLib (Cc means Confidential Computing). This is a simple renaming and there is no logic changes. After renaming all the VmgExitLib related codes are updated with CcExitLib. These changes are in OvmfPkg/UefiCpuPkg/UefiPayloadPkg. Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Reviewed-by: James Lu Reviewed-by: Gua Guo Reviewed-by: Jiewen Yao Reviewed-by: Ray Ni Signed-off-by: Min Xu --- OvmfPkg/AmdSev/AmdSevX64.dsc | 4 +- OvmfPkg/Bhyve/BhyveX64.dsc | 2 +- OvmfPkg/CloudHv/CloudHvX64.dsc | 6 +-- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 4 +- .../DxeMemEncryptSevLib.inf | 2 +- .../PeiMemEncryptSevLib.inf | 2 +- .../SecMemEncryptSevLib.inf | 2 +- .../X64/SnpPageStateChangeInternal.c | 2 +- .../VmgExitLib.c =3D> CcExitLib/CcExitLib.c} | 5 ++- .../CcExitLib.inf} | 17 +++++---- .../CcExitTd.h} | 4 +- .../CcExitVcHandler.c} | 5 +-- .../CcExitVcHandler.h} | 6 +-- .../CcExitVeHandler.c} | 4 +- .../PeiDxeCcExitVcHandler.c} | 4 +- .../SecCcExitLib.inf} | 14 +++---- .../SecCcExitVcHandler.c} | 4 +- .../X64/TdVmcallCpuid.nasm | 0 OvmfPkg/Microvm/MicrovmX64.dsc | 4 +- OvmfPkg/OvmfPkgIa32.dsc | 4 +- OvmfPkg/OvmfPkgIa32X64.dsc | 4 +- OvmfPkg/OvmfPkgX64.dsc | 6 +-- OvmfPkg/OvmfXen.dsc | 2 +- OvmfPkg/PlatformPei/AmdSev.c | 2 +- OvmfPkg/PlatformPei/PlatformPei.inf | 2 +- .../FvbServicesRuntimeDxe.inf | 2 +- .../QemuFlashDxe.c | 2 +- .../Library/{VmgExitLib.h =3D> CcExitLib.h} | 13 ++++--- .../CcExitLibNull.c} | 33 +++++++++++++++- .../CcExitLibNull.inf} | 12 +++--- .../Library/CcExitLibNull/CcExitLibNull.uni | 14 +++++++ .../DxeCpuExceptionHandlerLib.inf | 2 +- .../PeiCpuExceptionHandlerLib.inf | 2 +- .../PeiDxeSmmCpuException.c | 2 +- .../SecPeiCpuException.c | 2 +- .../SecPeiCpuExceptionHandlerLib.inf | 2 +- .../SmmCpuExceptionHandlerLib.inf | 2 +- .../Xcode5SecPeiCpuExceptionHandlerLib.inf | 2 +- UefiCpuPkg/Library/MpInitLib/AmdSev.c | 2 +- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 2 +- UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 2 +- UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 +- UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 2 +- UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c | 2 +- .../Library/VmgExitLibNull/VmTdExitNull.c | 38 ------------------- .../Library/VmgExitLibNull/VmgExitLibNull.uni | 15 -------- UefiCpuPkg/UefiCpuPkg.dec | 4 +- UefiCpuPkg/UefiCpuPkg.dsc | 4 +- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +- 49 files changed, 135 insertions(+), 141 deletions(-) rename OvmfPkg/Library/{VmgExitLib/VmgExitLib.c =3D> CcExitLib/CcExitLib.c= } (94%) rename OvmfPkg/Library/{VmgExitLib/VmgExitLib.inf =3D> CcExitLib/CcExitLib= .inf} (66%) rename OvmfPkg/Library/{VmgExitLib/VmTdExitHandler.h =3D> CcExitLib/CcExit= Td.h} (86%) rename OvmfPkg/Library/{VmgExitLib/VmgExitVcHandler.c =3D> CcExitLib/CcExi= tVcHandler.c} (95%) rename OvmfPkg/Library/{VmgExitLib/VmgExitVcHandler.h =3D> CcExitLib/CcExi= tVcHandler.h} (89%) rename OvmfPkg/Library/{VmgExitLib/VmTdExitVeHandler.c =3D> CcExitLib/CcEx= itVeHandler.c} (95%) rename OvmfPkg/Library/{VmgExitLib/PeiDxeVmgExitVcHandler.c =3D> CcExitLib= /PeiDxeCcExitVcHandler.c} (94%) rename OvmfPkg/Library/{VmgExitLib/SecVmgExitLib.inf =3D> CcExitLib/SecCcE= xitLib.inf} (79%) rename OvmfPkg/Library/{VmgExitLib/SecVmgExitVcHandler.c =3D> CcExitLib/Se= cCcExitVcHandler.c} (94%) rename OvmfPkg/Library/{VmgExitLib =3D> CcExitLib}/X64/TdVmcallCpuid.nasm = (100%) rename UefiCpuPkg/Include/Library/{VmgExitLib.h =3D> CcExitLib.h} (89%) rename UefiCpuPkg/Library/{VmgExitLibNull/VmgExitLibNull.c =3D> CcExitLibN= ull/CcExitLibNull.c} (79%) rename UefiCpuPkg/Library/{VmgExitLibNull/VmgExitLibNull.inf =3D> CcExitLi= bNull/CcExitLibNull.inf} (60%) create mode 100644 UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.uni delete mode 100644 UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c delete mode 100644 UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.uni diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index 90e8a213ef77..8f7cae787e97 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -204,7 +204,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf =20 [LibraryClasses.common.SEC] @@ -229,7 +229,7 @@ !else CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiC= puExceptionHandlerLib.inf !endif - VmgExitLib|OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLi= b.inf =20 [LibraryClasses.common.PEI_CORE] diff --git a/OvmfPkg/Bhyve/BhyveX64.dsc b/OvmfPkg/Bhyve/BhyveX64.dsc index 475b88b21a4c..e3bb367b6bf6 100644 --- a/OvmfPkg/Bhyve/BhyveX64.dsc +++ b/OvmfPkg/Bhyve/BhyveX64.dsc @@ -232,7 +232,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf =20 [LibraryClasses.common.SEC] diff --git a/OvmfPkg/CloudHv/CloudHvX64.dsc b/OvmfPkg/CloudHv/CloudHvX64.dsc index 10b16104acd7..ce277cb2398b 100644 --- a/OvmfPkg/CloudHv/CloudHvX64.dsc +++ b/OvmfPkg/CloudHv/CloudHvX64.dsc @@ -251,7 +251,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf =20 [LibraryClasses.common.SEC] @@ -275,7 +275,7 @@ !else CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiC= puExceptionHandlerLib.inf !endif - VmgExitLib|OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLi= b.inf =20 [LibraryClasses.common.PEI_CORE] @@ -915,7 +915,7 @@ # OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf { - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf } MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf { diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX6= 4.dsc index c0c1a15b0926..345892651520 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -215,7 +215,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf PlatformInitLib|OvmfPkg/Library/PlatformInitLib/PlatformInitLib.inf @@ -237,7 +237,7 @@ !else CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiC= puExceptionHandlerLib.inf !endif - VmgExitLib|OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLi= b.inf PrePiHobListPointerLib|OvmfPkg/IntelTdx/PrePiHobListPointerLibTdx/PrePiH= obListPointerLibTdx.inf HobLib|EmbeddedPkg/Library/PrePiHobLib/PrePiHobLib.inf diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf b= /OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf index 35b7d519d938..cc24961c9265 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/DxeMemEncryptSevLib.inf @@ -51,7 +51,7 @@ DebugLib MemoryAllocationLib PcdLib - VmgExitLib + CcExitLib =20 [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf b= /OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf index 714da3323765..8f56783da55e 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/PeiMemEncryptSevLib.inf @@ -51,7 +51,7 @@ DebugLib MemoryAllocationLib PcdLib - VmgExitLib + CcExitLib =20 [FeaturePcd] gUefiOvmfPkgTokenSpaceGuid.PcdSmmSmramRequire diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf b= /OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf index 284e5acc1177..b6d76e7e630f 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLib.inf @@ -48,7 +48,7 @@ CpuLib DebugLib PcdLib - VmgExitLib + CcExitLib =20 [FixedPcd] gUefiCpuPkgTokenSpaceGuid.PcdSevEsWorkAreaBase diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInt= ernal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeIntern= al.c index d11aafae8472..73698a7b9d8c 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include =20 #include #include diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitLib.c b/OvmfPkg/Library/CcEx= itLib/CcExitLib.c similarity index 94% rename from OvmfPkg/Library/VmgExitLib/VmgExitLib.c rename to OvmfPkg/Library/CcExitLib/CcExitLib.c index c20552187074..477064cde2bb 100644 --- a/OvmfPkg/Library/VmgExitLib/VmgExitLib.c +++ b/OvmfPkg/Library/CcExitLib/CcExitLib.c @@ -1,7 +1,8 @@ /** @file - VMGEXIT Support Library. + CcExitLib Support Library. =20 Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.
+ Copyright (C) 2020 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -9,7 +10,7 @@ #include #include #include -#include +#include #include =20 /** diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitLib.inf b/OvmfPkg/Library/Cc= ExitLib/CcExitLib.inf similarity index 66% rename from OvmfPkg/Library/VmgExitLib/VmgExitLib.inf rename to OvmfPkg/Library/CcExitLib/CcExitLib.inf index 255b0c1a2f7f..131fa6267522 100644 --- a/OvmfPkg/Library/VmgExitLib/VmgExitLib.inf +++ b/OvmfPkg/Library/CcExitLib/CcExitLib.inf @@ -1,18 +1,19 @@ ## @file -# VMGEXIT Support Library. +# CcExitLib Library. # # Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved. +# Copyright (C) 2020 - 2022, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D VmgExitLib + BASE_NAME =3D CcExitLib FILE_GUID =3D 0e923c25-13cd-430b-8714-ffe85652a97b MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D VmgExitLib|PEIM DXE_CORE DXE_DRIVER D= XE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_DRIVER + LIBRARY_CLASS =3D CcExitLib|PEIM DXE_CORE DXE_DRIVER DX= E_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_DRIVER =20 # # The following information is for reference only and not required by the = build tools. @@ -21,11 +22,11 @@ # =20 [Sources.common] - VmgExitLib.c - VmgExitVcHandler.c - VmgExitVcHandler.h - PeiDxeVmgExitVcHandler.c - VmTdExitVeHandler.c + CcExitLib.c + CcExitVcHandler.c + CcExitVcHandler.h + PeiDxeCcExitVcHandler.c + CcExitVeHandler.c X64/TdVmcallCpuid.nasm =20 [Packages] diff --git a/OvmfPkg/Library/VmgExitLib/VmTdExitHandler.h b/OvmfPkg/Library= /CcExitLib/CcExitTd.h similarity index 86% rename from OvmfPkg/Library/VmgExitLib/VmTdExitHandler.h rename to OvmfPkg/Library/CcExitLib/CcExitTd.h index 7eacd0872f46..013a55e2078c 100644 --- a/OvmfPkg/Library/VmgExitLib/VmTdExitHandler.h +++ b/OvmfPkg/Library/CcExitLib/CcExitTd.h @@ -5,8 +5,8 @@ =20 **/ =20 -#ifndef VMTD_EXIT_HANDLER_H_ -#define VMTD_EXIT_HANDLER_H_ +#ifndef CC_EXIT_TD_H_ +#define CC_EXIT_TD_H_ =20 #include #include diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c b/OvmfPkg/Librar= y/CcExitLib/CcExitVcHandler.c similarity index 95% rename from OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c rename to OvmfPkg/Library/CcExitLib/CcExitVcHandler.c index a4393dffbd63..ad2a922c9f43 100644 --- a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.c +++ b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c @@ -11,13 +11,12 @@ #include #include #include -#include +#include #include #include #include =20 -#include "VmgExitVcHandler.h" -// #include +#include "CcExitVcHandler.h" =20 // // Instruction execution mode definition diff --git a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.h b/OvmfPkg/Librar= y/CcExitLib/CcExitVcHandler.h similarity index 89% rename from OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.h rename to OvmfPkg/Library/CcExitLib/CcExitVcHandler.h index 3a37cb04f616..464591fcb7bc 100644 --- a/OvmfPkg/Library/VmgExitLib/VmgExitVcHandler.h +++ b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.h @@ -6,12 +6,12 @@ =20 **/ =20 -#ifndef __VMG_EXIT_VC_HANDLER_H__ -#define __VMG_EXIT_VC_HANDLER_H__ +#ifndef CC_EXIT_VC_HANDLER_H_ +#define CC_EXIT_VC_HANDLER_H_ =20 #include #include -#include +#include =20 /** Handle a #VC exception. diff --git a/OvmfPkg/Library/VmgExitLib/VmTdExitVeHandler.c b/OvmfPkg/Libra= ry/CcExitLib/CcExitVeHandler.c similarity index 95% rename from OvmfPkg/Library/VmgExitLib/VmTdExitVeHandler.c rename to OvmfPkg/Library/CcExitLib/CcExitVeHandler.c index c89268c5d8e8..08e92c66ce74 100644 --- a/OvmfPkg/Library/VmgExitLib/VmTdExitVeHandler.c +++ b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c @@ -8,8 +8,8 @@ =20 #include #include -#include "VmTdExitHandler.h" -#include +#include "CcExitTd.h" +#include #include #include #include diff --git a/OvmfPkg/Library/VmgExitLib/PeiDxeVmgExitVcHandler.c b/OvmfPkg/= Library/CcExitLib/PeiDxeCcExitVcHandler.c similarity index 94% rename from OvmfPkg/Library/VmgExitLib/PeiDxeVmgExitVcHandler.c rename to OvmfPkg/Library/CcExitLib/PeiDxeCcExitVcHandler.c index e3d071583750..bb718161f588 100644 --- a/OvmfPkg/Library/VmgExitLib/PeiDxeVmgExitVcHandler.c +++ b/OvmfPkg/Library/CcExitLib/PeiDxeCcExitVcHandler.c @@ -10,10 +10,10 @@ #include #include #include -#include +#include #include =20 -#include "VmgExitVcHandler.h" +#include "CcExitVcHandler.h" =20 /** Handle a #VC exception. diff --git a/OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf b/OvmfPkg/Library= /CcExitLib/SecCcExitLib.inf similarity index 79% rename from OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf rename to OvmfPkg/Library/CcExitLib/SecCcExitLib.inf index f9bd4974f6dc..1ee22ce0aea1 100644 --- a/OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf +++ b/OvmfPkg/Library/CcExitLib/SecCcExitLib.inf @@ -8,11 +8,11 @@ =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D SecVmgExitLib + BASE_NAME =3D SecCcExitLib FILE_GUID =3D dafff819-f86c-4cff-a70e-83161e5bcf9a MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D VmgExitLib|SEC + LIBRARY_CLASS =3D CcExitLib|SEC =20 # # The following information is for reference only and not required by the = build tools. @@ -21,11 +21,11 @@ # =20 [Sources.common] - VmgExitLib.c - VmgExitVcHandler.c - VmgExitVcHandler.h - SecVmgExitVcHandler.c - VmTdExitVeHandler.c + CcExitLib.c + CcExitVcHandler.c + CcExitVcHandler.h + SecCcExitVcHandler.c + CcExitVeHandler.c X64/TdVmcallCpuid.nasm =20 [Packages] diff --git a/OvmfPkg/Library/VmgExitLib/SecVmgExitVcHandler.c b/OvmfPkg/Lib= rary/CcExitLib/SecCcExitVcHandler.c similarity index 94% rename from OvmfPkg/Library/VmgExitLib/SecVmgExitVcHandler.c rename to OvmfPkg/Library/CcExitLib/SecCcExitVcHandler.c index fe8680f831d9..769e0b5b7417 100644 --- a/OvmfPkg/Library/VmgExitLib/SecVmgExitVcHandler.c +++ b/OvmfPkg/Library/CcExitLib/SecCcExitVcHandler.c @@ -10,10 +10,10 @@ #include #include #include -#include +#include #include =20 -#include "VmgExitVcHandler.h" +#include "CcExitVcHandler.h" =20 /** Handle a #VC exception. diff --git a/OvmfPkg/Library/VmgExitLib/X64/TdVmcallCpuid.nasm b/OvmfPkg/Li= brary/CcExitLib/X64/TdVmcallCpuid.nasm similarity index 100% rename from OvmfPkg/Library/VmgExitLib/X64/TdVmcallCpuid.nasm rename to OvmfPkg/Library/CcExitLib/X64/TdVmcallCpuid.nasm diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index 7eff8e2a88d9..994a02d30107 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -249,7 +249,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf SerialPortLib|MdeModulePkg/Library/BaseSerialPortLib16550/BaseSerialPort= Lib16550.inf PlatformHookLib|MdeModulePkg/Library/BasePlatformHookLibNull/BasePlatfor= mHookLibNull.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf @@ -277,7 +277,7 @@ !else CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiC= puExceptionHandlerLib.inf !endif - VmgExitLib|OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLi= b.inf =20 [LibraryClasses.common.PEI_CORE] diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index e9ba491237ae..6f774baf90f5 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -256,7 +256,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf =20 [LibraryClasses.common.SEC] TimerLib|OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.inf @@ -984,7 +984,7 @@ # OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf { - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf } MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf { diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index af566b953f36..c851764dec05 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -260,7 +260,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf =20 @@ -1002,7 +1002,7 @@ # OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf { - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf } MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf { diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index f39d9cd117e6..63c3a47aea30 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -276,7 +276,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|OvmfPkg/Library/VmgExitLib/VmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/CcExitLib.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf TdxMailboxLib|OvmfPkg/Library/TdxMailboxLib/TdxMailboxLib.inf =20 @@ -302,7 +302,7 @@ !else CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiC= puExceptionHandlerLib.inf !endif - VmgExitLib|OvmfPkg/Library/VmgExitLib/SecVmgExitLib.inf + CcExitLib|OvmfPkg/Library/CcExitLib/SecCcExitLib.inf MemEncryptSevLib|OvmfPkg/Library/BaseMemEncryptSevLib/SecMemEncryptSevLi= b.inf CcProbeLib|OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf =20 @@ -1072,7 +1072,7 @@ # OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesSmm.inf { - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf } MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableSmm.inf { diff --git a/OvmfPkg/OvmfXen.dsc b/OvmfPkg/OvmfXen.dsc index 58a7c97cddf7..8bb497088bd2 100644 --- a/OvmfPkg/OvmfXen.dsc +++ b/OvmfPkg/OvmfXen.dsc @@ -231,7 +231,7 @@ =20 [LibraryClasses.common] BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf TdxLib|MdePkg/Library/TdxLib/TdxLib.inf =20 [LibraryClasses.common.SEC] diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index 385562b44c4e..80a1194ffcb9 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include =20 #include "Platform.h" diff --git a/OvmfPkg/PlatformPei/PlatformPei.inf b/OvmfPkg/PlatformPei/Plat= formPei.inf index 3cd83e6ec3e5..1fadadeb5565 100644 --- a/OvmfPkg/PlatformPei/PlatformPei.inf +++ b/OvmfPkg/PlatformPei/PlatformPei.inf @@ -63,7 +63,7 @@ MtrrLib MemEncryptSevLib PcdLib - VmgExitLib + CcExitLib PlatformInitLib =20 [Pcd] diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.i= nf b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf index 8bb2325157ea..f47170478900 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf @@ -53,7 +53,7 @@ UefiBootServicesTableLib UefiDriverEntryPoint UefiRuntimeLib - VmgExitLib + CcExitLib =20 [Guids] gEfiEventVirtualAddressChangeGuid # ALWAYS_CONSUMED diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c b/OvmfPk= g/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c index 172d6a4267f8..58bcad825d57 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c @@ -11,7 +11,7 @@ =20 #include #include -#include +#include #include =20 #include "QemuFlash.h" diff --git a/UefiCpuPkg/Include/Library/VmgExitLib.h b/UefiCpuPkg/Include/L= ibrary/CcExitLib.h similarity index 89% rename from UefiCpuPkg/Include/Library/VmgExitLib.h rename to UefiCpuPkg/Include/Library/CcExitLib.h index f9f911099a7b..1ae618c19b9e 100644 --- a/UefiCpuPkg/Include/Library/VmgExitLib.h +++ b/UefiCpuPkg/Include/Library/CcExitLib.h @@ -1,16 +1,19 @@ /** @file - Public header file for the VMGEXIT Support library class. + Public header file for the CcExitLib. =20 - This library class defines some routines used when invoking the VMGEXIT - instruction in support of SEV-ES and to handle #VC exceptions. + This library class defines some routines used for below CcExit handler. + - Invoking the VMGEXIT instruction in support of SEV-ES and to handle + #VC exceptions. + - Handle #VE exception in TDX. =20 Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.
+ Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#ifndef __VMG_EXIT_LIB_H__ -#define __VMG_EXIT_LIB_H__ +#ifndef CC_EXIT_LIB_H_ +#define CC_EXIT_LIB_H_ =20 #include #include diff --git a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.c b/UefiCpuPk= g/Library/CcExitLibNull/CcExitLibNull.c similarity index 79% rename from UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.c rename to UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c index d661d8597434..79eca74e138f 100644 --- a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.c +++ b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c @@ -1,14 +1,15 @@ /** @file - VMGEXIT Base Support Library. + CcExit Base Support Library. =20 Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved.
+ Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 #include #include -#include +#include =20 /** Perform VMGEXIT. @@ -163,3 +164,31 @@ VmgExitHandleVc ( =20 return EFI_UNSUPPORTED; } + +/** + Handle a #VE exception. + + Performs the necessary processing to handle a #VE exception. + + @param[in, out] ExceptionType Pointer to an EFI_EXCEPTION_TYPE to be s= et + as value to use on error. + @param[in, out] SystemContext Pointer to EFI_SYSTEM_CONTEXT + + @retval EFI_SUCCESS Exception handled + @retval EFI_UNSUPPORTED #VE not supported, (new) exception value= to + propagate provided + @retval EFI_PROTOCOL_ERROR #VE handling failed, (new) exception val= ue to + propagate provided + +**/ +EFI_STATUS +EFIAPI +VmTdExitHandleVe ( + IN OUT EFI_EXCEPTION_TYPE *ExceptionType, + IN OUT EFI_SYSTEM_CONTEXT SystemContext + ) +{ + *ExceptionType =3D VE_EXCEPTION; + + return EFI_UNSUPPORTED; +} diff --git a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf b/UefiCpu= Pkg/Library/CcExitLibNull/CcExitLibNull.inf similarity index 60% rename from UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf rename to UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf index 4aab601939ff..ed7f611cbc7e 100644 --- a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf +++ b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf @@ -1,23 +1,23 @@ ## @file -# VMGEXIT Support Library. +# CcExit Base Support Library. # # Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved. +# Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## =20 [Defines] INF_VERSION =3D 0x00010005 - BASE_NAME =3D VmgExitLibNull - MODULE_UNI_FILE =3D VmgExitLibNull.uni + BASE_NAME =3D CcExitLibNull + MODULE_UNI_FILE =3D CcExitLibNull.uni FILE_GUID =3D 3cd7368f-ef9b-4a9b-9571-2ed93813677e MODULE_TYPE =3D BASE VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D VmgExitLib + LIBRARY_CLASS =3D CcExitLib =20 [Sources.common] - VmgExitLibNull.c - VmTdExitNull.c + CcExitLibNull.c =20 [Packages] MdePkg/MdePkg.dec diff --git a/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.uni b/UefiCpuPk= g/Library/CcExitLibNull/CcExitLibNull.uni new file mode 100644 index 000000000000..b18ae8792ed7 --- /dev/null +++ b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.uni @@ -0,0 +1,14 @@ +// /** @file +// CcExitLib instance. +// +// Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved. +// Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
+// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "CcExitLib NULL in= stance" + +#string STR_MODULE_DESCRIPTION #language en-US "CcExitLib NULL in= stance." + diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandl= erLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandle= rLib.inf index e7a81bebdb13..d0f82095cf92 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.i= nf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.i= nf @@ -60,4 +60,4 @@ PeCoffGetEntryPointLib MemoryAllocationLib DebugLib - VmgExitLib + CcExitLib diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandl= erLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandle= rLib.inf index 7c2ec3b2db4c..5339f8e60404 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.i= nf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiCpuExceptionHandlerLib.i= nf @@ -52,7 +52,7 @@ HobLib MemoryAllocationLib SynchronizationLib - VmgExitLib + CcExitLib =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard # CONSUMES diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuExceptio= n.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c index a7d0897ef1f9..2b6d9da5c713 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c @@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include -#include +#include #include "CpuExceptionCommon.h" =20 /** diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c= b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c index ad5e0e9ed4f1..0a9ea79f52dc 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c @@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include -#include +#include #include "CpuExceptionCommon.h" =20 CONST UINTN mDoFarReturnFlag =3D 0; diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHa= ndlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException= HandlerLib.inf index 6a170286c8fc..df44371fe018 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLi= b.inf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuExceptionHandlerLi= b.inf @@ -48,7 +48,7 @@ PrintLib LocalApicLib PeCoffGetEntryPointLib - VmgExitLib + CcExitLib =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandl= erLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandle= rLib.inf index 9dde07612a04..8f8a5dab7930 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.i= nf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SmmCpuExceptionHandlerLib.i= nf @@ -51,7 +51,7 @@ LocalApicLib PeCoffGetEntryPointLib DebugLib - VmgExitLib + CcExitLib =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExcep= tionHandlerLib.inf b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPei= CpuExceptionHandlerLib.inf index 6d2f66504a5b..619b39d7f1de 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHan= dlerLib.inf +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/Xcode5SecPeiCpuExceptionHan= dlerLib.inf @@ -53,7 +53,7 @@ PrintLib LocalApicLib PeCoffGetEntryPointLib - VmgExitLib + CcExitLib =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdCpuStackGuard diff --git a/UefiCpuPkg/Library/MpInitLib/AmdSev.c b/UefiCpuPkg/Library/MpI= nitLib/AmdSev.c index 4e4c63a52de4..2dd8f4d74621 100644 --- a/UefiCpuPkg/Library/MpInitLib/AmdSev.c +++ b/UefiCpuPkg/Library/MpInitLib/AmdSev.c @@ -8,7 +8,7 @@ **/ =20 #include "MpLib.h" -#include +#include =20 /** Get Protected mode code segment with 16-bit default addressing diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf b/UefiCpuPkg/Lib= rary/MpInitLib/DxeMpInitLib.inf index e1cd0b350008..cd07de3a3c0b 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf @@ -54,7 +54,7 @@ DebugAgentLib SynchronizationLib PcdLib - VmgExitLib + CcExitLib MicrocodeLib =20 [Protocols] diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/M= pInitLib/DxeMpLib.c index 78cc3e2b93fd..ef56af1f738b 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include =20 diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpIn= itLib/MpLib.c index 1c053f87a4c6..e5dc852ed95f 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -9,7 +9,7 @@ **/ =20 #include "MpLib.h" -#include +#include #include #include =20 diff --git a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf b/UefiCpuPkg/Lib= rary/MpInitLib/PeiMpInitLib.inf index 5facf4db9499..afd551bb0f64 100644 --- a/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf +++ b/UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf @@ -53,7 +53,7 @@ SynchronizationLib PeiServicesLib PcdLib - VmgExitLib + CcExitLib MicrocodeLib =20 [Pcd] diff --git a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c b/UefiCpuPkg/Library= /MpInitLib/X64/AmdSev.c index a3cd377ef600..4c4f81af7c22 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c +++ b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c @@ -9,7 +9,7 @@ **/ =20 #include "MpLib.h" -#include +#include #include #include =20 diff --git a/UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c b/UefiCpuPkg/= Library/VmgExitLibNull/VmTdExitNull.c deleted file mode 100644 index 6a4e8087cb89..000000000000 --- a/UefiCpuPkg/Library/VmgExitLibNull/VmTdExitNull.c +++ /dev/null @@ -1,38 +0,0 @@ -/** @file - - Copyright (c) 2021, Intel Corporation. All rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ -#include -#include -#include - -/** - Handle a #VE exception. - - Performs the necessary processing to handle a #VE exception. - - @param[in, out] ExceptionType Pointer to an EFI_EXCEPTION_TYPE to be s= et - as value to use on error. - @param[in, out] SystemContext Pointer to EFI_SYSTEM_CONTEXT - - @retval EFI_SUCCESS Exception handled - @retval EFI_UNSUPPORTED #VE not supported, (new) exception value= to - propagate provided - @retval EFI_PROTOCOL_ERROR #VE handling failed, (new) exception val= ue to - propagate provided - -**/ -EFI_STATUS -EFIAPI -VmTdExitHandleVe ( - IN OUT EFI_EXCEPTION_TYPE *ExceptionType, - IN OUT EFI_SYSTEM_CONTEXT SystemContext - ) -{ - *ExceptionType =3D VE_EXCEPTION; - - return EFI_UNSUPPORTED; -} diff --git a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.uni b/UefiCpu= Pkg/Library/VmgExitLibNull/VmgExitLibNull.uni deleted file mode 100644 index 8639bc0e8ce9..000000000000 --- a/UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.uni +++ /dev/null @@ -1,15 +0,0 @@ -// /** @file -// VMGEXIT support library instance. -// -// VMGEXIT support library instance. -// -// Copyright (C) 2020, Advanced Micro Devices, Inc. All rights reserved. -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "VMGEXIT support N= ULL library instance" - -#string STR_MODULE_DESCRIPTION #language en-US "VMGEXIT support N= ULL library instance." - diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 718323d9042c..cff239d5283e 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -53,8 +53,8 @@ ## MpInitLib|Include/Library/MpInitLib.h =20 - ## @libraryclass Provides function to support VMGEXIT processing. - VmgExitLib|Include/Library/VmgExitLib.h + ## @libraryclass Provides function to support CcExit processing. + CcExitLib|Include/Library/CcExitLib.h =20 ## @libraryclass Provides function to get CPU cache information. CpuCacheInfoLib|Include/Library/CpuCacheInfoLib.h diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc index 0e1a99ddc09f..67b0ce46e455 100644 --- a/UefiCpuPkg/UefiCpuPkg.dsc +++ b/UefiCpuPkg/UefiCpuPkg.dsc @@ -59,7 +59,7 @@ PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeC= offGetEntryPointLib.inf PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeC= offExtraActionLibNull.inf TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurem= entLibNull.inf - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezv= ousLib.inf CpuPageTableLib|UefiCpuPkg/Library/CpuPageTableLib/CpuPageTableLib.inf @@ -163,7 +163,7 @@ UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLibStm.inf UefiCpuPkg/Library/SmmCpuFeaturesLib/StandaloneMmCpuFeaturesLib.inf - UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationPei.inf UefiCpuPkg/PiSmmCommunication/PiSmmCommunicationSmm.inf UefiCpuPkg/SecCore/SecCore.inf diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayload= Pkg.dsc index 1150be6acd0e..723a50a42284 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -301,7 +301,7 @@ VariablePolicyLib|MdeModulePkg/Library/VariablePolicyLib/VariablePolicyL= ib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/Var= iablePolicyHelperLib.inf VariableFlashInfoLib|MdeModulePkg/Library/BaseVariableFlashInfoLib/BaseV= ariableFlashInfoLib.inf - VmgExitLib|UefiCpuPkg/Library/VmgExitLibNull/VmgExitLibNull.inf + CcExitLib|UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.inf ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeRepor= tStatusCodeLib.inf =20 [LibraryClasses.common] --=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 (#96247): https://edk2.groups.io/g/devel/message/96247 Mute This Topic: https://groups.io/mt/94954286/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 Tue Apr 23 22:58:17 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+96248+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+96248+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1668151054; cv=none; d=zohomail.com; s=zohoarc; b=bBOWXbbwTrutuBC3EE0ncu7WeJVxTLPhkMwyQK/nIqRwJHiayeF74d7rAZx94QWg4+NJJ2Gdj+qZVOR7x+OwrzBf9ZdKYHPGVBIZDQXsJXDuO8vhhn04rPaWebcQGwKbNusHTohYKi4ikXyQR3rg0Wjn/cj8Kl2mxI6IV+Kw3lM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668151054; 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=lZv2GArNx/IQzLfvGV5eb2T3v1RCLFFQpGy92eJyQ+s=; b=N18qSphAGve04Jb5kkCrw2teva8NNMg9Kr6H1iBa9F4th9Oo5dRejY8+IzrKckzRU9hhWd5dgLpC1nX6C529awr0ktgzvBRWF8SpFK4dg6NQ/1K6jVymHNQcS6k25AlitLlIaYZy8fmAPxPxIrEWpHmvWJGPkfAg/DdHSx98Ejw= 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+96248+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 1668151054770883.3042506892931; Thu, 10 Nov 2022 23:17:34 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id dWO2YY1788612xua3AiUwpaE; Thu, 10 Nov 2022 23:17:33 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.2924.1668151047526679574 for ; Thu, 10 Nov 2022 23:17:33 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="294901428" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="294901428" X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 23:17:32 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="966732329" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="966732329" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.36]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 23:17:29 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky Subject: [edk2-devel] [PATCH V6 2/3] OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib Date: Fri, 11 Nov 2022 15:17:09 +0800 Message-Id: <20221111071710.1596-3-min.m.xu@intel.com> In-Reply-To: <20221111071710.1596-1-min.m.xu@intel.com> References: <20221111071710.1596-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: eeYWHXG3sLa48fdvO1ept6Dox1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1668151053; bh=5Op8EBpQtuZGZiQOgqZ3AECFfrchbC8JidHYP8cVGc8=; h=Cc:Date:From:Reply-To:Subject:To; b=JbNIYmh/FLbIFFRyCW3ZvzEeIajo4R5Jl6sWex3opeTLijpE26RLO0zohNN3M1JH43J VZve8KRqO/AHkYUI5h3ea34Pps9LWQKcXOpfgzJi/NGm+0q/81qh3PHKWwSiqN55b2ddG P/Pfe/hw64QhrTqGS3zdnzgCfjJhQnH2/L8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1668151055841100004 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4123 APIs which are defined in CcExitLib.h are added with the CcExit prefix. This is to make the APIs' name more meaningful. This change impacts OvmfPkg/UefiCpuPkg. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Reviewed-by: Jiewen Yao Reviewed-by: Ray Ni Signed-off-by: Min Xu --- .../X64/SnpPageStateChangeInternal.c | 8 +- OvmfPkg/Library/CcExitLib/CcExitLib.c | 18 +-- OvmfPkg/Library/CcExitLib/CcExitVcHandler.c | 124 +++++++++--------- OvmfPkg/Library/CcExitLib/CcExitVeHandler.c | 2 +- .../Library/CcExitLib/PeiDxeCcExitVcHandler.c | 2 +- .../Library/CcExitLib/SecCcExitVcHandler.c | 2 +- OvmfPkg/PlatformPei/AmdSev.c | 8 +- .../QemuFlashDxe.c | 8 +- UefiCpuPkg/Include/Library/CcExitLib.h | 16 +-- .../Library/CcExitLibNull/CcExitLibNull.c | 16 +-- .../PeiDxeSmmCpuException.c | 4 +- .../SecPeiCpuException.c | 4 +- UefiCpuPkg/Library/MpInitLib/AmdSev.c | 8 +- UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 6 +- UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c | 8 +- 15 files changed, 117 insertions(+), 117 deletions(-) diff --git a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInt= ernal.c b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeIntern= al.c index 73698a7b9d8c..4d684964d838 100644 --- a/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c +++ b/OvmfPkg/Library/BaseMemEncryptSevLib/X64/SnpPageStateChangeInternal.c @@ -193,9 +193,9 @@ PageStateChangeVmgExit ( // while (Info->Header.CurrentEntry <=3D Info->Header.EndEntry) { Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_SNP_PAGE_STATE_CHANGE, 0, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_SNP_PAGE_STATE_CHANGE, 0, 0); =20 // // The Page State Change VMGEXIT can pass the failure through the @@ -251,7 +251,7 @@ InternalSetPageState ( // // Initialize the GHCB // - VmgInit (Ghcb, &InterruptState); + CcExitVmgInit (Ghcb, &InterruptState); =20 // // Build the page state structure @@ -293,7 +293,7 @@ InternalSetPageState ( PvalidateRange (Info, CurrentEntry, EndEntry, TRUE); } =20 - VmgDone (Ghcb, InterruptState); + CcExitVmgDone (Ghcb, InterruptState); =20 BaseAddress =3D NextAddress; } diff --git a/OvmfPkg/Library/CcExitLib/CcExitLib.c b/OvmfPkg/Library/CcExit= Lib/CcExitLib.c index 477064cde2bb..e256000fb283 100644 --- a/OvmfPkg/Library/CcExitLib/CcExitLib.c +++ b/OvmfPkg/Library/CcExitLib/CcExitLib.c @@ -103,7 +103,7 @@ VmgExitErrorCheck ( **/ UINT64 EFIAPI -VmgExit ( +CcExitVmgExit ( IN OUT GHCB *Ghcb, IN UINT64 ExitCode, IN UINT64 ExitInfo1, @@ -114,9 +114,9 @@ VmgExit ( Ghcb->SaveArea.SwExitInfo1 =3D ExitInfo1; Ghcb->SaveArea.SwExitInfo2 =3D ExitInfo2; =20 - VmgSetOffsetValid (Ghcb, GhcbSwExitCode); - VmgSetOffsetValid (Ghcb, GhcbSwExitInfo1); - VmgSetOffsetValid (Ghcb, GhcbSwExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitCode); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitInfo1); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwExitInfo2); =20 // // Guest memory is used for the guest-hypervisor communication, so fence @@ -138,12 +138,12 @@ VmgExit ( =20 @param[in, out] Ghcb A pointer to the GHCB @param[in, out] InterruptState A pointer to hold the current interrupt - state, used for restoring in VmgDone () + state, used for restoring in CcExitVmgD= one () =20 **/ VOID EFIAPI -VmgInit ( +CcExitVmgInit ( IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState ) @@ -173,7 +173,7 @@ VmgInit ( **/ VOID EFIAPI -VmgDone ( +CcExitVmgDone ( IN OUT GHCB *Ghcb, IN BOOLEAN InterruptState ) @@ -195,7 +195,7 @@ VmgDone ( **/ VOID EFIAPI -VmgSetOffsetValid ( +CcExitVmgSetOffsetValid ( IN OUT GHCB *Ghcb, IN GHCB_REGISTER Offset ) @@ -224,7 +224,7 @@ VmgSetOffsetValid ( **/ BOOLEAN EFIAPI -VmgIsOffsetValid ( +CcExitVmgIsOffsetValid ( IN GHCB *Ghcb, IN GHCB_REGISTER Offset ) diff --git a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c b/OvmfPkg/Library/= CcExitLib/CcExitVcHandler.c index ad2a922c9f43..985e5479775c 100644 --- a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c +++ b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c @@ -611,7 +611,7 @@ UnsupportedExit ( { UINT64 Status; =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_UNSUPPORTED, Regs->ExceptionData, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_UNSUPPORTED, Regs->ExceptionDat= a, 0); if (Status =3D=3D 0) { GHCB_EVENT_INJECTION Event; =20 @@ -755,8 +755,8 @@ MmioExit ( CopyMem (Ghcb->SharedBuffer, &InstructionData->Ext.RegData, Bytes); =20 Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - Status =3D VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, Exit= Info2); if (Status !=3D 0) { return Status; } @@ -807,8 +807,8 @@ MmioExit ( CopyMem (Ghcb->SharedBuffer, &Regs->Rax, Bytes); =20 Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - Status =3D VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, Exit= Info2); if (Status !=3D 0) { return Status; } @@ -843,8 +843,8 @@ MmioExit ( CopyMem (Ghcb->SharedBuffer, InstructionData->Immediate, Bytes); =20 Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - Status =3D VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, ExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, ExitInfo1, Exit= Info2); if (Status !=3D 0) { return Status; } @@ -882,8 +882,8 @@ MmioExit ( ExitInfo2 =3D Bytes; =20 Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - Status =3D VmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitI= nfo2); if (Status !=3D 0) { return Status; } @@ -942,8 +942,8 @@ MmioExit ( ExitInfo2 =3D Bytes; =20 Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - Status =3D VmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitI= nfo2); if (Status !=3D 0) { return Status; } @@ -979,8 +979,8 @@ MmioExit ( ExitInfo2 =3D Bytes; =20 Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - Status =3D VmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitI= nfo2); if (Status !=3D 0) { return Status; } @@ -1011,8 +1011,8 @@ MmioExit ( ExitInfo2 =3D Bytes; =20 Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - Status =3D VmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_READ, ExitInfo1, ExitI= nfo2); if (Status !=3D 0) { return Status; } @@ -1068,11 +1068,11 @@ MwaitExit ( DecodeModRm (Regs, InstructionData); =20 Ghcb->SaveArea.Rax =3D Regs->Rax; - VmgSetOffsetValid (Ghcb, GhcbRax); + CcExitVmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Rcx =3D Regs->Rcx; - VmgSetOffsetValid (Ghcb, GhcbRcx); + CcExitVmgSetOffsetValid (Ghcb, GhcbRcx); =20 - return VmgExit (Ghcb, SVM_EXIT_MWAIT, 0, 0); + return CcExitVmgExit (Ghcb, SVM_EXIT_MWAIT, 0, 0); } =20 /** @@ -1100,13 +1100,13 @@ MonitorExit ( DecodeModRm (Regs, InstructionData); =20 Ghcb->SaveArea.Rax =3D Regs->Rax; // Identity mapped, so VA =3D PA - VmgSetOffsetValid (Ghcb, GhcbRax); + CcExitVmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Rcx =3D Regs->Rcx; - VmgSetOffsetValid (Ghcb, GhcbRcx); + CcExitVmgSetOffsetValid (Ghcb, GhcbRcx); Ghcb->SaveArea.Rdx =3D Regs->Rdx; - VmgSetOffsetValid (Ghcb, GhcbRdx); + CcExitVmgSetOffsetValid (Ghcb, GhcbRdx); =20 - return VmgExit (Ghcb, SVM_EXIT_MONITOR, 0, 0); + return CcExitVmgExit (Ghcb, SVM_EXIT_MONITOR, 0, 0); } =20 /** @@ -1131,7 +1131,7 @@ WbinvdExit ( IN SEV_ES_INSTRUCTION_DATA *InstructionData ) { - return VmgExit (Ghcb, SVM_EXIT_WBINVD, 0, 0); + return CcExitVmgExit (Ghcb, SVM_EXIT_WBINVD, 0, 0); } =20 /** @@ -1160,14 +1160,14 @@ RdtscpExit ( =20 DecodeModRm (Regs, InstructionData); =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_RDTSCP, 0, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_RDTSCP, 0, 0); if (Status !=3D 0) { return Status; } =20 - if (!VmgIsOffsetValid (Ghcb, GhcbRax) || - !VmgIsOffsetValid (Ghcb, GhcbRcx) || - !VmgIsOffsetValid (Ghcb, GhcbRdx)) + if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) || + !CcExitVmgIsOffsetValid (Ghcb, GhcbRcx) || + !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } @@ -1206,16 +1206,16 @@ VmmCallExit ( DecodeModRm (Regs, InstructionData); =20 Ghcb->SaveArea.Rax =3D Regs->Rax; - VmgSetOffsetValid (Ghcb, GhcbRax); + CcExitVmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Cpl =3D (UINT8)(Regs->Cs & 0x3); - VmgSetOffsetValid (Ghcb, GhcbCpl); + CcExitVmgSetOffsetValid (Ghcb, GhcbCpl); =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_VMMCALL, 0, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_VMMCALL, 0, 0); if (Status !=3D 0) { return Status; } =20 - if (!VmgIsOffsetValid (Ghcb, GhcbRax)) { + if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } =20 @@ -1254,28 +1254,28 @@ MsrExit ( case 0x30: // WRMSR ExitInfo1 =3D 1; Ghcb->SaveArea.Rax =3D Regs->Rax; - VmgSetOffsetValid (Ghcb, GhcbRax); + CcExitVmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Rdx =3D Regs->Rdx; - VmgSetOffsetValid (Ghcb, GhcbRdx); + CcExitVmgSetOffsetValid (Ghcb, GhcbRdx); // // fall through // case 0x32: // RDMSR Ghcb->SaveArea.Rcx =3D Regs->Rcx; - VmgSetOffsetValid (Ghcb, GhcbRcx); + CcExitVmgSetOffsetValid (Ghcb, GhcbRcx); break; default: return UnsupportedExit (Ghcb, Regs, InstructionData); } =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_MSR, ExitInfo1, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_MSR, ExitInfo1, 0); if (Status !=3D 0) { return Status; } =20 if (ExitInfo1 =3D=3D 0) { - if (!VmgIsOffsetValid (Ghcb, GhcbRax) || - !VmgIsOffsetValid (Ghcb, GhcbRdx)) + if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) || + !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } @@ -1471,8 +1471,8 @@ IoioExit ( } =20 Ghcb->SaveArea.SwScratch =3D (UINT64)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - Status =3D VmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, ExitInfo2); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, ExitI= nfo2); if (Status !=3D 0) { return Status; } @@ -1495,15 +1495,15 @@ IoioExit ( CopyMem (&Ghcb->SaveArea.Rax, &Regs->Rax, IOIO_DATA_BYTES (ExitInfo1= )); } =20 - VmgSetOffsetValid (Ghcb, GhcbRax); + CcExitVmgSetOffsetValid (Ghcb, GhcbRax); =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_IOIO_PROT, ExitInfo1, 0); if (Status !=3D 0) { return Status; } =20 if ((ExitInfo1 & IOIO_TYPE_IN) !=3D 0) { - if (!VmgIsOffsetValid (Ghcb, GhcbRax)) { + if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } =20 @@ -1536,7 +1536,7 @@ InvdExit ( IN SEV_ES_INSTRUCTION_DATA *InstructionData ) { - return VmgExit (Ghcb, SVM_EXIT_INVD, 0, 0); + return CcExitVmgExit (Ghcb, SVM_EXIT_INVD, 0, 0); } =20 /** @@ -1581,23 +1581,23 @@ GetCpuidHyp ( { *UnsupportedExit =3D FALSE; Ghcb->SaveArea.Rax =3D EaxIn; - VmgSetOffsetValid (Ghcb, GhcbRax); + CcExitVmgSetOffsetValid (Ghcb, GhcbRax); Ghcb->SaveArea.Rcx =3D EcxIn; - VmgSetOffsetValid (Ghcb, GhcbRcx); + CcExitVmgSetOffsetValid (Ghcb, GhcbRcx); if (EaxIn =3D=3D CPUID_EXTENDED_STATE) { Ghcb->SaveArea.XCr0 =3D XCr0; - VmgSetOffsetValid (Ghcb, GhcbXCr0); + CcExitVmgSetOffsetValid (Ghcb, GhcbXCr0); } =20 - *Status =3D VmgExit (Ghcb, SVM_EXIT_CPUID, 0, 0); + *Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_CPUID, 0, 0); if (*Status !=3D 0) { return FALSE; } =20 - if (!VmgIsOffsetValid (Ghcb, GhcbRax) || - !VmgIsOffsetValid (Ghcb, GhcbRbx) || - !VmgIsOffsetValid (Ghcb, GhcbRcx) || - !VmgIsOffsetValid (Ghcb, GhcbRdx)) + if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) || + !CcExitVmgIsOffsetValid (Ghcb, GhcbRbx) || + !CcExitVmgIsOffsetValid (Ghcb, GhcbRcx) || + !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx)) { *UnsupportedExit =3D TRUE; return FALSE; @@ -2049,15 +2049,15 @@ RdpmcExit ( UINT64 Status; =20 Ghcb->SaveArea.Rcx =3D Regs->Rcx; - VmgSetOffsetValid (Ghcb, GhcbRcx); + CcExitVmgSetOffsetValid (Ghcb, GhcbRcx); =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_RDPMC, 0, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_RDPMC, 0, 0); if (Status !=3D 0) { return Status; } =20 - if (!VmgIsOffsetValid (Ghcb, GhcbRax) || - !VmgIsOffsetValid (Ghcb, GhcbRdx)) + if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) || + !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } @@ -2092,13 +2092,13 @@ RdtscExit ( { UINT64 Status; =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_RDTSC, 0, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_RDTSC, 0, 0); if (Status !=3D 0) { return Status; } =20 - if (!VmgIsOffsetValid (Ghcb, GhcbRax) || - !VmgIsOffsetValid (Ghcb, GhcbRdx)) + if (!CcExitVmgIsOffsetValid (Ghcb, GhcbRax) || + !CcExitVmgIsOffsetValid (Ghcb, GhcbRdx)) { return UnsupportedExit (Ghcb, Regs, InstructionData); } @@ -2150,9 +2150,9 @@ Dr7WriteExit ( // Using a value of 0 for ExitInfo1 means RAX holds the value // Ghcb->SaveArea.Rax =3D *Register; - VmgSetOffsetValid (Ghcb, GhcbRax); + CcExitVmgSetOffsetValid (Ghcb, GhcbRax); =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_DR7_WRITE, 0, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_DR7_WRITE, 0, 0); if (Status !=3D 0) { return Status; } @@ -2243,7 +2243,7 @@ InternalVmgExitHandleVc ( =20 Regs =3D SystemContext.SystemContextX64; =20 - VmgInit (Ghcb, &InterruptState); + CcExitVmgInit (Ghcb, &InterruptState); =20 ExitCode =3D Regs->ExceptionData; switch (ExitCode) { @@ -2327,7 +2327,7 @@ InternalVmgExitHandleVc ( VcRet =3D EFI_PROTOCOL_ERROR; } =20 - VmgDone (Ghcb, InterruptState); + CcExitVmgDone (Ghcb, InterruptState); =20 return VcRet; } diff --git a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c b/OvmfPkg/Library/= CcExitLib/CcExitVeHandler.c index 08e92c66ce74..081af7e12aa5 100644 --- a/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c +++ b/OvmfPkg/Library/CcExitLib/CcExitVeHandler.c @@ -464,7 +464,7 @@ MmioExit ( **/ EFI_STATUS EFIAPI -VmTdExitHandleVe ( +CcExitHandleVe ( IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) diff --git a/OvmfPkg/Library/CcExitLib/PeiDxeCcExitVcHandler.c b/OvmfPkg/Li= brary/CcExitLib/PeiDxeCcExitVcHandler.c index bb718161f588..522f747f08c1 100644 --- a/OvmfPkg/Library/CcExitLib/PeiDxeCcExitVcHandler.c +++ b/OvmfPkg/Library/CcExitLib/PeiDxeCcExitVcHandler.c @@ -33,7 +33,7 @@ **/ EFI_STATUS EFIAPI -VmgExitHandleVc ( +CcExitHandleVc ( IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) diff --git a/OvmfPkg/Library/CcExitLib/SecCcExitVcHandler.c b/OvmfPkg/Libra= ry/CcExitLib/SecCcExitVcHandler.c index 769e0b5b7417..da70581af8d8 100644 --- a/OvmfPkg/Library/CcExitLib/SecCcExitVcHandler.c +++ b/OvmfPkg/Library/CcExitLib/SecCcExitVcHandler.c @@ -33,7 +33,7 @@ **/ EFI_STATUS EFIAPI -VmgExitHandleVc ( +CcExitHandleVc ( IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) diff --git a/OvmfPkg/PlatformPei/AmdSev.c b/OvmfPkg/PlatformPei/AmdSev.c index 80a1194ffcb9..e1b9fd9b7f68 100644 --- a/OvmfPkg/PlatformPei/AmdSev.c +++ b/OvmfPkg/PlatformPei/AmdSev.c @@ -50,7 +50,7 @@ AmdSevSnpInitialize ( } =20 // - // Query the hypervisor feature using the VmgExit and set the value in t= he + // Query the hypervisor feature using the CcExitVmgExit and set the valu= e in the // hypervisor features PCD. // HvFeatures =3D GetHypervisorFeature (); @@ -129,19 +129,19 @@ GetHypervisorFeature ( // // Initialize the GHCB // - VmgInit (Ghcb, &InterruptState); + CcExitVmgInit (Ghcb, &InterruptState); =20 // // Query the Hypervisor Features. // - Status =3D VmgExit (Ghcb, SVM_EXIT_HYPERVISOR_FEATURES, 0, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_HYPERVISOR_FEATURES, 0, 0); if ((Status !=3D 0)) { SevEsProtocolFailure (GHCB_TERMINATE_GHCB_GENERAL); } =20 Features =3D Ghcb->SaveArea.SwExitInfo2; =20 - VmgDone (Ghcb, InterruptState); + CcExitVmgDone (Ghcb, InterruptState); =20 return Features; } diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c b/OvmfPk= g/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c index 58bcad825d57..d57f7ca25ccf 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c @@ -82,12 +82,12 @@ QemuFlashPtrWrite ( // #VC exception. Instead, use the VMGEXIT MMIO write support directly // to perform the update. // - VmgInit (Ghcb, &InterruptState); + CcExitVmgInit (Ghcb, &InterruptState); Ghcb->SharedBuffer[0] =3D Value; Ghcb->SaveArea.SwScratch =3D (UINT64)(UINTN)Ghcb->SharedBuffer; - VmgSetOffsetValid (Ghcb, GhcbSwScratch); - VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, PhysAddr, 1); - VmgDone (Ghcb, InterruptState); + CcExitVmgSetOffsetValid (Ghcb, GhcbSwScratch); + CcExitVmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, PhysAddr, 1); + CcExitVmgDone (Ghcb, InterruptState); } else { *Ptr =3D Value; } diff --git a/UefiCpuPkg/Include/Library/CcExitLib.h b/UefiCpuPkg/Include/Li= brary/CcExitLib.h index 1ae618c19b9e..3381d583691f 100644 --- a/UefiCpuPkg/Include/Library/CcExitLib.h +++ b/UefiCpuPkg/Include/Library/CcExitLib.h @@ -41,7 +41,7 @@ **/ UINT64 EFIAPI -VmgExit ( +CcExitVmgExit ( IN OUT GHCB *Ghcb, IN UINT64 ExitCode, IN UINT64 ExitInfo1, @@ -56,12 +56,12 @@ VmgExit ( =20 @param[in, out] Ghcb A pointer to the GHCB @param[in, out] InterruptState A pointer to hold the current interrupt - state, used for restoring in VmgDone () + state, used for restoring in CcExitVmgD= one () =20 **/ VOID EFIAPI -VmgInit ( +CcExitVmgInit ( IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState ); @@ -79,7 +79,7 @@ VmgInit ( **/ VOID EFIAPI -VmgDone ( +CcExitVmgDone ( IN OUT GHCB *Ghcb, IN BOOLEAN InterruptState ); @@ -96,7 +96,7 @@ VmgDone ( **/ VOID EFIAPI -VmgSetOffsetValid ( +CcExitVmgSetOffsetValid ( IN OUT GHCB *Ghcb, IN GHCB_REGISTER Offset ); @@ -116,7 +116,7 @@ VmgSetOffsetValid ( **/ BOOLEAN EFIAPI -VmgIsOffsetValid ( +CcExitVmgIsOffsetValid ( IN GHCB *Ghcb, IN GHCB_REGISTER Offset ); @@ -142,7 +142,7 @@ VmgIsOffsetValid ( **/ EFI_STATUS EFIAPI -VmgExitHandleVc ( +CcExitHandleVc ( IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ); @@ -168,7 +168,7 @@ VmgExitHandleVc ( **/ EFI_STATUS EFIAPI -VmTdExitHandleVe ( +CcExitHandleVe ( IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ); diff --git a/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c b/UefiCpuPkg/= Library/CcExitLibNull/CcExitLibNull.c index 79eca74e138f..230e50705b4a 100644 --- a/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c +++ b/UefiCpuPkg/Library/CcExitLibNull/CcExitLibNull.c @@ -35,7 +35,7 @@ **/ UINT64 EFIAPI -VmgExit ( +CcExitVmgExit ( IN OUT GHCB *Ghcb, IN UINT64 ExitCode, IN UINT64 ExitInfo1, @@ -60,12 +60,12 @@ VmgExit ( =20 @param[in, out] Ghcb A pointer to the GHCB @param[in, out] InterruptState A pointer to hold the current interrupt - state, used for restoring in VmgDone () + state, used for restoring in CcExitVmgD= one () =20 **/ VOID EFIAPI -VmgInit ( +CcExitVmgInit ( IN OUT GHCB *Ghcb, IN OUT BOOLEAN *InterruptState ) @@ -85,7 +85,7 @@ VmgInit ( **/ VOID EFIAPI -VmgDone ( +CcExitVmgDone ( IN OUT GHCB *Ghcb, IN BOOLEAN InterruptState ) @@ -104,7 +104,7 @@ VmgDone ( **/ VOID EFIAPI -VmgSetOffsetValid ( +CcExitVmgSetOffsetValid ( IN OUT GHCB *Ghcb, IN GHCB_REGISTER Offset ) @@ -126,7 +126,7 @@ VmgSetOffsetValid ( **/ BOOLEAN EFIAPI -VmgIsOffsetValid ( +CcExitVmgIsOffsetValid ( IN GHCB *Ghcb, IN GHCB_REGISTER Offset ) @@ -155,7 +155,7 @@ VmgIsOffsetValid ( **/ EFI_STATUS EFIAPI -VmgExitHandleVc ( +CcExitHandleVc ( IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) @@ -183,7 +183,7 @@ VmgExitHandleVc ( **/ EFI_STATUS EFIAPI -VmTdExitHandleVe ( +CcExitHandleVe ( IN OUT EFI_EXCEPTION_TYPE *ExceptionType, IN OUT EFI_SYSTEM_CONTEXT SystemContext ) diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuExceptio= n.c b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c index 2b6d9da5c713..748cf8d3bfc6 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/PeiDxeSmmCpuException.c @@ -40,7 +40,7 @@ CommonExceptionHandlerWorker ( // On other - ExceptionType contains (possibly new) exception // value // - Status =3D VmgExitHandleVc (&ExceptionType, SystemContext); + Status =3D CcExitHandleVc (&ExceptionType, SystemContext); if (!EFI_ERROR (Status)) { return; } @@ -57,7 +57,7 @@ CommonExceptionHandlerWorker ( // On other - ExceptionType contains (possibly new) exception // value // - Status =3D VmTdExitHandleVe (&ExceptionType, SystemContext); + Status =3D CcExitHandleVe (&ExceptionType, SystemContext); if (!EFI_ERROR (Status)) { return; } diff --git a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c= b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c index 0a9ea79f52dc..497cd1649930 100644 --- a/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c +++ b/UefiCpuPkg/Library/CpuExceptionHandlerLib/SecPeiCpuException.c @@ -39,7 +39,7 @@ CommonExceptionHandler ( // On other - ExceptionType contains (possibly new) exception // value // - Status =3D VmgExitHandleVc (&ExceptionType, SystemContext); + Status =3D CcExitHandleVc (&ExceptionType, SystemContext); if (!EFI_ERROR (Status)) { return; } @@ -57,7 +57,7 @@ CommonExceptionHandler ( // On other - ExceptionType contains (possibly new) exception // value // - Status =3D VmTdExitHandleVe (&ExceptionType, SystemContext); + Status =3D CcExitHandleVe (&ExceptionType, SystemContext); if (!EFI_ERROR (Status)) { return; } diff --git a/UefiCpuPkg/Library/MpInitLib/AmdSev.c b/UefiCpuPkg/Library/MpI= nitLib/AmdSev.c index 2dd8f4d74621..ca9bfed7f3b1 100644 --- a/UefiCpuPkg/Library/MpInitLib/AmdSev.c +++ b/UefiCpuPkg/Library/MpInitLib/AmdSev.c @@ -209,7 +209,7 @@ SevEsPlaceApHlt ( Msr.GhcbPhysicalAddress =3D AsmReadMsr64 (MSR_SEV_ES_GHCB); Ghcb =3D Msr.Ghcb; =20 - VmgInit (Ghcb, &InterruptState); + CcExitVmgInit (Ghcb, &InterruptState); =20 if (DoDecrement) { DoDecrement =3D FALSE; @@ -221,13 +221,13 @@ SevEsPlaceApHlt ( InterlockedDecrement ((UINT32 *)&CpuMpData->MpCpuExchangeInfo->NumAp= sExecuting); } =20 - Status =3D VmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0); + Status =3D CcExitVmgExit (Ghcb, SVM_EXIT_AP_RESET_HOLD, 0, 0); if ((Status =3D=3D 0) && (Ghcb->SaveArea.SwExitInfo2 !=3D 0)) { - VmgDone (Ghcb, InterruptState); + CcExitVmgDone (Ghcb, InterruptState); break; } =20 - VmgDone (Ghcb, InterruptState); + CcExitVmgDone (Ghcb, InterruptState); } =20 // diff --git a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c b/UefiCpuPkg/Library/M= pInitLib/DxeMpLib.c index ef56af1f738b..a84e9e33bafa 100644 --- a/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/DxeMpLib.c @@ -222,9 +222,9 @@ GetSevEsAPMemory ( Msr.GhcbPhysicalAddress =3D AsmReadMsr64 (MSR_SEV_ES_GHCB); Ghcb =3D Msr.Ghcb; =20 - VmgInit (Ghcb, &InterruptState); - VmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddress); - VmgDone (Ghcb, InterruptState); + CcExitVmgInit (Ghcb, &InterruptState); + CcExitVmgExit (Ghcb, SVM_EXIT_AP_JUMP_TABLE, 0, (UINT64)(UINTN)StartAddr= ess); + CcExitVmgDone (Ghcb, InterruptState); =20 return (UINTN)StartAddress; } diff --git a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c b/UefiCpuPkg/Library= /MpInitLib/X64/AmdSev.c index 4c4f81af7c22..bfda1e19030d 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c +++ b/UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c @@ -150,16 +150,16 @@ SevSnpCreateSaveArea ( Msr.GhcbPhysicalAddress =3D AsmReadMsr64 (MSR_SEV_ES_GHCB); Ghcb =3D Msr.Ghcb; =20 - VmgInit (Ghcb, &InterruptState); + CcExitVmgInit (Ghcb, &InterruptState); Ghcb->SaveArea.Rax =3D SaveArea->SevFeatures; - VmgSetOffsetValid (Ghcb, GhcbRax); - VmgExitStatus =3D VmgExit ( + CcExitVmgSetOffsetValid (Ghcb, GhcbRax); + VmgExitStatus =3D CcExitVmgExit ( Ghcb, SVM_EXIT_SNP_AP_CREATION, ExitInfo1, ExitInfo2 ); - VmgDone (Ghcb, InterruptState); + CcExitVmgDone (Ghcb, InterruptState); =20 ASSERT (VmgExitStatus =3D=3D 0); if (VmgExitStatus !=3D 0) { --=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 (#96248): https://edk2.groups.io/g/devel/message/96248 Mute This Topic: https://groups.io/mt/94954287/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 Tue Apr 23 22:58:17 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+96249+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+96249+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1668151055; cv=none; d=zohomail.com; s=zohoarc; b=hNJPE0IwjmQOCOm5+WZskpT8Py4NkkzlIGd3DtzRlpfp+AjeM7D08wiJCz2rjrqBm1coQYVp4pIaS6t/5tHg78xS1YGjV+yqdNVwIXw82yUU5MW5ZSCkC+C79tdn/G4lbTSfozc6LlgUGTOb4+fhtRiN0iGiWOd31vsOVKaB8eU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1668151055; 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=2EpuDlMr1GgH9JmvbXxS6Fjxem20GWeyEjMUynldgSU=; b=gjvFo6cvBye6GPf40+dtP9j7ePTnK/P2C4XX/BJJ7qlmc5JBftuCxeianxiqhUMXMFF3IuuVEK4bUDuH3NCIg3sR2rxN/Y6SRXhjnO/CWE0z6bq+MQXrs9G5SQt3q32PjPdWQRb5moUKK+bNXQCDxkkTd2D3/6W5s1iMslZe1aY= 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+96249+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 1668151055748523.1434634648822; Thu, 10 Nov 2022 23:17:35 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 8QrEYY1788612xYzjM4tJrSt; Thu, 10 Nov 2022 23:17:35 -0800 X-Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mx.groups.io with SMTP id smtpd.web11.2924.1668151047526679574 for ; Thu, 10 Nov 2022 23:17:35 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="294901438" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="294901438" X-Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 23:17:34 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10527"; a="966732337" X-IronPort-AV: E=Sophos;i="5.96,156,1665471600"; d="scan'208";a="966732337" X-Received: from mxu9-mobl1.ccr.corp.intel.com ([10.255.29.36]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Nov 2022 23:17:32 -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 Subject: [edk2-devel] [PATCH V6 3/3] Maintainers: Update the VmgExitLib to CcExitLib Date: Fri, 11 Nov 2022 15:17:10 +0800 Message-Id: <20221111071710.1596-4-min.m.xu@intel.com> In-Reply-To: <20221111071710.1596-1-min.m.xu@intel.com> References: <20221111071710.1596-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: sBahmCadGiBtenCCStXRdyXLx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1668151055; bh=sSn1gYEJszyp50wTJ+P4Ai5WMsveCekYMRu0NZhXtVs=; h=Cc:Date:From:Reply-To:Subject:To; b=P/DGJg8gjeFHpNFb561Oo7QzdDoe3yltmuFtH50stoqwHtSjhfev+feSgB5nrwpZvr7 LKiu/zkAE4tLJ54qTaHkh/ZAuPvDoIWUSodfFmS/ZBeMef2YKU8Arzc24f1+Ee+hOjGTL kzYS6MEl3Ma/vFYHN/I88r1CjQge14wMCOY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1668151057687100008 Content-Type: text/plain; charset="utf-8" From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4123 VmgExitLib is renamed as CcExitLib. 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: Michael D Kinney Signed-off-by: Min Xu --- Maintainers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Maintainers.txt b/Maintainers.txt index a2727fa7bd42..7e98083685bc 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -481,7 +481,7 @@ F: OvmfPkg/Include/Library/MemEncryptSevLib.h F: OvmfPkg/IoMmuDxe/AmdSevIoMmu.* F: OvmfPkg/Library/BaseMemEncryptSevLib/ F: OvmfPkg/Library/PlatformBootManagerLibGrub/ -F: OvmfPkg/Library/VmgExitLib/ +F: OvmfPkg/Library/CcExitLib/ F: OvmfPkg/PlatformPei/AmdSev.c F: OvmfPkg/ResetVector/ F: OvmfPkg/Sec/ --=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 (#96249): https://edk2.groups.io/g/devel/message/96249 Mute This Topic: https://groups.io/mt/94954288/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-