]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: x86/xen: Use kvm_read_guest_virt() instead of open-coding it badly xenpv
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 14 Dec 2022 13:05:00 +0000 (13:05 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 14 Dec 2022 13:21:22 +0000 (13:21 +0000)
commit8aaa27351a417cef26af6cae7ddbd3151dde9975
tree8ad364100efb9c293ea74a74a8d65658ab5bcd97
parent9352e7470a1b4edd2fa9d235420ecc7bc3971bdc
KVM: x86/xen: Use kvm_read_guest_virt() instead of open-coding it badly

In particular, we shouldn't assume that being contiguous in guest virtual
address space means being contiguous in guest *physical* address space.

In dropping the manual calls to kvm_mmu_gva_to_gpa_system(), also drop
the srcu_read_lock() that was around them. All call sites are reached
from kvm_xen_hypercall() which is called from the handle_exit function
with the read lock already held.

Fixes: 2fd6df2f2 ("KVM: x86/xen: intercept EVTCHNOP_send from guests")
       536395260 ("KVM: x86/xen: handle PV timers oneshot mode")
       1a65105a5 ("KVM: x86/xen: handle PV spinlocks slowpath")
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/kvm/xen.c