From: "Min Xu" <min.m.xu@intel.com>
To: devel@edk2.groups.io
Cc: Min Xu <min.m.xu@intel.com>, Gerd Hoffmann <kraxel@redhat.com>,
Erdem Aktas <erdemaktas@google.com>,
James Bottomley <jejb@linux.ibm.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Tom Lendacky <thomas.lendacky@amd.com>,
Yuan Yu <yuanyu@google.com>
Subject: [PATCH 0/2] Re-design CcProbeLib
Date: Thu, 7 Jul 2022 14:17:44 +0800 [thread overview]
Message-ID: <cover.1657174304.git.min.m.xu@intel.com> (raw)
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3974
CcProbeLib once was designed to probe the Confidential Computing guest
type by checking the PcdOvmfWorkArea. But this memory is allocated with
either EfiACPIMemoryNVS or EfiBootServicesData. It cannot be accessed
after ExitBootService. Please see the detailed analysis in BZ#3974.
To fix this issue, CcProbeLib is re-designed as 2 implementation:
- SecPeiCcProbeLib
- CcProbeLib
In SecPeiCcProbeLib we still check the CC guest type by reading the
PcdOvmfWorkArea. Because it is used in SEC / PEI and we don't worry about
the issues in BZ#3974.
In CcProbeLib we call TdIsEnabled() to check if it is of Tdx guest. To
improve the efficiency the result is cached in a global variable. In
current stage only the Tdx related code is added in CcProbeLib. SEV code
may be added in the future.
The reason why we probe CC guest type in 2 different ways is the global
varialbe. Global variable cannot be used in SEC/PEI and CcProbe is called
very frequently.
Code: https://github.com/mxu9/edk2/tree/CcProbeLib.BZ3974.v1
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Erdem Aktas <erdemaktas@google.com>
Cc: James Bottomley <jejb@linux.ibm.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Yuan Yu <yuanyu@google.com>
Signed-off-by: Min Xu <min.m.xu@intel.com>
Min M Xu (2):
OvmfPkg: Add SecPeiCcProbeLib
OvmfPkg: Update CcProbeLib
OvmfPkg/IntelTdx/IntelTdxX64.dsc | 1 +
OvmfPkg/Library/CcProbeLib/CcProbeLib.c | 24 +++++++++++---
OvmfPkg/Library/CcProbeLib/CcProbeLib.inf | 5 +--
OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.c | 31 +++++++++++++++++++
.../Library/CcProbeLib/SecPeiCcProbeLib.inf | 25 +++++++++++++++
OvmfPkg/OvmfPkgX64.dsc | 3 ++
6 files changed, 81 insertions(+), 8 deletions(-)
create mode 100644 OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.c
create mode 100644 OvmfPkg/Library/CcProbeLib/SecPeiCcProbeLib.inf
--
2.29.2.windows.2
next reply other threads:[~2022-07-07 6:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-07 6:17 Min Xu [this message]
2022-07-07 6:17 ` [PATCH 1/2] OvmfPkg: Add SecPeiCcProbeLib Min Xu
2022-07-07 6:17 ` [PATCH 2/2] OvmfPkg: Update CcProbeLib Min Xu
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=cover.1657174304.git.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