From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web11.45149.1671714738764023628 for ; Thu, 22 Dec 2022 05:12:20 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=ep4Nx4gy; spf=pass (domain: intel.com, ip: 134.134.136.100, 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=1671714740; x=1703250740; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=WajTVrvXUkA8avlW3Njio/Wis0PNy8tQzn2duPkTHLU=; b=ep4Nx4gyQKdjxuv9aqUKXH/DlwIXR2LZqmKi3e45UfppKAqmtX83NPbA Bn0KPamNCXQV7RWLgqzmWAg5JKaht2ZUpfnOgUhRdBi0luR0WUoM7Gj+t t3ioncAmNdkai4w+Z7nrNRy96NJYCf7kWIUZHnqsUG86a5wcJjFRmXbai MclRqlkXwrAI2g0x+OVikQrWpoTMrUGkAgSNTFemdmKvyd0YX18mT3dB5 tbAgtA/2yzu8aaDdXkNsXoS6xiFl4yXQx32sbKKCLDqWm1nZsoPc37vp+ +bLyrPLtdDThN/nVYABNphkDbFz2Iitvo3fWnGaXkNmwep7wbarPVs8Mt w==; X-IronPort-AV: E=McAfee;i="6500,9779,10568"; a="384475580" X-IronPort-AV: E=Sophos;i="5.96,265,1665471600"; d="scan'208";a="384475580" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 05:12:19 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10568"; a="758941370" X-IronPort-AV: E=Sophos;i="5.96,265,1665471600"; d="scan'208";a="758941370" Received: from mxu9-mobl1.ccr.corp.intel.com ([10.249.172.37]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Dec 2022 05:12:17 -0800 From: "Min Xu" To: devel@edk2.groups.io Cc: Min M Xu , Ard Biesheuvel , Erdem Aktas , James Bottomley , Jiewen Yao , Gerd Hoffmann , Tom Lendacky Subject: [PATCH V1 1/2] OvmfPkg/AcpiPlatformDxe: Check PcdConfidentialComputingGuestAttr Date: Thu, 22 Dec 2022 21:11:55 +0800 Message-Id: <20221222131156.411-2-min.m.xu@intel.com> X-Mailer: git-send-email 2.29.2.windows.2 In-Reply-To: <20221222131156.411-1-min.m.xu@intel.com> References: <20221222131156.411-1-min.m.xu@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Min M Xu PcdConfidentialComputingGuestAttr can be used to check the cc guest type, including td-guest or sev-guest. CcProbe() can do the same thing but CcProbeLib should be included in the dsc which uses AcpiPlatformDxe. The difference between PcdConfidentialComputingGuestAttr and CcProbe() is that PcdConfidentialComputingGuestAttr cannot be used in multi-processor scenario but CcProbe() can. But there is no such issue in AcpiPlatformDxe. So we use PcdConfidentialComputingGuestAttr instead of CcProbeLib so that it is simpler. Cc: Ard Biesheuvel Cc: Erdem Aktas Cc: James Bottomley Cc: Jiewen Yao Cc: Gerd Hoffmann Cc: Tom Lendacky Signed-off-by: Min Xu --- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 6 ++---- OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c index 0cc3d958bed4..b446bb487234 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -8,9 +8,7 @@ **/ #include // CLOUDHV_DEVICE_ID - -#include // CcProbe(), CcGuestTypeIntelTdx - +#include #include "AcpiPlatform.h" /** @@ -35,7 +33,7 @@ InstallAcpiTables ( HostBridgeDevId = PcdGet16 (PcdOvmfHostBridgePciDevId); if (HostBridgeDevId == CLOUDHV_DEVICE_ID) { - if (CcProbe () == CcGuestTypeIntelTdx) { + if (CC_GUEST_IS_TDX (PcdGet64 (PcdConfidentialComputingGuestAttr))) { Status = InstallCloudHvTablesTdx (AcpiTable); } else { Status = InstallCloudHvTables (AcpiTable); diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf index 1647a90add8b..8939dde42549 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -46,7 +46,6 @@ UefiBootServicesTableLib UefiDriverEntryPoint HobLib - CcProbeLib [Protocols] gEfiAcpiTableProtocolGuid # PROTOCOL ALWAYS_CONSUMED @@ -62,6 +61,7 @@ gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtr gUefiOvmfPkgTokenSpaceGuid.PcdXenPvhStartOfDayStructPtrSize + gEfiMdePkgTokenSpaceGuid.PcdConfidentialComputingGuestAttr [Depex] gEfiAcpiTableProtocolGuid -- 2.29.2.windows.2