From: Josh Poimboeuf <jpoimboe@kernel.org>
To: x86@kernel.org
Cc: linux-kernel@vger.kernel.org,
Peter Zijlstra <peterz@infradead.org>,
Mark Rutland <mark.rutland@arm.com>,
Jason Baron <jbaron@akamai.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ard Biesheuvel <ardb@kernel.org>,
Christophe Leroy <christophe.leroy@csgroup.eu>,
Paolo Bonzini <pbonzini@redhat.com>,
Sean Christopherson <seanjc@google.com>,
Sami Tolvanen <samitolvanen@google.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Will McVicker <willmcvicker@google.com>,
Kees Cook <keescook@chromium.org>,
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 [thread overview]
Message-ID: <252c12888b50482ee5bda8415a67cdc971285843.1679456900.git.jpoimboe@kernel.org> (raw)
In-Reply-To: <cover.1679456900.git.jpoimboe@kernel.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 <linux/kernel.h>.
Signed-off-by: Josh Poimboeuf <jpoimboe@kernel.org>
---
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 <linux/sched/sysctl.h>
#include <linux/blk-crypto.h>
#include <linux/xarray.h>
+#include <linux/cpu.h>
#include <trace/events/block.h>
#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 <linux/types.h>
-#include <linux/cpu.h>
#include <linux/static_call_types.h>
#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 <linux/fs_parser.h>
#include <linux/sched/cputime.h>
#include <linux/psi.h>
+#include <linux/cpu.h>
#include <net/sock.h>
#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 <linux/static_call.h>
+#include <linux/cpu.h>
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 <linux/types.h>
+#include <asm/page.h>
#define CREATE_TRACE_POINTS
#include "trace.h"
--
2.39.2
next prev parent reply other threads:[~2023-03-22 4:00 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 4:00 [PATCH v2 00/11] static_call: Improve NULL/ret0 handling Josh Poimboeuf
2023-03-22 4:00 ` [PATCH v2 01/11] static_call: Improve key type abstraction Josh Poimboeuf
2023-03-22 4:53 ` Josh Poimboeuf
2023-03-22 5:02 ` [PATCH v2.1 " Josh Poimboeuf
2023-03-22 4:00 ` [PATCH v2 02/11] static_call: Flip key type union bit Josh Poimboeuf
2023-03-22 5:03 ` [PATCH v2.1 " Josh Poimboeuf
2023-03-22 4:00 ` [PATCH v2 03/11] static_call: Remove static_call_mod_init() declaration Josh Poimboeuf
2023-03-22 4:00 ` Josh Poimboeuf [this message]
2023-03-22 4:00 ` [PATCH v2 05/11] static_call: Make ARCH_ADD_TRAMP_KEY() generic Josh Poimboeuf
2023-03-22 4:00 ` [PATCH v2 06/11] static_call: "EXPORT_STATIC_CALL_TRAMP" -> "EXPORT_STATIC_CALL_RO" Josh Poimboeuf
2023-03-22 4:00 ` [PATCH v2 07/11] static_call: Reorganize static call headers Josh Poimboeuf
2023-03-22 4:00 ` [PATCH v2 08/11] arm64/static_call: Fix static call CFI violations Josh Poimboeuf
2023-03-22 12:22 ` Mark Rutland
2023-03-22 14:19 ` Peter Zijlstra
2023-03-22 18:26 ` Josh Poimboeuf
2023-03-22 18:09 ` Josh Poimboeuf
2023-03-22 18:07 ` Sami Tolvanen
2023-03-22 18:33 ` Josh Poimboeuf
2023-03-22 4:00 ` [PATCH v2 09/11] static_call: Make NULL static calls consistent Josh Poimboeuf
2023-03-22 14:45 ` Peter Zijlstra
2023-03-22 14:59 ` Peter Zijlstra
2023-03-22 18:35 ` Josh Poimboeuf
2023-03-22 15:04 ` Christophe Leroy
2023-03-22 4:00 ` [PATCH v2 10/11] static_call: Remove static_call_cond() Josh Poimboeuf
2023-03-22 4:00 ` [PATCH v2 11/11] static_call: Remove DEFINE_STATIC_CALL_RET0() Josh Poimboeuf
2023-03-22 15:04 ` Christophe Leroy
2023-03-22 18:50 ` Josh Poimboeuf
2023-03-22 15:15 ` Peter Zijlstra
2023-03-22 18:45 ` Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=252c12888b50482ee5bda8415a67cdc971285843.1679456900.git.jpoimboe@kernel.org \
--to=jpoimboe@kernel.org \
--cc=ardb@kernel.org \
--cc=christophe.leroy@csgroup.eu \
--cc=jbaron@akamai.com \
--cc=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=ndesaulniers@google.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=samitolvanen@google.com \
--cc=seanjc@google.com \
--cc=willmcvicker@google.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®