diff options
author | Sean Christopherson <seanjc@google.com> | 2024-02-27 18:41:44 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-05-07 11:59:22 -0400 |
commit | f6adeae81f3586a75d127485b0eeac66d535443b (patch) | |
tree | 956f424774066459916903c641c35b76ed43b5ef /mm | |
parent | cd272fc439b598c82a1b1ec3c0c958e63710b8b1 (diff) |
KVM: x86/mmu: Handle no-slot faults at the beginning of kvm_faultin_pfn()
Handle the "no memslot" case at the beginning of kvm_faultin_pfn(), just
after the private versus shared check, so that there's no need to
repeatedly query whether or not a slot exists. This also makes it more
obvious that, except for private vs. shared attributes, the process of
faulting in a pfn simply doesn't apply to gfns without a slot.
Opportunistically stuff @fault's metadata in kvm_handle_noslot_fault() so
that it doesn't need to be duplicated in all paths that invoke
kvm_handle_noslot_fault(), and to minimize the probability of not stuffing
the right fields.
Leave the existing handle behind, but convert it to a WARN, to guard
against __kvm_faultin_pfn() unexpectedly nullifying fault->slot.
Cc: David Matlack <dmatlack@google.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Message-ID: <20240228024147.41573-14-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions