summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/IntelTdx/Sec
diff options
context:
space:
mode:
authorMin Xu <min.m.xu@intel.com>2022-04-19 08:26:27 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-04-19 01:26:08 +0000
commit7012cb73c473521e4fe4c997bfbfdfca0bd4b90c (patch)
treeb6eb8fc77c62e8d192fc22f1a96fcebad00bfaef /OvmfPkg/IntelTdx/Sec
parent2a7e1e890d9afe7c62d56538627bbe53180368b8 (diff)
downloadedk2-7012cb73c473521e4fe4c997bfbfdfca0bd4b90c.tar.gz
edk2-7012cb73c473521e4fe4c997bfbfdfca0bd4b90c.tar.bz2
edk2-7012cb73c473521e4fe4c997bfbfdfca0bd4b90c.zip
MdePkg: Probe Cc guest in BaseIoLibIntrinsicSev
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. This patch is to call CcProbe instead of TdIsEnabled in IsTdxGuest. Null instance of CcProbe always returns CCGuestTypeNonEncrypted. Its OvmfPkg version returns the guest type in Ovmf work area. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: James Bottomley <jejb@linux.ibm.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com> Signed-off-by: Min Xu <min.m.xu@intel.com>
Diffstat (limited to 'OvmfPkg/IntelTdx/Sec')
0 files changed, 0 insertions, 0 deletions