From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 428B7C433EF for ; Thu, 11 Nov 2021 10:49:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1245C61267 for ; Thu, 11 Nov 2021 10:49:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 1245C61267 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lW07ukodAMgev1UoKbyz59TRlyEQbsEhhm/zZNuXkFs=; b=fL5aATLMf+S7TI /EnrqTrmcHiJAFz2J4Eu2z7vE3VtxwGyQprv8BgyXxc6MNXIgCoVQBFlrbHZnaERMA2813lkRDne3 cVQtG6NXyt2eeDXmvbuIzJPTiXXQtuisXQekaxdcD4vq9HgA0+SyM+cp49qvNkw9pFmDiN7RPaf48 bWzdJv6NJAGV1ahQ6UUmu4W1yuZSwYSPMnVinqBTv1kL1VN4iS9elA2E2hwClCMwtGEzwGPJWLb82 jj+9vqewv8TqNz/KhGXB4qSr8Aje3oe1JCHROJJMRc4mlqI8XhgOPh6GgQK/NCo261yI2UM80GeA2 01ZGcINB9RgMYp371bSw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ml7cy-007iao-C1; Thu, 11 Nov 2021 10:48:20 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ml7cw-007iad-0r; Thu, 11 Nov 2021 10:48:18 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Lk4G/R3I07fhmcAqeSUqtCqNDck8UECisYgW0RP2fZk=; b=AET3uxMt3hHFzdG81TShZLlRhA lnzx4x2xkBejjcu8i+MuOlBWGAq82yBnQhP9jNhSKqzutZkvoPrE+DaFRBQ2JOb4j5DojW+YmB1TQ EZfc3k1Z3m4KXMajFbDtwS9023NbK50LztQbXevsdQvS6AOv4JY3DBFmFrzKqXOH+RV3M0pyTvPbI 9sn7wEgLyUpWZTEsemou0MiLDGDeur8Ama9taCLIXAaN6Ru7/xY5zsA5qZdI+ad11Hfx7npvyG54r SstAvX6uYL3TOGkFqkoXYIn4TKwOJvn7Eki+iTRy2VOK059F6VHaZNIoBBTll1KF9xSh0wvNlGSuH NL6Mf2Yg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ml7ce-002eyR-My; Thu, 11 Nov 2021 10:48:01 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CB96930001B; Thu, 11 Nov 2021 11:47:57 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 950042D1ADCA5; Thu, 11 Nov 2021 11:47:57 +0100 (CET) Date: Thu, 11 Nov 2021 11:47:57 +0100 From: Peter Zijlstra To: Paolo Bonzini Cc: Sean Christopherson , Ingo Molnar , Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland , Russell King , Marc Zyngier , Catalin Marinas , Guo Ren , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, Boris Ostrovsky , Juergen Gross , Alexander Shishkin , Jiri Olsa , Namhyung Kim , James Morse , Alexandru Elisei , Suzuki K Poulose , "H. Peter Anvin" , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , Stefano Stabellini , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-csky@vger.kernel.org, linux-riscv@lists.infradead.org, kvm@vger.kernel.org, xen-devel@lists.xenproject.org, Artem Kashkanov , Like Xu , Like Xu , Zhu Lingshan Subject: Re: [PATCH v4 01/17] perf: Protect perf_guest_cbs with RCU Message-ID: References: <20211111020738.2512932-1-seanjc@google.com> <20211111020738.2512932-2-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Nov 11, 2021 at 08:26:58AM +0100, Paolo Bonzini wrote: > On 11/11/21 03:07, Sean Christopherson wrote: > > EXPORT_SYMBOL_GPL(perf_register_guest_info_callbacks); > > int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *cbs) > > { > > - perf_guest_cbs = NULL; > > + if (WARN_ON_ONCE(rcu_access_pointer(perf_guest_cbs) != cbs)) > > + return -EINVAL; > > + > > + rcu_assign_pointer(perf_guest_cbs, NULL); > > + synchronize_rcu(); > This technically could be RCU_INIT_POINTER but it's not worth a respin. > There are dozens of other occurrences, and if somebody wanted they > could use Coccinelle to fix all of them. I've been pushing the other way, trying to get rid of RCU_INIT_POINTER() since rcu_assign_pointer(, NULL) actualy DTRT per __builtin_constant_p() etc. There's a very few sites where we use RCU_INIT_POINTER() with a !NULL argument, and those are 'special'. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel