From: "Min Xu" <min.m.xu@intel.com>
To: devel@edk2.groups.io
Cc: Min M Xu <min.m.xu@intel.com>,
Ard Biesheuvel <ardb+tianocore@kernel.org>,
Erdem Aktas <erdemaktas@google.com>,
James Bottomley <jejb@linux.ibm.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: [PATCH V1 1/2] OvmfPkg/AcpiPlatformDxe: Check PcdConfidentialComputingGuestAttr
Date: Thu, 22 Dec 2022 21:11:55 +0800 [thread overview]
Message-ID: <20221222131156.411-2-min.m.xu@intel.com> (raw)
In-Reply-To: <20221222131156.411-1-min.m.xu@intel.com>
From: Min M Xu <min.m.xu@intel.com>
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 <ardb+tianocore@kernel.org>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
---
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 <OvmfPlatforms.h> // CLOUDHV_DEVICE_ID
-
-#include <Library/CcProbeLib.h> // CcProbe(), CcGuestTypeIntelTdx
-
+#include <ConfidentialComputingGuestAttr.h>
#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
next prev parent reply other threads:[~2022-12-22 13:12 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-22 13:11 [PATCH V1 0/2] Check PcdConfidentialComputingGuestAttr in AcpiPlatformDxe Min Xu
2022-12-22 13:11 ` Min Xu [this message]
2022-12-22 13:11 ` [PATCH V1 2/2] ArmVirtPkg: Remove CcProbeLib from ArmVirtQemu.dsc Min Xu
2022-12-22 13:20 ` [PATCH V1 0/2] Check PcdConfidentialComputingGuestAttr in AcpiPlatformDxe Ard Biesheuvel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221222131156.411-2-min.m.xu@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox