c45f678 OvmfPkg/VmgExitLib: Add support for NPF NAE events (MMIO)

1 file Authored by Tom Lendacky 3 years ago, Committed by mergify[bot] 3 years ago,
    OvmfPkg/VmgExitLib: Add support for NPF NAE events (MMIO)
    
    BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2198
    
    Under SEV-ES, a NPF intercept for an NPT entry with a reserved bit set
    generates a #VC exception. This condition is assumed to be an MMIO access.
    VMGEXIT must be used to allow the hypervisor to handle this intercept.
    
    Add support to construct the required GHCB values to support a NPF NAE
    event for MMIO.  Parse the instruction that generated the #VC exception,
    setting the required register values in the GHCB and creating the proper
    SW_EXIT_INFO1, SW_EXITINFO2 and SW_SCRATCH values in the GHCB.
    
    Cc: Jordan Justen <jordan.l.justen@intel.com>
    Cc: Laszlo Ersek <lersek@redhat.com>
    Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>
    Acked-by: Laszlo Ersek <lersek@redhat.com>
    Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
    Regression-tested-by: Laszlo Ersek <lersek@redhat.com>