diff options
author | Michal Luczaj <mhal@rbox.co> | 2023-01-07 01:12:54 +0100 |
---|---|---|
committer | Sean Christopherson <seanjc@google.com> | 2023-02-03 15:30:39 -0800 |
commit | 1fdefb8bd862d7c17fc2526ec9fdfb080c15da45 (patch) | |
tree | b3b9e05d75b62526bc3fc6137fdf722190651b19 /arch/x86/kvm | |
parent | 4d85cfcaa82f0ceb5dcb7ad369a2cc7efb32c65c (diff) |
KVM: x86: Explicitly state lockdep condition of msr_filter update
Replace `1` with the actual mutex_is_locked() check.
Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
Link: https://lore.kernel.org/r/20230107001256.2365304-5-mhal@rbox.co
[sean: delete the comment that explained the hardocded '1']
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r-- | arch/x86/kvm/x86.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 9c66cb3657b4..00e4bf16bbfd 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -6492,8 +6492,8 @@ static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, } mutex_lock(&kvm->lock); - /* The per-VM filter is protected by kvm->lock... */ - old_filter = rcu_replace_pointer(kvm->arch.msr_filter, new_filter, 1); + old_filter = rcu_replace_pointer(kvm->arch.msr_filter, new_filter, + mutex_is_locked(&kvm->lock)); mutex_unlock(&kvm->lock); synchronize_srcu(&kvm->srcu); |