From f714fd67f296c2ff5bf2809dc3382d2fa2631dee Mon Sep 17 00:00:00 2001 From: Tom Lendacky Date: Fri, 6 Nov 2020 11:53:10 -0600 Subject: [PATCH] OvmfPkg/QemuFlashFvbServicesRuntimeDxe: Set the SwScratch valid bit BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3008 All fields that are set in the GHCB should have their associated bit in the GHCB ValidBitmap field set. Add support to set the bit for the scratch area field (SwScratch). Fixes: 437eb3f7a8db7681afe0e6064d3a8edb12abb766 Cc: Jordan Justen Cc: Laszlo Ersek Cc: Ard Biesheuvel Reviewed-by: Laszlo Ersek Signed-off-by: Tom Lendacky Message-Id: --- OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c | 1 + 1 file changed, 1 insertion(+) diff --git a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c index 565383ee26..f9b21b5413 100644 --- a/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c +++ b/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlashDxe.c @@ -66,6 +66,7 @@ QemuFlashPtrWrite ( VmgInit (Ghcb); Ghcb->SharedBuffer[0] = Value; Ghcb->SaveArea.SwScratch = (UINT64) (UINTN) Ghcb->SharedBuffer; + VmgSetOffsetValid (Ghcb, GhcbSwScratch); VmgExit (Ghcb, SVM_EXIT_MMIO_WRITE, (UINT64) (UINTN) Ptr, 1); VmgDone (Ghcb); } else {