From patchwork Wed Oct 19 22:58:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Paul E. McKenney" X-Patchwork-Id: 13012484 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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 6583AC433FE for ; Wed, 19 Oct 2022 23:00:15 +0000 (UTC) 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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AuBX6s45CFb9IXomDYpYcFIk4ZIo2upZcIeSxUXLRIY=; b=pGm7XFklzkcgVn QPdEZVnIskRwJ3HxV5pxrcNjfqWejaJAd0EWnekhyPOZnm0txioVu6zM3RCZS9qprIRWDMuXChIyr MmqiZZWs+UXnfRfGef1B4cXcFnKzsvDTGujDt+IdHu/gweP7xS9pVt33Hvzq1w9bExcgkg32aOAG5 bE2K1HRdrVdMggtO/MAsfp9WvBIi4VKTTv/3cbBqveczCoTggYYEcHJJYqvMaU1RDf9C0PWWNhkZ2 Q0gx+iIYRrdCIm0aD7mxSGM4pt4768+WVFoDhN71/gQkLEhOnk/KAhKICihHmvEdFWWBVvyTF0OXc 88vddZBEm3gud0ueb/0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1olI1X-005c0Z-Qa; Wed, 19 Oct 2022 22:58:55 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1olI1U-005bvy-Md for linux-arm-kernel@lists.infradead.org; Wed, 19 Oct 2022 22:58:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 44907619FE; Wed, 19 Oct 2022 22:58:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F393C4315C; Wed, 19 Oct 2022 22:58:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666220328; bh=Nb+xsXAeDl9rjVwYT8+uivwa9boPW8pnKYqH3COPbBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VfqMvXcayMmhZ5/iuy3j3lXwyVT0aBX9tfr5xmh7SpBuHwKwazuBBRp/wJlePRVBr mh7NW+8FEl+rP7Bu4leZvBTLjzJzpKMMWOXoDn+LTxRpuVzWLVJqAJOl8nWaopjnzv kARyhKaFZJSQ5r3CgujnfJnwIQ0uUgPV5WkMHfLOU2CBMkjxREKJe4nEZFBwp7ODwa AbCK5NvLIINjI72QR/DrBWPIO2DVw4C2QCMshI6JjQoFMDTAsyFvx4/5SoEMrgeGUa J2t32wNwZJr07kzRfhQM3X4LuQ61Z0SrNeNFHE0hp2ba/rUMHOtnlm1OXlh51UFI0q EQtpf4HBUuGIQ== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id B59075C0A40; Wed, 19 Oct 2022 15:58:47 -0700 (PDT) From: "Paul E. McKenney" To: rcu@vger.kernel.org Cc: linux-kernel@vger.kernel.org, kernel-team@fb.com, rostedt@goodmis.org, "Paul E. McKenney" , Neeraj Upadhyay , Frederic Weisbecker , Boqun Feng , Catalin Marinas , Will Deacon , Thomas Gleixner , John Ogness , Petr Mladek , linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 rcu 06/11] arch/arm64: Add ARCH_HAS_NMI_SAFE_THIS_CPU_OPS Kconfig option Date: Wed, 19 Oct 2022 15:58:41 -0700 Message-Id: <20221019225846.2501109-6-paulmck@kernel.org> X-Mailer: git-send-email 2.31.1.189.g2e36527f23 In-Reply-To: <20221019225838.GA2500612@paulmck-ThinkPad-P17-Gen-1> References: <20221019225838.GA2500612@paulmck-ThinkPad-P17-Gen-1> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221019_155852_846182_B826D503 X-CRM114-Status: GOOD ( 12.83 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The arm64 architecture uses either an LL/SC loop (old systems) or an LSE stadd instruction (new systems) to implement this_cpu_add(), both of which are NMI safe. This means that the old and more-efficient srcu_read_lock() may be used in NMI context, without the need for srcu_read_lock_nmisafe(). Therefore, add the new Kconfig option ARCH_HAS_NMI_SAFE_THIS_CPU_OPS to arch/arm64/Kconfig, which will cause NEED_SRCU_NMI_SAFE to be deselected, thus preserving the current srcu_read_lock() behavior. Link: https://lore.kernel.org/all/20220910221947.171557773@linutronix.de/ Suggested-by: Neeraj Upadhyay Suggested-by: Frederic Weisbecker Suggested-by: Boqun Feng Signed-off-by: Paul E. McKenney Cc: Catalin Marinas Cc: Will Deacon Cc: Thomas Gleixner Cc: John Ogness Cc: Petr Mladek Cc: --- arch/arm64/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 505c8a1ccbe0c..099ee812f3f18 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -31,6 +31,7 @@ config ARM64 select ARCH_HAS_KCOV select ARCH_HAS_KEEPINITRD select ARCH_HAS_MEMBARRIER_SYNC_CORE + select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS select ARCH_HAS_NON_OVERLAPPING_ADDRESS_SPACE select ARCH_HAS_PTE_DEVMAP select ARCH_HAS_PTE_SPECIAL