coconut-svsm / svsm

COCONUT-SVSM
MIT License
122 stars 42 forks source link

boot_stage2: avoid modifying EFER if possible #402

Closed msft-jlange closed 4 months ago

msft-jlange commented 5 months ago

TDX does not permit writing to the EFER register. Instead, EFER.LME is set as part of the reset state so long mode can be activated once paging is enabled. Since EFER.LME is already set by the hardware, any attempt to set EFER.LME should not write the EFER MSR if EFER.LME is already set.