OSDN Git Service

KVM: selftests: Use non-atomic clear/set bit helpers in KVM tests
authorSean Christopherson <seanjc@google.com>
Sat, 19 Nov 2022 01:34:47 +0000 (01:34 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 2 Dec 2022 18:22:33 +0000 (13:22 -0500)
commit03a0c819e71755398d59993b9adee203544617d5
treef7331df2fde05ff319a2a304449fcf21ec9e5464
parent75d7ba32f9829e778484cf6e96e6e8f80914b0b3
KVM: selftests: Use non-atomic clear/set bit helpers in KVM tests

Use the dedicated non-atomic helpers for {clear,set}_bit() and their
test variants, i.e. the double-underscore versions.  Depsite being
defined in atomic.h, and despite the kernel versions being atomic in the
kernel, tools' {clear,set}_bit() helpers aren't actually atomic.  Move
to the double-underscore versions so that the versions that are expected
to be atomic (for kernel developers) can be made atomic without affecting
users that don't want atomic operations.

Leave the usage in ucall_free() as-is, it's the one place in tools/ that
actually wants/needs atomic behavior.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20221119013450.2643007-7-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/aarch64/arch_timer.c
tools/testing/selftests/kvm/dirty_log_test.c
tools/testing/selftests/kvm/x86_64/hyperv_evmcs.c
tools/testing/selftests/kvm/x86_64/hyperv_svm_test.c