]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: nVMX: Use kvm_{read,write}_guest_cached() for shadow_vmcs12
authorDavid Woodhouse <dwmw@amazon.co.uk>
Mon, 15 Nov 2021 16:50:24 +0000 (16:50 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 18 Nov 2021 07:03:42 +0000 (02:03 -0500)
commit78e8ac81db8e57f05527fa7e02b9483dd7994274
tree2e2dc3f57800afdbab61ba690c3d6df7a684e0ad
parent1669d960c69c357cc0ee29857e4a589973ac8f86
KVM: nVMX: Use kvm_{read,write}_guest_cached() for shadow_vmcs12

Using kvm_vcpu_map() for reading from the guest is entirely gratuitous,
when all we do is a single memcpy and unmap it again. Fix it up to use
kvm_read_guest()... but in fact I couldn't bring myself to do that
without also making it use a gfn_to_hva_cache for both that *and* the
copy in the other direction.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Message-Id: <20211115165030.7422-5-dwmw2@infradead.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.h