On November 3, 2021 2:51 PM, Gerd Hoffmann wrote:
> > +/**
> > + Check if it is Tdx guest
> > +
> > + @retval TRUE It is Tdx guest
> > + @retval FALSE It is not Tdx guest
> > +**/
> > +BOOLEAN
> > +QemuFwCfgIsTdxGuest (
>
> QemuFwCfgIsCC()
>
> > + return (CcWorkAreaHeader != NULL && CcWorkAreaHeader-
> >GuestType == GUEST_TYPE_INTEL_TDX);
>
> GuestType != GUEST_TYPE_NON_ENCRYPTED
>
> > if (MemEncryptSevIsEnabled ()) {
> > DEBUG ((DEBUG_INFO, "SEV: QemuFwCfg fallback to IO Port
> interface.\n"));
> > + } else if (QemuFwCfgIsTdxGuest ()) {
>
> if (QemuFwCfgIsCC()
>
Hi, Gerd
I re-check the MemEncryptSevIsEnabled() and it doesn't simply check the GuestType. Instead it does more checking.
See
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftianocore%2Fedk2%2Fblob%2Fmaster%2FOvmfPkg%2FLibrary%2FBaseMemEncryptSevLib%2FPeiMemEncryptSevLibInternal.c%23L34-L88&data=04%7C01%7Cbrijesh.singh%40amd.com%7Ce9ff44a121444737aa8d08d99ecedcd6%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637715433574095127%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=h2q2P79zm%2FfF44q35%2FGFmVI%2BOShQGwdNIUEZZSToM%2FQ%3D&reserved=0
Brijesh, what's your thought about Gerd's suggestion?
Thanks
Min