KVM: x86: Add helper functions for illegal GPA checking and page fault injection
authorMohammed Gamal <mgamal@redhat.com>
Fri, 10 Jul 2020 15:48:03 +0000 (17:48 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jul 2020 17:07:28 +0000 (13:07 -0400)
commit897861479c0640ed93ec82db78f8d839df32c4ac
treeaa634837e4caa13734f5e25800b727e2955e3787
parentfe9304d31831c9ee3943f9a6f72b7cea16d4bc11
KVM: x86: Add helper functions for illegal GPA checking and page fault injection

This patch adds two helper functions that will be used to support virtualizing
MAXPHYADDR in both kvm-intel.ko and kvm.ko.

kvm_fixup_and_inject_pf_error() injects a page fault for a user-specified GVA,
while kvm_mmu_is_illegal_gpa() checks whether a GPA exceeds vCPU address limits.

Signed-off-by: Mohammed Gamal <mgamal@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20200710154811.418214-2-mgamal@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/mmu.h
arch/x86/kvm/x86.c
arch/x86/kvm/x86.h