Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp6045433ybg; Tue, 22 Oct 2019 12:13:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqychlzqvYtTGklFUZHf3aEh+HBlMS5f3MAn0qgTQ4/7rWAsuPQmKxTrAtOelKe3BuCLaVgy X-Received: by 2002:a17:906:fcac:: with SMTP id qw12mr28489614ejb.31.1571771613784; Tue, 22 Oct 2019 12:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571771613; cv=none; d=google.com; s=arc-20160816; b=LzaHV88W3AeDQiTnY1VfcBWeIUgk6QuxP0LoEUBYhIXzakRadik9o7cVD5Zg9qmFIz +seQr4OWI/adBqUKSsEG++zpRZDbyf34sfBeTVUIauqDTKl+la2P5SECTWGceEHISMSa KGzTFZqID3imgPLhyhvHAdBXHoBW/3WQ6t4D/aDUChXDVpMpy9W2oU5PQrKAe1QalX6+ NaoEu2zpCiCIG/CKlSHBiDvrC9vK69+sVq4WE7XPCQoVbEVjzol/4/WCQjrFGsvlK6oA mczdMo/xUwFYgc+FYZPe6MooH9a77TKZYEhEipbBeL0bkJ8qv7rV7PXLCP4lGt3+2KO9 uJVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EpLpPkah8dtyh94Mh/2CXVIjl7kOtwyEheHqbUQ5Y0s=; b=ks7Bt9f7LI3DjwLi6SkVfhdhppcPCEcZuu95PDYEllqvwpNX4XTnsRd9mRuoLyhrnk /g+prp5xMNIOblRRI9HgGR0YA3p1Wo5Hc9dJ3g2o1qRWs701Dc3U+WPglUzCpfYqLiwH orXu79koxr+aNmH6DBfvV03SmDny1p0SQ/Qr6Ml8rrc3jY22N+3wsZl8g1t+hu3EZK3c BTm4yseBF4Gj4tRLP3Zd0xTx/wUj+vQVNBXk57beMETt1AfaIM3DFQ/ShxRL8IRi09mU 3EkzxHxd752gmK3S0pKtdq++KJeVR4x31MUEslQxCeBxQRXy7nW5VeXFdu4ZDDqmqGCi fF3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0OLUuUOt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si223936ejb.333.2019.10.22.12.13.09; Tue, 22 Oct 2019 12:13:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0OLUuUOt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732938AbfJVTMX (ORCPT + 99 others); Tue, 22 Oct 2019 15:12:23 -0400 Received: from mail.kernel.org ([198.145.29.99]:43322 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732903AbfJVTMX (ORCPT ); Tue, 22 Oct 2019 15:12:23 -0400 Received: from localhost.localdomain (rrcs-50-75-166-42.nys.biz.rr.com [50.75.166.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BA37621906; Tue, 22 Oct 2019 19:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1571771542; bh=R3tHkDCH+7tkl14+AOFmzJTymspPmc+OGB4U1M8uKt8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0OLUuUOtRdP0jRyYAWW6w0ldh8KU81QVmuon8dGG0kMSUUYvmJjbSVfLR89zD3gQE 5vj7iWGw2mBo28bqITekuThcLemKYXHga/pRsJ76gOazKfJnea/kPy8+rj+QPOFKIV xoBV4vf7tOVsT1p7GcTghDLLhiFFlRYNn+ZBsBw4= From: paulmck@kernel.org To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com, akpm@linux-foundation.org, mathieu.desnoyers@efficios.com, josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org, rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com, oleg@redhat.com, joel@joelfernandes.org, "Paul E. McKenney" , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, kvm@vger.kernel.org Subject: [PATCH tip/core/rcu 02/10] x86/kvm/pmu: Replace rcu_swap_protected() with rcu_replace() Date: Tue, 22 Oct 2019 12:12:07 -0700 Message-Id: <20191022191215.25781-2-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191022191136.GA25627@paulmck-ThinkPad-P72> References: <20191022191136.GA25627@paulmck-ThinkPad-P72> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Paul E. McKenney" 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+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); -- 2.9.5