diff options
| author | Sean Christopherson <[email protected]> | 2022-10-06 00:34:07 +0000 | 
|---|---|---|
| committer | Sean Christopherson <[email protected]> | 2022-11-16 16:58:52 -0800 | 
| commit | 03b4750533fc6519845ac2ca0e1d88a81ac260a1 (patch) | |
| tree | 99e5e4f85b571c7ba46dc1c11107944c60821843 /tools/testing/selftests/kvm/lib/ucall_common.c | |
| parent | cf4694be2b2cf74945e50d39a02ea2307c4495f4 (diff) | |
KVM: selftests: Make arm64's MMIO ucall multi-VM friendly
Fix a mostly-theoretical bug where ARM's ucall MMIO setup could result in
different VMs stomping on each other by cloberring the global pointer.
Fix the most obvious issue by saving the MMIO gpa into the VM.
A more subtle bug is that creating VMs in parallel (on multiple tasks)
could result in a VM using the wrong address.  Synchronizing a global to
a guest effectively snapshots the value on a per-VM basis, i.e. the
"global" is already prepped to work with multiple VMs, but setting the
global in the host is not thread-safe.  To fix that bug, add
write_guest_global() to allow stuffing a VM's copy of a "global" without
modifying the host value.
Reviewed-by: Andrew Jones <[email protected]>
Tested-by: Peter Gonda <[email protected]>
Signed-off-by: Sean Christopherson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Diffstat (limited to 'tools/testing/selftests/kvm/lib/ucall_common.c')
0 files changed, 0 insertions, 0 deletions