[edk2-devel] [PATCH V2 05/28] MdePkg: Add TdxLib to wrap Tdx operations

Min Xu min.m.xu at intel.com
Fri Oct 22 02:06:21 UTC 2021


On October 14, 2021 1:30 PM, Gerd Hoffmann wrote:
> > > > +UINT8               *mExtendBufferAddress = NULL;
> > > > +TDX_EXTEND_BUFFER   mExtendBuffer;
> > > > +
> > > > +/**
> > > > +  TD.RTMR.EXTEND requires 64B-aligned guest physical address of
> > > > +  48B-extension data. In runtime we walk thru the Buffer to find
> > > > +  out a 64B-aligned start address.
> > >
> > > Can't you just use __attribute__((aligned(64))) for that?
> > >
> > In the PoC of TDVF I had thought about it. But at last I gave up such solution.
> The reasons are:
> > 1) OVMF/TDVF supports both GCC and VS2019 tool chain.
> __attribute__((aligned(64))) is for GCC. Its counterpart of VS2019 Tool chain
> is __declspec(align(x)).
> > 2) There is the limitation of /ALIGN:32 in the build scripts which means
> aligned 64 exceeds  the /ALIGN 32, unless /ALIGN is updated to 64.
> > That's why the current solution is used.
> 
> MdePkg/Include/Base.h has a bunch of ALIGN_* macros to do the math for
> you, which should simplify this alot.  I'd suggest to also drop the
> mExtendBufferAddress and the function calculating it.  Just use the macro
> instead when needed.
Thanks for reminder. It will be updated in the next version.

Thanks.
Min


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82468): https://edk2.groups.io/g/devel/message/82468
Mute This Topic: https://groups.io/mt/86085729/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list