• Sean Christopherson's avatar
    KVM: x86/mmu: Add sanity checks that KVM doesn't create EPT #VE SPTEs · 837d557a
    Sean Christopherson authored
    Assert that KVM doesn't set a SPTE to a value that could trigger an EPT
    Violation #VE on a non-MMIO SPTE, e.g. to help detect bugs even without
    KVM_INTEL_PROVE_VE enabled, and to help debug actual #VE failures.
    
    Note, this will run afoul of TDX support, which needs to reflect emulated
    MMIO accesses into the guest as #VEs (which was the whole point of adding
    EPT Violation #VE support in KVM).  The obvious fix for that is to exempt
    MMIO SPTEs, but that's annoyingly difficult now that is_mmio_spte() relies
    on a per-VM value.  However, resolving that conundrum is a future problem,
    whereas getting KVM_INTEL_PROVE_VE healthy is a current problem.
    Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
    Message-ID: <20240518000430.1118488-5-seanjc@google.com>
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    837d557a
spte.h 18.8 KB