Re: [PATCH] KVM: x86/xen: Use kvm_read_guest_virt() instead of open-coding it badly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 14/12/2022 13:38, David Woodhouse wrote:
From: David Woodhouse <dwmw@xxxxxxxxxxxx>

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@xxxxxxxxxxxx>
---
Spotted the same issue in the QEMU patches while working through them:
https://git.infradead.org/users/dwmw2/qemu.git/shortlog/refs/heads/xenfv
Then realised it was like that in the kernel too.

  arch/x86/kvm/xen.c | 56 +++++++++++++++-------------------------------
  1 file changed, 18 insertions(+), 38 deletions(-)


Reviewed-by: Paul Durrant <paul@xxxxxxx>




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux