On October 26, 2021 6:25 PM, Gerd Hoffmann wrote: 
>   Hi,
> 
> > > > So it has to be implemented inside the exception lib.
> > >
> > > Well, no, you can also change the code to avoid triggering an exception.
> > >
> > > Adding a new lib for the exception means the lib must be added into
> > > each and every *.dsc file (either the tdx impl or the null variant),
> > > not only in the tianocore core itself but also all projects depending on
> tianocore.
> > >
> > > So IMHO it is worth checking out how much effort it would be to
> > > avoid early (before component registration) exceptions.
> > >
> > > Which early exception do actually happen?
> > >
> > RegisterCpuInterfaceHandler() is not supported in SEC/PEI phase. But there
> are still some scenarios in SEC/PEI which will trigger #VE.
> >  CPUID is the sample. See below call chain in CpuMpPei.
> > InitializeCpuMpWorker --> CollectBitsDataFromPpi -->
> > MpInitLibGetProcessorInfo --> GetProcessorLocationByApicId()
> 
> Bad example ;)
> 
> TDX needs its own Mp implementations anyway, so that one specifically should
> be quite easy to avoid.
> 
> > Actually #VE handler follows the same way as #VC handler (by SEV). See
> discussions in below link.
> > https://edk2.groups.io/g/devel/topic/73201885
> 
> I guess the list of instructions which trap on tdx is quite simliar to sev?  
> cpuid,
> msr access, io instructions?
> 
> I suspect there isn't an easy way around that then (as discussed at length in 
> the
> email thread linked, thanks for that).
> 
> How about adding the tdx exception handler to the existing library, so we 
> don't
> have the churn of adding a new library everywhere *again*?
Do you mean add the VmTdExitVeHandler.c/VmTdExitLibNull.c in 
CpuExceptionHandlerLib, then include the corresponding source file in each 
*CpuExceptionHandlerLib.inf? 
If this is the case, then the implementation of #VE handler (TDX) will be 
in-consistent with #VC handler (SEV). 
Shall we keep these 2 implementation consistent? Or will SEV agree to update 
the #VC handler in the same way?

Thanks
Min


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


Reply via email to