On Thu, Oct 03, 2019 at 12:14:32PM +0200, Paolo Bonzini wrote:
> On 03/10/19 03:43, [email protected] wrote:
> > From: "Paul E. McKenney" <[email protected]>
> >
> > This commit replaces the use of rcu_swap_protected() with the more
> > intuitively appealing rcu_replace() as a step towards removing
> > rcu_swap_protected().
> >
> > Link:
> > https://lore.kernel.org/lkml/CAHk-=wiAsJLw1egFEE=z7-ggtm6wcvtyytxza1+bhqta4gg...@mail.gmail.com/
> > Reported-by: Linus Torvalds <[email protected]>
> > Signed-off-by: Paul E. McKenney <[email protected]>
> > Cc: 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]>
> > ---
> > arch/x86/kvm/pmu.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
> > index 46875bb..4c37266 100644
> > --- a/arch/x86/kvm/pmu.c
> > +++ b/arch/x86/kvm/pmu.c
> > @@ -416,8 +416,8 @@ int kvm_vm_ioctl_set_pmu_event_filter(struct kvm *kvm,
> > void __user *argp)
> > *filter = tmp;
> >
> > mutex_lock(&kvm->lock);
> > - rcu_swap_protected(kvm->arch.pmu_event_filter, filter,
> > - mutex_is_locked(&kvm->lock));
> > + filter = rcu_replace(kvm->arch.pmu_event_filter, filter,
> > + mutex_is_locked(&kvm->lock));
> > mutex_unlock(&kvm->lock);
> >
> > synchronize_srcu_expedited(&kvm->srcu);
> >
>
> Should go without saying, but
>
> Acked-by: Paolo Bonzini <[email protected]>
It never goes without saying! ;-)
Applied, thank you!
Thanx, Paul