From patchwork Thu Oct 31 11:54:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "tip-bot2 for Mike Rapoport (Microsoft)" X-Patchwork-Id: 11221087 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0DD2C112B for ; Thu, 31 Oct 2019 11:58:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E95A52173E for ; Thu, 31 Oct 2019 11:58:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727995AbfJaL6X convert rfc822-to-8bit (ORCPT ); Thu, 31 Oct 2019 07:58:23 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:55244 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726878AbfJaLzE (ORCPT ); Thu, 31 Oct 2019 07:55:04 -0400 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1iQ92Z-0002rW-H8; Thu, 31 Oct 2019 12:54:59 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 1654C1C0070; Thu, 31 Oct 2019 12:54:56 +0100 (CET) Date: Thu, 31 Oct 2019 11:54:55 -0000 From: "tip-bot2 for Paul E. McKenney" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: core/rcu] x86/kvm/pmu: Replace rcu_swap_protected() with rcu_replace_pointer() Cc: Linus Torvalds , "Paul E. McKenney" , Paolo Bonzini , Radim =?utf-8?b?S3LEjW3DocWZ?= , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , , , Ingo Molnar , linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-ID: <157252289579.29376.8178836820582764127.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The following commit has been merged into the core/rcu branch of tip: Commit-ID: 12e78e6902134c9e49b2481c2515555e6f7b12dc Gitweb: https://git.kernel.org/tip/12e78e6902134c9e49b2481c2515555e6f7b12dc Author: Paul E. McKenney AuthorDate: Mon, 23 Sep 2019 15:15:35 -07:00 Committer: Paul E. McKenney CommitterDate: Wed, 30 Oct 2019 08:43:51 -07:00 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 [ paulmck: From rcu_replace() to rcu_replace_pointer() per Ingo Molnar. ] Signed-off-by: Paul E. McKenney Acked-by: Paolo Bonzini Cc: "Radim Krčmář" Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: "H. Peter Anvin" Cc: Cc: --- 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..5ddb05a 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_pointer(kvm->arch.pmu_event_filter, filter, + mutex_is_locked(&kvm->lock)); mutex_unlock(&kvm->lock); synchronize_srcu_expedited(&kvm->srcu);