kvm: svm: Use the hardware provided GPA instead of page walk
authorTom Lendacky <thomas.lendacky@amd.com>
Wed, 14 Dec 2016 19:59:23 +0000 (14:59 -0500)
committerRadim Krčmář <rkrcmar@redhat.com>
Mon, 9 Jan 2017 13:47:58 +0000 (14:47 +0100)
commit0f89b207b04a1a399e19d35293658e3a571da3d7
treec2552c3c7a7a33564c36b4e469c9da7191fe5836
parent5bd5db385b3e13c702365574c0b7350c6ea45e84
kvm: svm: Use the hardware provided GPA instead of page walk

When a guest causes a NPF which requires emulation, KVM sometimes walks
the guest page tables to translate the GVA to a GPA. This is unnecessary
most of the time on AMD hardware since the hardware provides the GPA in
EXITINFO2.

The only exception cases involve string operations involving rep or
operations that use two memory locations. With rep, the GPA will only be
the value of the initial NPF and with dual memory locations we won't know
which memory address was translated into EXITINFO2.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Reviewed-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/include/asm/kvm_emulate.h
arch/x86/include/asm/kvm_host.h
arch/x86/kvm/emulate.c
arch/x86/kvm/svm.c
arch/x86/kvm/x86.c