From: "James Bottomley" <jejb@linux.ibm.com>
To: Min Xu <min.m.xu@intel.com>, devel@edk2.groups.io
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
Zhiguang Liu <zhiguang.liu@intel.com>,
Jiewen Yao <jiewen.yao@intel.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Brijesh Singh <brijesh.singh@amd.com>,
Erdem Aktas <erdemaktas@google.com>,
Tom Lendacky <thomas.lendacky@amd.com>
Subject: Re: [PATCH 0/4] Introduce TdProbe in MdePkg
Date: Wed, 13 Apr 2022 08:55:06 -0400 [thread overview]
Message-ID: <eac3e00436afd40cc4cdabd49ce883666cc9b26c.camel@linux.ibm.com> (raw)
In-Reply-To: <cover.1649840073.git.min.m.xu@intel.com>
On Wed, 2022-04-13 at 17:08 +0800, Min Xu wrote:
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3902
>
> Bad IO performance in SEC phase is observed after TDX features was
> introduced. (after commit b6b2de884864 - "MdePkg: Support mmio for
> Tdx guest in BaseIoLibIntrinsic").
>
> This is because IsTdxGuest() will be called in each MMIO operation.
> It is trying to cache the result of the probe in the efi data
> segment. However, that doesn't work in SEC, because the data segment
> is read only (so the write seems to succeed but a read will always
> return the original value), leading to us calling TdIsEnabled() check
> for every mmio we do, which is causing the slowdown because it's very
> expensive.
>
> TdProbe is introduced in this patch-set. It is called in
> BaseIoLibIntrinsicSev instead of IsTdxGuest. There are 2 versions of
> the TdProbeLib. Null instance of TdProbe always returns TD_PROBE_NON.
> Its OvmfPkg version checks the Ovmf work area to determine the Td
> guest type.
I tested this out with the TPM code: it restores pretty much all of the
lost performance, thanks!
Tested-by: James Bottomley <jejb@linux.ibm.com>
James
next prev parent reply other threads:[~2022-04-13 12:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-13 9:08 [PATCH 0/4] Introduce TdProbe in MdePkg Min Xu
2022-04-13 9:08 ` [PATCH 1/4] MdePkg: Add TdProbeLib Min Xu
2022-04-13 9:08 ` [PATCH 2/4] OvmfPkg/IntelTdx: " Min Xu
2022-04-13 9:08 ` [PATCH 3/4] MdePkg: Probe Td guest in BaseIoLibIntrinsicSev Min Xu
2022-04-13 9:08 ` [PATCH 4/4] OvmfPkg: Add TdProbeLib in *.dsc Min Xu
2022-04-13 12:55 ` James Bottomley [this message]
2022-04-13 13:12 ` [edk2-devel] [PATCH 0/4] Introduce TdProbe in MdePkg Yao, Jiewen
2022-04-13 13:27 ` 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=eac3e00436afd40cc4cdabd49ce883666cc9b26c.camel@linux.ibm.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