From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web11.2875.1667870096464222463 for ; Mon, 07 Nov 2022 17:14:56 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=dCFu23a9; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: min.m.xu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1667870096; x=1699406096; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=gRl0/stqMjTV8XXHOmTcyoP4e3hKz10JsJJkt69Fh8E=; b=dCFu23a9pLRuRGr+jM+/5NmyKJh+drlmVVJa41aklwnCCU6pAP5bNIJu m12Aw5uHeMAavMouRt+qj2x1HYZlez7+98agxkNW5qo2jvLAF1t2X1zl5 Xdz9cyg7YKTmw6b7huR1Jaad8srhBGqasg4ce2uEkPYGiju6hUysGdHSa lK0PanWwYePhQvkWcsFR4PMdzK4qnw+l1dwT0jPlFWCESmUsbelXCqI72 YkYXRPPq7ugoHnAcZJ1AmLDfX1937tn10wUmyMVvPVCb2PSV1ew1QbdLC QTu/cSqE6t6J/iUoO7N8hGKFnwu3m4kMEV6wL2JbNGJH//sbL5QCV/X72 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="308191271" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="308191271" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 17:14:56 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10524"; a="761306374" X-IronPort-AV: E=Sophos;i="5.96,145,1665471600"; d="scan'208";a="761306374" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.238.0.61]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2022 17:14:52 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , Gerd Hoffmann , James Bottomley , Jiewen Yao , Tom Lendacky , Guo Dong , Sean Rhodes , James Lu , Gua Guo , Michael D Kinney , Liming Gao Subject: [PATCH V4 0/3] Rename VmgExitLib to CcExitLib Date: Tue, 8 Nov 2022 09:14:37 +0800 Message-Id: <20221108011440.1750-1-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4123 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-set renames VmgExitLib to CcExitLib (Cc means Confidential Computing). This is simple renaming and there is no logic changes. Then APIs defined in CcExitLib.h are added with a CcExit prefix. This is to make the name more meaningful. Code: https://github.com/mxu9/edk2/tree/CcExitLib.v4 v4 changes: - The previous versions of the patch-set are to first duplicate a new CcExitLib then delete the old VmgExitLib. According to this comments https://edk2.groups.io/g/devel/message/96019 it suggests renaming in a single patch is better. - Lib APIs are added with CcExit prefix, not CcExitLib prefix. v3 changes: - Rename CcExitHandleVc / CcExitHandleVe to CcExitLibHandleVc / CcExitLibHandleVe to make the nameing consistent. - Update the CcExitLib to merge the patch eff44c008d99 (OvmfPkg/VmgExitLig: HALT on #VE when access to private memory). v2 changes: - Patch #3 is added to import CcExitLib in OvmfPkg's *.dsc. This is to prevent the building from being broken in the following patches. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: Gerd Hoffmann Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Guo Dong Cc: Sean Rhodes Cc: James Lu Cc: Gua Guo Cc: Michael D Kinney Cc: Liming Gao Reviewed-by: Jiewen Yao Signed-off-by: Min Xu Min M Xu (3): OvmfPkg/UefiCpuPkg/UefiPayloadPkg: Rename VmgExitLib to CcExitLib OvmfPkg/UefiCpuPkg: Add CcExit prefix to the APIs of CcExitLib Maintainers: Update the VmgExitLib to CcExitLib Maintainers.txt | 2 +- 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 | 10 +- .../VmgExitLib.c => CcExitLib/CcExitLib.c} | 23 ++-- .../CcExitLib.inf} | 17 +-- .../CcExitTd.h} | 4 +- .../CcExitVcHandler.c} | 129 +++++++++--------- .../CcExitVcHandler.h} | 6 +- .../CcExitVeHandler.c} | 6 +- .../PeiDxeCcExitVcHandler.c} | 6 +- .../SecCcExitLib.inf} | 14 +- .../SecCcExitVcHandler.c} | 6 +- .../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 | 10 +- OvmfPkg/PlatformPei/PlatformPei.inf | 2 +- .../FvbServicesRuntimeDxe.inf | 2 +- .../QemuFlashDxe.c | 10 +- .../Library/{VmgExitLib.h => CcExitLib.h} | 29 ++-- .../CcExitLibNull.c} | 47 +++++-- .../CcExitLibNull.inf} | 12 +- .../Library/CcExitLibNull/CcExitLibNull.uni | 14 ++ .../DxeCpuExceptionHandlerLib.inf | 2 +- .../PeiCpuExceptionHandlerLib.inf | 2 +- .../PeiDxeSmmCpuException.c | 6 +- .../SecPeiCpuException.c | 6 +- .../SecPeiCpuExceptionHandlerLib.inf | 2 +- .../SmmCpuExceptionHandlerLib.inf | 2 +- .../Xcode5SecPeiCpuExceptionHandlerLib.inf | 2 +- UefiCpuPkg/Library/MpInitLib/AmdSev.c | 10 +- UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 2 +- UefiCpuPkg/Library/MpInitLib/DxeMpLib.c | 8 +- UefiCpuPkg/Library/MpInitLib/MpLib.c | 2 +- UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 2 +- UefiCpuPkg/Library/MpInitLib/X64/AmdSev.c | 10 +- .../Library/VmgExitLibNull/VmTdExitNull.c | 38 ------ .../Library/VmgExitLibNull/VmgExitLibNull.uni | 15 -- UefiCpuPkg/UefiCpuPkg.dec | 4 +- UefiCpuPkg/UefiCpuPkg.dsc | 4 +- UefiPayloadPkg/UefiPayloadPkg.dsc | 2 +- 50 files changed, 252 insertions(+), 258 deletions(-) rename OvmfPkg/Library/{VmgExitLib/VmgExitLib.c => CcExitLib/CcExitLib.c} (89%) rename OvmfPkg/Library/{VmgExitLib/VmgExitLib.inf => CcExitLib/CcExitLib.inf} (66%) rename OvmfPkg/Library/{VmgExitLib/VmTdExitHandler.h => CcExitLib/CcExitTd.h} (86%) rename OvmfPkg/Library/{VmgExitLib/VmgExitVcHandler.c => CcExitLib/CcExitVcHandler.c} (90%) rename OvmfPkg/Library/{VmgExitLib/VmgExitVcHandler.h => CcExitLib/CcExitVcHandler.h} (89%) rename OvmfPkg/Library/{VmgExitLib/VmTdExitVeHandler.c => CcExitLib/CcExitVeHandler.c} (95%) rename OvmfPkg/Library/{VmgExitLib/PeiDxeVmgExitVcHandler.c => CcExitLib/PeiDxeCcExitVcHandler.c} (93%) rename OvmfPkg/Library/{VmgExitLib/SecVmgExitLib.inf => CcExitLib/SecCcExitLib.inf} (79%) rename OvmfPkg/Library/{VmgExitLib/SecVmgExitVcHandler.c => CcExitLib/SecCcExitVcHandler.c} (93%) rename OvmfPkg/Library/{VmgExitLib => CcExitLib}/X64/TdVmcallCpuid.nasm (100%) rename UefiCpuPkg/Include/Library/{VmgExitLib.h => CcExitLib.h} (87%) rename UefiCpuPkg/Library/{VmgExitLibNull/VmgExitLibNull.c => CcExitLibNull/CcExitLibNull.c} (76%) rename UefiCpuPkg/Library/{VmgExitLibNull/VmgExitLibNull.inf => CcExitLibNull/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 -- 2.29.2.windows.2