From: "Yao, Jiewen" <jiewen.yao@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>,
"Xu, Min M" <min.m.xu@intel.com>
Cc: Brijesh Singh <brijesh.singh@amd.com>,
"Aktas, Erdem" <erdemaktas@google.com>,
James Bottomley <jejb@linux.ibm.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [edk2-devel] [PATCH] OvmfPkg: Set PciLib for TdxDxe driver
Date: Tue, 19 Apr 2022 02:07:54 +0000 [thread overview]
Message-ID: <MW4PR11MB58721CC169A15ED16A5F270F8CF29@MW4PR11MB5872.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220419015828.899-1-min.m.xu@intel.com>
Hi
If TdxDxe breaks SEV, should we skip the TdxDxe in SEV path?
I don't understand why we need use Cfg8.
Thank you
Yao Jiewen
> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Min Xu
> Sent: Tuesday, April 19, 2022 9:58 AM
> To: devel@edk2.groups.io
> Cc: Xu, Min M <min.m.xu@intel.com>; Brijesh Singh <brijesh.singh@amd.com>;
> Aktas, Erdem <erdemaktas@google.com>; James Bottomley
> <jejb@linux.ibm.com>; Yao, Jiewen <jiewen.yao@intel.com>; Tom Lendacky
> <thomas.lendacky@amd.com>
> Subject: [edk2-devel] [PATCH] OvmfPkg: Set PciLib for TdxDxe driver
>
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3904
>
> TdxDxe driver is introduced for Intel TDX feature. Unfortunately, this
> driver also breaks boot process in SEV-ES guest. The root cause is in
> the PciLib which is imported by TdxDxe driver.
>
> In a SEV-ES guest the AmdSevDxe driver performs a
> MemEncryptSevClearMmioPageEncMask() call against the
> PcdPciExpressBaseAddress range to mark it shared/unencrypted. However,
> the TdxDxe driver is loaded before the AmdSevDxe driver, and the PciLib
> in TdxDxe is DxePciLibI440FxQ35 which will access the
> PcdPciExpressBaseAddress range. Since the range has not been marked
> shared/unencrypted, the #VC handler terminates the guest for trying to
> do MMIO to an encrypted region.
>
> To fix the issue TdxDxe driver set the PciLib to BasePciLibCf8.inf as
> AmdSevDxe driver does.
>
> Cc: Brijesh Singh <brijesh.singh@amd.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>
> SEV-Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
> TDX-Tested-by: Min Xu <min.m.xu@intel.com>
> Signed-off-by: Min Xu <min.m.xu@intel.com>
> ---
> OvmfPkg/IntelTdx/IntelTdxX64.dsc | 5 ++++-
> OvmfPkg/OvmfPkgX64.dsc | 5 ++++-
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> index 245155d41b..f58f14a1d8 100644
> --- a/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> +++ b/OvmfPkg/IntelTdx/IntelTdxX64.dsc
> @@ -704,7 +704,10 @@
> OvmfPkg/PlatformDxe/Platform.inf
> OvmfPkg/IoMmuDxe/IoMmuDxe.inf
>
> - OvmfPkg/TdxDxe/TdxDxe.inf
> + OvmfPkg/TdxDxe/TdxDxe.inf {
> + <LibraryClasses>
> + PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
> + }
>
> #
> # Variable driver stack (non-SMM)
> diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
> index fb2899f8a1..68e7d051d0 100644
> --- a/OvmfPkg/OvmfPkgX64.dsc
> +++ b/OvmfPkg/OvmfPkgX64.dsc
> @@ -967,7 +967,10 @@
> }
> OvmfPkg/IoMmuDxe/IoMmuDxe.inf
>
> - OvmfPkg/TdxDxe/TdxDxe.inf
> + OvmfPkg/TdxDxe/TdxDxe.inf {
> + <LibraryClasses>
> + PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf
> + }
>
> !if $(SMM_REQUIRE) == TRUE
> OvmfPkg/SmmAccess/SmmAccess2Dxe.inf
> --
> 2.29.2.windows.2
>
>
>
>
>
next prev parent reply other threads:[~2022-04-19 2:08 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 1:58 [PATCH] OvmfPkg: Set PciLib for TdxDxe driver Min Xu
2022-04-19 2:07 ` Yao, Jiewen [this message]
2022-04-19 2:42 ` [edk2-devel] " Min Xu
2022-04-19 2:54 ` Yao, Jiewen
2022-04-19 3:05 ` Min Xu
2022-04-19 4:15 ` Yao, Jiewen
2022-04-19 4:39 ` Min Xu
2022-04-19 4:47 ` Yao, Jiewen
2022-04-19 13:23 ` Lendacky, Thomas
[not found] ` <16E732CAB3014272.17418@groups.io>
2022-04-19 5:06 ` Yao, Jiewen
2022-04-21 16:12 ` Lendacky, Thomas
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=MW4PR11MB58721CC169A15ED16A5F270F8CF29@MW4PR11MB5872.namprd11.prod.outlook.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