KVM: x86: Clean up and document nested #PF workaround
authorSean Christopherson <seanjc@google.com>
Fri, 4 Mar 2022 04:20:17 +0000 (20:20 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 29 Apr 2022 16:49:49 +0000 (12:49 -0400)
commit6819af7597d87d40769b47bb377472877a6b56c0
treeb374084b3096f02be7755060ce7cdd5debd3eefd
parent25cc05652cd6be7349c84abbea3886b5483330cd
KVM: x86: Clean up and document nested #PF workaround

Replace the per-vendor hack-a-fix for KVM's #PF => #PF => #DF workaround
with an explicit, common workaround in kvm_inject_emulated_page_fault().
Aside from being a hack, the current approach is brittle and incomplete,
e.g. nSVM's KVM_SET_NESTED_STATE fails to set ->inject_page_fault(),
and nVMX fails to apply the workaround when VMX is intercepting #PF due
to allow_smaller_maxphyaddr=1.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/svm/nested.c
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/x86.c