Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1559045ybn; Wed, 2 Oct 2019 18:45:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7HzV2nx6p5dac/OmN/MgkZe5rUvrl8jA20ejcQ4v/O2RmaNemul/9AhAkSlcXPOWikdsE X-Received: by 2002:a05:6402:713:: with SMTP id w19mr6919182edx.126.1570067151656; Wed, 02 Oct 2019 18:45:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570067151; cv=none; d=google.com; s=arc-20160816; b=GIkAatEORK147HvcglOhe+ReDKiIIHIn6swPJpZDXu4PmGPxoJJ2UfF42Y4rHjtrLT yt5CmVqNgbGpntVeW9mRJ1TNjXw+ndL9UcrfGqQI8TJlcxuB4UKqvqteqz8wSRzBqHdw IIoM54va0FHPjrFnpafwJCEn6CunMkjg3sSDNemYIZnO6F94a/vxIQyFDjhJHCbpS36/ 73q/09UcqaITSZC4vngnuncBYbSXLKF1BEZ7qTKYbFBGW7r4sZ97IerkbzQEr1eETqk8 HTeaNiKnI8Azh/WRminZrEB2EWCJ0e6vMOjqefbIUgU6e0XQso5E0BqctqnlqCgrwYY1 nUjw== 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=pddjxJ54QMln0iiFbSWz51104EliSLaOCk24frmfrwQ=; b=tRdcQRU/DB/WFoYjnnhQ10QkWtIcG8z7Q4YRLlr+Aes57sxYjNWNzLVp4S6Eet/WgG 7VBZ6jKXfhXFtSKjYUL+Sd5rtI4khLPQBVsOqujgUcNekcezaTtJD/e8jwTKMoQFIIw9 Bw6xFqs15QlEZc/r2E+bBCIYXITXG1dhys/x+krJ+W10UJ0gqRJpJzrikkBB966slCQd nMA4cUm7h2reFfdx0wTvQCID+qIi1RkDrcAF5V9u/TV+MWR2ptHnmfu+K8xGip5rFrF8 Gkv6RhnZPDcEKqMVMH6PFX3ALojgkzqCcbU78hwYoNth3MrHFyl1YwSGWxHuype8EQk/ 1LNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HUiGVvKy; 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 v22si508746edq.239.2019.10.02.18.45.27; Wed, 02 Oct 2019 18:45:51 -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=HUiGVvKy; 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 S1728336AbfJCBnr (ORCPT + 99 others); Wed, 2 Oct 2019 21:43:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:46354 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726364AbfJCBnM (ORCPT ); Wed, 2 Oct 2019 21:43:12 -0400 Received: from paulmck-ThinkPad-P72.home (50-39-105-78.bvtn.or.frontiernet.net [50.39.105.78]) (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 16B52222C6; Thu, 3 Oct 2019 01:43:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570066992; bh=vJactgM3M2ccX7Qs5sz0+VAKv+twysNQWUyUR3pB7oQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HUiGVvKyZr1aow3e8Bar+GnMPXkDxlGJVKuQwD++B2faft524sFpkWCjhyGlatxNc m+ApIIqFWfp3SXG55n9nOJjt383I5KBFYF8VbHSUl0dB6uIXiMT+K5YeIVUny//ZSE Q2ux/Zo6uD2Q3EXPFgYdMJlcRPc69VPK5Sr6qWoU= 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" , Paolo Bonzini , =?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 2/9] x86/kvm/pmu: Replace rcu_swap_protected() with rcu_replace() Date: Wed, 2 Oct 2019 18:43:03 -0700 Message-Id: <20191003014310.13262-2-paulmck@kernel.org> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20191003014153.GA13156@paulmck-ThinkPad-P72> References: <20191003014153.GA13156@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 Signed-off-by: Paul E. McKenney Cc: 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..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); -- 2.9.5