On October 26, 2021 2:12 PM, Gerd Hoffmann wrote:
> On Tue, Oct 26, 2021 at 05:06:21AM +0000, Xu, Min M wrote:
> > On October 12, 2021 6:27 PM, Gerd Hoffmann wrote:
> > > > +  if (ExceptionType == VE_EXCEPTION) {
> > > > +    EFI_STATUS  Status;
> > > > +    //
> > > > +    // #VE needs to be handled immediately upon enabling exception
> handling
> > > > +    // and therefore can't use the RegisterCpuInterruptHandler()
> interface.
> > >
> > > Can please you explain in more detail why this is the case?
> > >
> > VE Exception may happen before a component registers exception.
> >
> > 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()

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

Thanks
Min



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82676): https://edk2.groups.io/g/devel/message/82676
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