KVM: nSVM: fix running nested guests when npt=0
authorPaolo Bonzini <pbonzini@redhat.com>
Thu, 18 Feb 2021 12:16:59 +0000 (07:16 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:39 +0000 (11:38 +0100)
commitda5b48ac720d381d2fe963b8036f62fe85231842
tree598e4f7ebf227b51947954d69b556c93f86cbd04
parent25b0eb2e33c9a3883a523d142681f5302bc80400
KVM: nSVM: fix running nested guests when npt=0

commit a04aead144fd938c2d9869eb187e5b9ea0009bae upstream.

In case of npt=0 on host, nSVM needs the same .inject_page_fault tweak
as VMX has, to make sure that shadow mmu faults are injected as vmexits.

It is not clear why this is needed at all, but for now keep the same
code as VMX and we'll fix it for both.

Based on a patch by Maxim Levitsky <mlevitsk@redhat.com>.

Fixes: 7c86663b68ba ("KVM: nSVM: inject exceptions via svm_check_nested_events")
Cc: stable@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/svm/nested.c