diff options
author | Sean Christopherson <seanjc@google.com> | 2024-02-28 03:41:42 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-05-07 17:59:21 +0200 |
commit | bde9f9d27e2b87eaeaaa1f87b5e04272aae89a13 (patch) | |
tree | 87bda8da84494075e02949a27609ab49bc77986b /arch/x86/kvm/mmu/mmu.c | |
parent | KVM: x86/mmu: Don't force emulation of L2 accesses to non-APIC internal slots (diff) | |
download | linux-bde9f9d27e2b87eaeaaa1f87b5e04272aae89a13.tar.xz linux-bde9f9d27e2b87eaeaaa1f87b5e04272aae89a13.zip |
KVM: x86/mmu: Explicitly disallow private accesses to emulated MMIO
Explicitly detect and disallow private accesses to emulated MMIO in
kvm_handle_noslot_fault() instead of relying on kvm_faultin_pfn_private()
to perform the check. This will allow the page fault path to go straight
to kvm_handle_noslot_fault() without bouncing through __kvm_faultin_pfn().
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20240228024147.41573-12-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to '')
-rw-r--r-- | arch/x86/kvm/mmu/mmu.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c index ac7cdbb9ee0a..f3cd70419e42 100644 --- a/arch/x86/kvm/mmu/mmu.c +++ b/arch/x86/kvm/mmu/mmu.c @@ -3261,6 +3261,11 @@ static int kvm_handle_noslot_fault(struct kvm_vcpu *vcpu, { gva_t gva = fault->is_tdp ? 0 : fault->addr; + if (fault->is_private) { + kvm_mmu_prepare_memory_fault_exit(vcpu, fault); + return -EFAULT; + } + vcpu_cache_mmio_info(vcpu, gva, fault->gfn, access & shadow_mmio_access_mask); |