Skip to content

Commit 12e78e6

Browse files
committed
x86/kvm/pmu: Replace rcu_swap_protected() with rcu_replace_pointer()
This commit replaces the use of rcu_swap_protected() with the more intuitively appealing rcu_replace_pointer() as a step towards removing rcu_swap_protected(). Link: https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=Z7-GGtM6wcvtyytXZA1+BHqta4gg6Hw@mail.gmail.com/ Reported-by: Linus Torvalds <[email protected]> [ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ] Signed-off-by: Paul E. McKenney <[email protected]> Acked-by: Paolo Bonzini <[email protected]> Cc: "Radim Krčmář" <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: <[email protected]> Cc: <[email protected]>
1 parent a63fc6b commit 12e78e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/pmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ int kvm_vm_ioctl_set_pmu_event_filter(struct kvm *kvm, void __user *argp)
416416
*filter = tmp;
417417

418418
mutex_lock(&kvm->lock);
419-
rcu_swap_protected(kvm->arch.pmu_event_filter, filter,
420-
mutex_is_locked(&kvm->lock));
419+
filter = rcu_replace_pointer(kvm->arch.pmu_event_filter, filter,
420+
mutex_is_locked(&kvm->lock));
421421
mutex_unlock(&kvm->lock);
422422

423423
synchronize_srcu_expedited(&kvm->srcu);

0 commit comments

Comments
 (0)