On November 2, 2021 10:07 PM, Gerd Hoffmann wrote: > Hi, > > > +UINT64 mTdSharedPageMask = 0; > > +UINT32 mTdMaxVCpuNum = 0; > > +UINT32 mTdVCpuNum = 0; > > > +UINT64 > > +EFIAPI > > +TdSharedPageMask ( > > + VOID > > + ) > > +{ > > + UINT64 Status; > > + UINT8 Gpaw; > > + TD_RETURN_DATA TdReturnData; > > + > > + if (mTdSharedPageMask != 0) { > > + return mTdSharedPageMask; > > + } > > Small possible optimization: you can cache the whole TD_RETURN_DATA struct > instead of the three extracted values, then ... > > > + Status = TdCall (TDCALL_TDINFO, 0, 0, 0, &TdReturnData); ASSERT > > + (Status == TDX_EXIT_REASON_SUCCESS); > > ... you need a single TDCALL_TDINFO call only. Thanks for reminder. It will be updated in the next version. > > > + tdcall > > + > > + ; Panic if TDCALL reports failure. > > + test rax, rax > > + jnz .no_return_data > > > +.panic: > > + ud2 > > Comment doesn't match code. jnz .panic ? Ah, good catch. It should jnz .panic. It will be fixed in the next version.
Thanks Min -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83539): https://edk2.groups.io/g/devel/message/83539 Mute This Topic: https://groups.io/mt/86739959/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-