mirror of https://github.com/acidanthera/audk.git
3a3501862f
BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3183
Under SEV-ES, a write to the flash device is done using a direct VMGEXIT
to perform an MMIO write. The address provided to the MMIO write must be
the physical address of the MMIO write destitnation. During boot, OVMF
runs with an identity mapped pagetable structure so that VA == PA and the
VMGEXIT MMIO write destination is just the virtual address of the flash
area address being written.
However, when the UEFI SetVirtualAddressMap() API is invoked, an identity
mapped pagetable structure may not be in place and using the virtual
address for the flash area address is no longer valid. This results in
writes to the flash not being performed successfully. This can be seen
by attempting to change the boot order under Linux. The update will
appear to be performed, based on the output of the command. But rebooting
the guest will show that the new boot order has not been set.
To remedy this, save the value of the flash base physical address before
converting the address as part of SetVirtualAddressMap(). The physical
address can then be calculated by obtaining the offset of the MMIO target
virtual address relative to the flash base virtual address and adding that
to the original flash base physical address. The resulting value produces
a successful MMIO write during runtime services.
Fixes:
|
||
---|---|---|
.. | ||
FvbInfo.c | ||
FvbServicesRuntimeDxe.inf | ||
FvbServicesSmm.inf | ||
FwBlockService.c | ||
FwBlockService.h | ||
FwBlockServiceDxe.c | ||
FwBlockServiceSmm.c | ||
QemuFlash.c | ||
QemuFlash.h | ||
QemuFlashDxe.c | ||
QemuFlashSmm.c |