aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/lib/kvm_util.c
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-10-03 15:33:32 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-10-03 15:33:32 -0400
commitfe4d9e4abf622598bd199d0805d20afa12f70c92 (patch)
treeccb8d2aff2c311be6a316a77c1955a8dac9749b8 /tools/testing/selftests/kvm/lib/kvm_util.c
parentkvm: vmx: keep constant definition format consistent (diff)
parentMerge branch kvm-arm64/misc-6.1 into kvmarm-master/next (diff)
downloadlinux-dev-fe4d9e4abf622598bd199d0805d20afa12f70c92.tar.xz
linux-dev-fe4d9e4abf622598bd199d0805d20afa12f70c92.zip
Merge tag 'kvmarm-6.1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
KVM/arm64 updates for v6.1 - Fixes for single-stepping in the presence of an async exception as well as the preservation of PSTATE.SS - Better handling of AArch32 ID registers on AArch64-only systems - Fixes for the dirty-ring API, allowing it to work on architectures with relaxed memory ordering - Advertise the new kvmarm mailing list - Various minor cleanups and spelling fixes
Diffstat (limited to 'tools/testing/selftests/kvm/lib/kvm_util.c')
-rw-r--r--tools/testing/selftests/kvm/lib/kvm_util.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/lib/kvm_util.c b/tools/testing/selftests/kvm/lib/kvm_util.c
index 504c1e1355c3..f1cb1627161f 100644
--- a/tools/testing/selftests/kvm/lib/kvm_util.c
+++ b/tools/testing/selftests/kvm/lib/kvm_util.c
@@ -121,7 +121,10 @@ unsigned int kvm_check_cap(long cap)
void vm_enable_dirty_ring(struct kvm_vm *vm, uint32_t ring_size)
{
- vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING, ring_size);
+ if (vm_check_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL))
+ vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING_ACQ_REL, ring_size);
+ else
+ vm_enable_cap(vm, KVM_CAP_DIRTY_LOG_RING, ring_size);
vm->dirty_ring_size = ring_size;
}