From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web11.5722.1651887402613426917 for ; Fri, 06 May 2022 18:36:43 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=P58i42D0; spf=pass (domain: intel.com, ip: 192.55.52.120, 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=1651887402; x=1683423402; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=3+H27bSLBBbv9ok6kaWcz8PjFGayqUlP6Sl+exj+s1k=; b=P58i42D0xgh/9LVo0DbhGReu3IMnAPBy+wWgfhO+3LMFAcwYVpFZ1HR7 Dou//NEzk66kLVWsPBJkDQv7e+odWkd2mYOB6GY9nCDg1nCNfUWZhcx5o xz1/ZZnnijIcYxaMLh0jpCJx/5P5SJrUWwDzKDhFvyt21b11hmkJXqhwc TWMXE5FDPlnKtMI/RoiVTfd5QgivN0kZLv6dK5dPZ1J7ighB/TksFA5Qo ZvYeEnCUdUe2rIEjLF/ewXgdCrh31c/QHm4/FfuepfpimPj8t8cVktpXM 243fxGsvd+9IvkWLCltMl/V2nK00C3qzYg0SiEYz3ZVX04yHiaAbftSNG g==; X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267463886" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267463886" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:42 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="538142959" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.52]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 May 2022 18:36:39 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [PATCH V2 0/6] Support 2 CpuMpPei/CpuDxe in One image Date: Sat, 7 May 2022 09:36:17 +0800 Message-Id: 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=3918 Above BZ reports an issue that commit 88da06ca triggers ASSERT in some scenario. This patch-set is to fix this issue. As commit 88da06ca describes TDVF BSP and APs are simplied and it can simply use MpInitLibUp instead of MpInitLib. To achieve this goal, we include 2 CpuMpPei/CpuDxe drivers in OvmfPkgX64 and IntelTdxX64. This is done by setting different FILE_GUID to these drivers (of the same name). In the other hand, we import a set of MpInitLibDepLib. These libs simply depend on the PPI/Protocols. While these PPI/Protocols are installed according to the guest type. This patch-set is a replacement of https://edk2.groups.io/g/devel/message/89381. Please see the dicussion in - https://edk2.groups.io/g/devel/message/89382 - https://edk2.groups.io/g/devel/message/89455 - https://edk2.groups.io/g/devel/message/89522 - https://edk2.groups.io/g/devel/message/89535 The code is at: https://github.com/mxu9/edk2/tree/Rework-MpInitLib.v2 v2 changes: - Remove the un-used FILE_GUID definitions. - Delete un-used EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST in DispatchTable. - Add more comments. Cc: Eric Dong Cc: Ray Ni Cc: Brijesh Singh Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Tom Lendacky Cc: Gerd Hoffmann Signed-off-by: Min Xu Min M Xu (4): UefiCpuPkg: Revert "UefiCpuPkg: Enable Tdx support in MpInitLib" OvmfPkg/Sec: Install MpInitLibDepLib PPIs in SecMain.c OvmfPkg/TdxDxe: Install MpInitLibDepLib protocols OvmfPkg: Enable 2 different CpuMpPei and CpuDxe drivers Min Xu (2): OvmfPkg: Add MpInitLibDepLib related PPI/Protocol definitions OvmfPkg: Add MpInitLibDepLib OvmfPkg/Include/Ppi/MpInitLibDep.h | 28 +++++ .../Include/Protocol/MpInitLibDepProtocols.h | 28 +++++ OvmfPkg/IntelTdx/IntelTdxX64.dsc | 30 ++++- OvmfPkg/IntelTdx/IntelTdxX64.fdf | 3 + .../MpInitLibDepLib/DxeMpInitLibMpDepLib.inf | 27 +++++ .../MpInitLibDepLib/DxeMpInitLibUpDepLib.inf | 27 +++++ .../Library/MpInitLibDepLib/MpInitLibDepLib.c | 23 ++++ .../MpInitLibDepLib/PeiMpInitLibMpDepLib.inf | 27 +++++ .../MpInitLibDepLib/PeiMpInitLibUpDepLib.inf | 27 +++++ OvmfPkg/OvmfPkg.dec | 5 + OvmfPkg/OvmfPkgX64.dsc | 55 ++++++++- OvmfPkg/OvmfPkgX64.fdf | 4 + OvmfPkg/Sec/SecMain.c | 34 +++++- OvmfPkg/Sec/SecMain.inf | 2 + OvmfPkg/TdxDxe/TdxDxe.c | 22 +++- OvmfPkg/TdxDxe/TdxDxe.inf | 2 + UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf | 3 - UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h | 69 ------------ UefiCpuPkg/Library/MpInitLib/MpLib.c | 63 +---------- UefiCpuPkg/Library/MpInitLib/MpLibTdx.c | 106 ------------------ UefiCpuPkg/Library/MpInitLib/MpLibTdxNull.c | 69 ------------ UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf | 3 - 22 files changed, 343 insertions(+), 314 deletions(-) create mode 100644 OvmfPkg/Include/Ppi/MpInitLibDep.h create mode 100644 OvmfPkg/Include/Protocol/MpInitLibDepProtocols.h create mode 100644 OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf create mode 100644 OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf create mode 100644 OvmfPkg/Library/MpInitLibDepLib/MpInitLibDepLib.c create mode 100644 OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibMpDepLib.inf create mode 100644 OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibUpDepLib.inf delete mode 100644 UefiCpuPkg/Library/MpInitLib/MpIntelTdx.h delete mode 100644 UefiCpuPkg/Library/MpInitLib/MpLibTdx.c delete mode 100644 UefiCpuPkg/Library/MpInitLib/MpLibTdxNull.c -- 2.29.2.windows.2