summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/s390x/memop.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-06-13 21:42:37 +0000
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-15 08:07:22 -0400
commite5380f6d7586ea3ef3a55d8cf19ceffacea31392 (patch)
tree4fc03286865c8ccaffba5a60d485b95385248258 /tools/testing/selftests/kvm/s390x/memop.c
parent5bdae49fc2f689b5f896b54bd9230425d3643dab (diff)
KVM: SVM: Hide SEV migration lockdep goo behind CONFIG_PROVE_LOCKING
Wrap the manipulation of @role and the manual mutex_{release,acquire}() invocations in CONFIG_PROVE_LOCKING=y to squash a clang-15 warning. When building with -Wunused-but-set-parameter and CONFIG_DEBUG_LOCK_ALLOC=n, clang-15 seees there's no usage of @role in mutex_lock_killable_nested() and yells. PROVE_LOCKING selects DEBUG_LOCK_ALLOC, and the only reason KVM manipulates @role is to make PROVE_LOCKING happy. To avoid true ugliness, use "i" and "j" to detect the first pass in the loops; the "idx" field that's used by kvm_for_each_vcpu() is guaranteed to be '0' on the first pass as it's simply the first entry in the vCPUs XArray, which is fully KVM controlled. kvm_for_each_vcpu() passes '0' for xa_for_each_range()'s "start", and xa_for_each_range() will not enter the loop if there's no entry at '0'. Fixes: 0c2c7c069285 ("KVM: SEV: Mark nested locking of vcpu->lock") Reported-by: kernel test robot <lkp@intel.com> Cc: Peter Gonda <pgonda@google.com> Signed-off-by: Sean Christopherson <seanjc@google.com> Message-Id: <20220613214237.2538266-1-seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/s390x/memop.c')
0 files changed, 0 insertions, 0 deletions