diff mbox series

[v2,4/6] KVM: x86: Explicitly state lockdep condition of msr_filter update

Message ID 20230107001256.2365304-5-mhal@rbox.co (mailing list archive)
State New, archived
Headers show
Series kvm->lock vs. SRCU sync optimizations | expand

Commit Message

Michal Luczaj Jan. 7, 2023, 12:12 a.m. UTC
Replace `1` with the actual mutex_is_locked() check.

Suggested-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Michal Luczaj <mhal@rbox.co>
---
 arch/x86/kvm/x86.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 8abce24ec020..a35183dc2314 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6487,7 +6487,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);