Skip to content

Commit 07702e5

Browse files
sean-jcbonzini
authored andcommitted
KVM: x86/mmu: WARN and skip MMIO cache on private, reserved page faults
WARN and skip the emulated MMIO fastpath if a private, reserved page fault is encountered, as private+reserved should be an impossible combination (KVM should never create an MMIO SPTE for a private access). Signed-off-by: Sean Christopherson <seanjc@google.com> Message-ID: <20240228024147.41573-9-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent cd389f5 commit 07702e5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/x86/kvm/mmu/mmu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5818,6 +5818,9 @@ int noinline kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u64 err
58185818

58195819
r = RET_PF_INVALID;
58205820
if (unlikely(error_code & PFERR_RSVD_MASK)) {
5821+
if (WARN_ON_ONCE(error_code & PFERR_PRIVATE_ACCESS))
5822+
return -EFAULT;
5823+
58215824
r = handle_mmio_page_fault(vcpu, cr2_or_gpa, direct);
58225825
if (r == RET_PF_EMULATE)
58235826
goto emulate;

0 commit comments

Comments
 (0)