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:58 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=cm10jL68; 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=1651887418; x=1683423418; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=NI6VkwPOGZQry2FiuB7NYIhWR4vSq87/ugkot7eFUOw=; b=cm10jL68yhKvQwwAxJGlJQh4g2TjXrEiZBWwF1nX9cpboWbtzbkqkP1L XPz5PcYV2UydO3zxh+/Bvdqc40q+Dh9eQW7ME8mf/LL+TiL5IRdiG79cc L2z3Nspa0t8u9WL6tlBPTCjv73mQYv2cCcW1g6hw5KrUpq8tdRZXDM2mj JJvtZ8l0cpshkcHWRiCtCs4iHDUgbRYInoqrOJKoqDkF4KQLVVvA28Cbs ZjGeq0UdHpUIiC+X3C+24gs5go1V7QQAIFBUYZpPz8ECVpqjp9BHoWD97 js2fdP9eyvoDY0msjKzFz281gkvDjWICB5PnOF3zvMC3MJBD2qNve1NEv Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10339"; a="267464001" X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="267464001" 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:58 -0700 X-IronPort-AV: E=Sophos;i="5.91,205,1647327600"; d="scan'208";a="538143127" 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:55 -0700 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Eric Dong , Ray Ni , Brijesh Singh , Erdem Aktas , James Bottomley , Jiewen Yao , Tom Lendacky , Gerd Hoffmann Subject: [PATCH V2 6/6] OvmfPkg: Enable 2 different CpuMpPei and CpuDxe drivers Date: Sat, 7 May 2022 09:36:23 +0800 Message-Id: <32b1d34f0f3a5b2013b11f0b87845c8dc0b2af2e.1651885849.git.min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3918 In OvmfPkgX64 we enable 2 different CpuMpPei and CpuDxe drivers. The difference between the drivers is the MpInitLib or MpInitLibUp. This is acomplished by adding a MpInitLibDepLib. In IntelTdxX64 we enable 2 versions of CpuDxe drivers. It is because PEI is skipped in IntelTdxX64. 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 --- OvmfPkg/IntelTdx/IntelTdxX64.dsc | 30 ++++++++++++++++- OvmfPkg/IntelTdx/IntelTdxX64.fdf | 3 ++ OvmfPkg/OvmfPkgX64.dsc | 55 ++++++++++++++++++++++++++++++-- OvmfPkg/OvmfPkgX64.fdf | 4 +++ 4 files changed, 89 insertions(+), 3 deletions(-) diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc b/OvmfPkg/IntelTdx/IntelTdxX64.dsc index 73a6c30096a8..80c331ea233a 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc @@ -57,6 +57,11 @@ !endif !endif + # + # Define the FILE_GUID of CpuDxe for unique-processor version. + # + DEFINE UP_CPU_DXE_GUID = 6490f1c5-ebcc-4665-8892-0075b9bb49b7 + [BuildOptions] GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG @@ -550,7 +555,30 @@ MdeModulePkg/Universal/EbcDxe/EbcDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - UefiCpuPkg/CpuDxe/CpuDxe.inf + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + # + # Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which + # checks the Protocol of gEfiMpInitLibMpDepProtocolGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + FILE_GUID = $(UP_CPU_DXE_GUID) + + + # + # Directly use MpInitLibUp. It depends on DxeMpInitLibUpDepLib which + # checks the Protocol of gEfiMpInitLibUpDepProtocolGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf + } + OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.fdf b/OvmfPkg/IntelTdx/IntelTdxX64.fdf index 9e290ea78f61..1029916c3484 100644 --- a/OvmfPkg/IntelTdx/IntelTdxX64.fdf +++ b/OvmfPkg/IntelTdx/IntelTdxX64.fdf @@ -185,7 +185,10 @@ INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf + INF UefiCpuPkg/CpuDxe/CpuDxe.inf +INF FILE_GUID = $(UP_CPU_DXE_GUID) UefiCpuPkg/CpuDxe/CpuDxe.inf + INF OvmfPkg/LocalApicTimerDxe/LocalApicTimerDxe.inf INF OvmfPkg/IncompatiblePciDeviceSupportDxe/IncompatiblePciDeviceSupport.inf INF OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 45ffa2dbe35f..71526bba3183 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -72,6 +72,12 @@ !endif !endif + # + # Define the FILE_GUID of CpuMpPei/CpuDxe for unique-processor version. + # + DEFINE UP_CPU_PEI_GUID = 280251c4-1d09-4035-9062-839acb5f18c1 + DEFINE UP_CPU_DXE_GUID = 6490f1c5-ebcc-4665-8892-0075b9bb49b7 + [BuildOptions] GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG @@ -728,7 +734,29 @@ MdeModulePkg/Universal/Variable/Pei/VariablePei.inf OvmfPkg/SmmAccess/SmmAccessPei.inf !endif - UefiCpuPkg/CpuMpPei/CpuMpPei.inf + + UefiCpuPkg/CpuMpPei/CpuMpPei.inf { + + # + # Directly use PeiMpInitLib. It depends on PeiMpInitLibMpDepLib which + # checks the PPI of gEfiPeiMpInitLibMpDepPpiGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLib/PeiMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuMpPei/CpuMpPei.inf { + + FILE_GUID = $(UP_CPU_PEI_GUID) + + + # + # Directly use MpInitLibUp. It depends on PeiMpInitLibUpDepLib which + # checks the PPI of gEfiPeiMpInitLibUpDepPpiGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/PeiMpInitLibUpDepLib.inf + } !include OvmfPkg/OvmfTpmComponentsPei.dsc.inc @@ -760,7 +788,30 @@ MdeModulePkg/Universal/EbcDxe/EbcDxe.inf UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf - UefiCpuPkg/CpuDxe/CpuDxe.inf + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + # + # Directly use DxeMpInitLib. It depends on DxeMpInitLibMpDepLib which + # checks the Protocol of gEfiMpInitLibMpDepProtocolGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLib/DxeMpInitLib.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibMpDepLib.inf + } + + UefiCpuPkg/CpuDxe/CpuDxe.inf { + + FILE_GUID = $(UP_CPU_DXE_GUID) + + + # + # Directly use MpInitLibUp. It depends on DxeMpInitLibUpDepLib which + # checks the Protocol of gEfiMpInitLibUpDepProtocolGuid. + # + MpInitLib|UefiCpuPkg/Library/MpInitLibUp/MpInitLibUp.inf + NULL|OvmfPkg/Library/MpInitLibDepLib/DxeMpInitLibUpDepLib.inf + } + !ifdef $(CSM_ENABLE) OvmfPkg/8259InterruptControllerDxe/8259.inf OvmfPkg/8254TimerDxe/8254Timer.inf diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index 6e72cdf3453e..aa9a83032d9b 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -185,6 +185,7 @@ INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf INF OvmfPkg/SmmAccess/SmmAccessPei.inf !endif INF UefiCpuPkg/CpuMpPei/CpuMpPei.inf +INF FILE_GUID = $(UP_CPU_PEI_GUID) UefiCpuPkg/CpuMpPei/CpuMpPei.inf !include OvmfPkg/OvmfTpmPei.fdf.inc @@ -239,7 +240,10 @@ INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf INF MdeModulePkg/Universal/EbcDxe/EbcDxe.inf INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf + INF UefiCpuPkg/CpuDxe/CpuDxe.inf +INF FILE_GUID = $(UP_CPU_DXE_GUID) UefiCpuPkg/CpuDxe/CpuDxe.inf + !ifdef $(CSM_ENABLE) INF OvmfPkg/8259InterruptControllerDxe/8259.inf INF OvmfPkg/8254TimerDxe/8254Timer.inf -- 2.29.2.windows.2