Hi,

> > > +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.

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#81943): https://edk2.groups.io/g/devel/message/81943
Mute This Topic: https://groups.io/mt/86085729/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to