[edk2-devel] [PATCH V2 12/28] UefiCpuPkg/CpuExceptionHandler: Add base support for the #VE exception

Gerd Hoffmann kraxel at redhat.com
Tue Oct 26 10:24:58 UTC 2021


  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*?

take care,
  Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#82678): https://edk2.groups.io/g/devel/message/82678
Mute This Topic: https://groups.io/mt/86085742/1813853
Mute #ve:https://edk2.groups.io/g/devel/mutehashtag/ve
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