From patchwork Wed Mar 22 04:00:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josh Poimboeuf X-Patchwork-Id: 13183524 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 BC0E2C6FD1C for ; Wed, 22 Mar 2023 04:02:29 +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=MyS3nwyHGY3dQnlceBbonfH3Ht+2jd4HvvFOLkji8bY=; b=D1QX9tVaCdwfix uwvw3rWCaPLC0dc7pLR6LnGgPnz1UTc3022urG0uLb1qTMDOxWUphnueyi5geFevTg9ZRI3OUj2Cr YuLT3zQNeE4khl3rgKVBwXC9P8iNurYJtmHBRylWoJ6UjmcKXqREleMYaP9+FSq94y6xLFrU4tGzP ryl8+M+iCv+kH078degoNN2GFZKcRM8z/6bdq4vhb6pB6JLJ3d3tVAZTW21QUToeyUWSZNWpvsft4 M0+H6Yn1WsTyvX2ZKQBQ+bJ034nrt2vPt6H0vivoldcF2FHe8VjAeka/Zz8N5XK8mlAR6Nw9fGih4 MldHGIqIYs5vg+P3aXRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pepej-00EVQX-2e; Wed, 22 Mar 2023 04:00:57 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pepeD-00EVB0-1U for linux-arm-kernel@lists.infradead.org; Wed, 22 Mar 2023 04:00:29 +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 14DCC61F38; Wed, 22 Mar 2023 04:00:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 578E3C4339B; Wed, 22 Mar 2023 04:00:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679457624; bh=vb0/E/xQnHYZirAzUsMS9BEEJ9l0yo4puA34UlEsHUY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l/6zCufXDJX0jYzyqmaYDnjYZANV3vCTW3je5V0JNsAqbwav52XjOmIVH7ItDH6Uh 24ZVp6rHzdLHyIHYwXcBbkGR8UQhEdchmfLCL/FJm68Map3H+1+Nz/ffAEu7dYBiim pp+TklmKMf6pX3n61kSD3dPgpU2CTS8hxh3VMee4O0YgRRsLlWPK5SD8SJNjXV+e+B fqvpsXnlLPmGfhsa675S8VtpwJ2I8uB3aDpoj+QnBJi6W16hppSc79BtofGybFZKwi c4uAhok6UPaqpeYfhK2Mk52HFpLVuNBtF7iWvzGD7pXO6cxiH0mnP+wkuVRmNx5BjS EYIoEVnVsUhmg== From: Josh Poimboeuf To: x86@kernel.org Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , Mark Rutland , Jason Baron , Steven Rostedt , Ard Biesheuvel , Christophe Leroy , Paolo Bonzini , Sean Christopherson , Sami Tolvanen , Nick Desaulniers , Will McVicker , Kees Cook , linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 04/11] static_call: Remove static_call.h dependency on cpu.h Date: Tue, 21 Mar 2023 21:00:10 -0700 Message-Id: <252c12888b50482ee5bda8415a67cdc971285843.1679456900.git.jpoimboe@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230321_210025_574101_1641BCD6 X-CRM114-Status: GOOD ( 14.13 ) 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 Uninline __static_call_update() to remove static_call.h's dependency on cpu.h. This will make it much easier to include static_call.h in common header files like . Signed-off-by: Josh Poimboeuf --- block/bio.c | 1 + include/linux/static_call.h | 10 +--------- kernel/cgroup/cgroup.c | 1 + kernel/static_call.c | 12 ++++++++++++ sound/soc/intel/avs/trace.c | 1 + 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/block/bio.c b/block/bio.c index fd11614bba4d..a2ca0680fd18 100644 --- a/block/bio.c +++ b/block/bio.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include "blk.h" diff --git a/include/linux/static_call.h b/include/linux/static_call.h index 890ddc0c3190..abce40166039 100644 --- a/include/linux/static_call.h +++ b/include/linux/static_call.h @@ -132,7 +132,6 @@ */ #include -#include #include #ifdef CONFIG_HAVE_STATIC_CALL @@ -246,14 +245,7 @@ static inline int static_call_init(void) { return 0; } #define static_call_cond(name) (void)__static_call(name) -static inline -void __static_call_update(struct static_call_key *key, void *tramp, void *func) -{ - cpus_read_lock(); - WRITE_ONCE(key->func, func); - arch_static_call_transform(NULL, tramp, func, false); - cpus_read_unlock(); -} +extern void __static_call_update(struct static_call_key *key, void *tramp, void *func); static inline int static_call_text_reserved(void *start, void *end) { diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 935e8121b21e..4f29f509d9ce 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -58,6 +58,7 @@ #include #include #include +#include #include #define CREATE_TRACE_POINTS diff --git a/kernel/static_call.c b/kernel/static_call.c index e9c3e69f3837..63486995fd82 100644 --- a/kernel/static_call.c +++ b/kernel/static_call.c @@ -1,8 +1,20 @@ // SPDX-License-Identifier: GPL-2.0 #include +#include long __static_call_return0(void) { return 0; } EXPORT_SYMBOL_GPL(__static_call_return0); + +#ifndef CONFIG_HAVE_STATIC_CALL_INLINE +void __static_call_update(struct static_call_key *key, void *tramp, void *func) +{ + cpus_read_lock(); + WRITE_ONCE(key->func, func); + arch_static_call_transform(NULL, tramp, func, false); + cpus_read_unlock(); +} +EXPORT_SYMBOL_GPL(__static_call_update); +#endif diff --git a/sound/soc/intel/avs/trace.c b/sound/soc/intel/avs/trace.c index c63eea909b5e..b033b560e6d2 100644 --- a/sound/soc/intel/avs/trace.c +++ b/sound/soc/intel/avs/trace.c @@ -7,6 +7,7 @@ // #include +#include #define CREATE_TRACE_POINTS #include "trace.h"