]> www.infradead.org Git - users/jedix/linux-maple.git/commit
KVM: nVMX: introduce nested_vmx_load_cr3 and call it on vmentry
authorLadi Prosek <lprosek@redhat.com>
Wed, 30 Nov 2016 15:03:10 +0000 (16:03 +0100)
committerKrish Sadhukhan <krish.sadhukhan@oracle.com>
Tue, 22 Aug 2017 22:31:45 +0000 (18:31 -0400)
commit693047a231532fa3cf6b3f92c61ceb48cc43c58b
treec343c925e07b169bebb4c7183b9500d6705a1485
parent44fd93a8930406547845fae1f7a120889eea5ef8
KVM: nVMX: introduce nested_vmx_load_cr3 and call it on vmentry

Loading CR3 as part of emulating vmentry is different from regular CR3 loads,
as implemented in kvm_set_cr3, in several ways.

* different rules are followed to check CR3 and it is desirable for the caller
to distinguish between the possible failures
* PDPTRs are not loaded if PAE paging and nested EPT are both enabled
* many MMU operations are not necessary

This patch introduces nested_vmx_load_cr3 suitable for CR3 loads as part of
nested vmentry and vmexit, and makes use of it on the nested vmentry path.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
(cherry picked from commit 9ed38ffad47316dbdc16de0de275868c7771754d)
OraBug: 26628813 KVM: nVMX: fix CR3 load if L2 uses PAE paging and EPT - backport+regression fix
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
Tested-by: Eyal Moscovici <eyal.moscovici@oracle.com>
Tested-by: Chris Kenna <chris.kenna@oracle.com>
Acked-by: Konrad Wilk <konrad.wilk@oracle.com>
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c