All of lore.kernel.org
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org
Cc: Juergen Gross <jgross@suse.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jason Baron <jbaron@akamai.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ard Biesheuvel <ardb@kernel.org>
Subject: [PATCH v7 02/14] static_call: move struct static_call_key definition to static_call_types.h
Date: Thu, 11 Mar 2021 15:23:07 +0100	[thread overview]
Message-ID: <20210311142319.4723-3-jgross@suse.com> (raw)
In-Reply-To: <20210311142319.4723-1-jgross@suse.com>

Having the definition of static_call() in static_call_types.h makes
no sense as long struct static_call_key isn't defined there, as the
generic implementation of static_call() is referencing this structure.

So move the definition of struct static_call_key to static_call_types.h.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
V5:
- new patch
---
 include/linux/static_call.h             | 18 ------------------
 include/linux/static_call_types.h       | 18 ++++++++++++++++++
 tools/include/linux/static_call_types.h | 18 ++++++++++++++++++
 3 files changed, 36 insertions(+), 18 deletions(-)

diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 85ecc789f4ff..76b881259144 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -128,16 +128,6 @@ struct static_call_mod {
 	struct static_call_site *sites;
 };
 
-struct static_call_key {
-	void *func;
-	union {
-		/* bit 0: 0 = mods, 1 = sites */
-		unsigned long type;
-		struct static_call_mod *mods;
-		struct static_call_site *sites;
-	};
-};
-
 /* For finding the key associated with a trampoline */
 struct static_call_tramp_key {
 	s32 tramp;
@@ -187,10 +177,6 @@ extern long __static_call_return0(void);
 
 static inline int static_call_init(void) { return 0; }
 
-struct static_call_key {
-	void *func;
-};
-
 #define __DEFINE_STATIC_CALL(name, _func, _func_init)			\
 	DECLARE_STATIC_CALL(name, _func);				\
 	struct static_call_key STATIC_CALL_KEY(name) = {		\
@@ -243,10 +229,6 @@ static inline long __static_call_return0(void)
 
 static inline int static_call_init(void) { return 0; }
 
-struct static_call_key {
-	void *func;
-};
-
 static inline long __static_call_return0(void)
 {
 	return 0;
diff --git a/include/linux/static_call_types.h b/include/linux/static_call_types.h
index ae5662d368b9..5a00b8b2cf9f 100644
--- a/include/linux/static_call_types.h
+++ b/include/linux/static_call_types.h
@@ -58,11 +58,25 @@ struct static_call_site {
 	__raw_static_call(name);					\
 })
 
+struct static_call_key {
+	void *func;
+	union {
+		/* bit 0: 0 = mods, 1 = sites */
+		unsigned long type;
+		struct static_call_mod *mods;
+		struct static_call_site *sites;
+	};
+};
+
 #else /* !CONFIG_HAVE_STATIC_CALL_INLINE */
 
 #define __STATIC_CALL_ADDRESSABLE(name)
 #define __static_call(name)	__raw_static_call(name)
 
+struct static_call_key {
+	void *func;
+};
+
 #endif /* CONFIG_HAVE_STATIC_CALL_INLINE */
 
 #ifdef MODULE
@@ -77,6 +91,10 @@ struct static_call_site {
 
 #else
 
+struct static_call_key {
+	void *func;
+};
+
 #define static_call(name)						\
 	((typeof(STATIC_CALL_TRAMP(name))*)(STATIC_CALL_KEY(name).func))
 
diff --git a/tools/include/linux/static_call_types.h b/tools/include/linux/static_call_types.h
index ae5662d368b9..5a00b8b2cf9f 100644
--- a/tools/include/linux/static_call_types.h
+++ b/tools/include/linux/static_call_types.h
@@ -58,11 +58,25 @@ struct static_call_site {
 	__raw_static_call(name);					\
 })
 
+struct static_call_key {
+	void *func;
+	union {
+		/* bit 0: 0 = mods, 1 = sites */
+		unsigned long type;
+		struct static_call_mod *mods;
+		struct static_call_site *sites;
+	};
+};
+
 #else /* !CONFIG_HAVE_STATIC_CALL_INLINE */
 
 #define __STATIC_CALL_ADDRESSABLE(name)
 #define __static_call(name)	__raw_static_call(name)
 
+struct static_call_key {
+	void *func;
+};
+
 #endif /* CONFIG_HAVE_STATIC_CALL_INLINE */
 
 #ifdef MODULE
@@ -77,6 +91,10 @@ struct static_call_site {
 
 #else
 
+struct static_call_key {
+	void *func;
+};
+
 #define static_call(name)						\
 	((typeof(STATIC_CALL_TRAMP(name))*)(STATIC_CALL_KEY(name).func))
 
-- 
2.26.2


  parent reply	other threads:[~2021-03-11 14:24 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-11 14:23 [PATCH v7 00/14] x86: major paravirt cleanup Juergen Gross
2021-03-11 14:23 ` Juergen Gross
2021-03-11 14:23 ` Juergen Gross via Virtualization
2021-03-11 14:23 ` [PATCH v7 01/14] x86/alternative: merge include files Juergen Gross
2021-03-12 11:54   ` [tip: x86/alternatives] x86/alternative: Merge " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` Juergen Gross [this message]
2021-03-12 11:54   ` [tip: x86/alternatives] static_call: Move struct static_call_key definition to static_call_types.h tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 03/14] static_call: add function to query current function Juergen Gross
2021-03-12 11:54   ` [tip: x86/alternatives] static_call: Add " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 04/14] x86/paravirt: switch time pvops functions to use static_call() Juergen Gross
2021-03-11 14:23   ` Juergen Gross
2021-03-11 14:23   ` Juergen Gross via Virtualization
2021-03-12 11:54   ` [tip: x86/alternatives] x86/paravirt: Switch " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 05/14] x86/alternative: support not-feature Juergen Gross
2021-03-12 11:54   ` [tip: x86/alternatives] x86/alternative: Support not-feature tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 06/14] x86/alternative: support ALTERNATIVE_TERNARY Juergen Gross
2021-03-12 11:54   ` [tip: x86/alternatives] x86/alternative: Support ALTERNATIVE_TERNARY tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 07/14] x86/alternative: don't open code ALTERNATIVE_TERNARY() in _static_cpu_has() Juergen Gross
2021-03-12 11:54   ` [tip: x86/alternatives] x86/alternative: Use " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 08/14] x86: add new features for paravirt patching Juergen Gross
2021-03-11 14:23   ` Juergen Gross via Virtualization
2021-03-12 11:54   ` [tip: x86/alternatives] x86/paravirt: Add " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 09/14] x86/paravirt: remove no longer needed 32-bit pvops cruft Juergen Gross
2021-03-11 14:23   ` Juergen Gross via Virtualization
2021-03-12 11:54   ` [tip: x86/alternatives] x86/paravirt: Remove " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 10/14] x86/paravirt: simplify paravirt macros Juergen Gross
2021-03-11 14:23   ` Juergen Gross via Virtualization
2021-03-12 11:54   ` [tip: x86/alternatives] x86/paravirt: Simplify " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 11/14] x86/paravirt: switch iret pvops to ALTERNATIVE Juergen Gross
2021-03-11 14:23   ` Juergen Gross via Virtualization
2021-03-12 11:54   ` [tip: x86/alternatives] x86/paravirt: Switch " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 12/14] x86/paravirt: add new macros PVOP_ALT* supporting pvops in ALTERNATIVEs Juergen Gross
2021-03-11 14:23   ` Juergen Gross via Virtualization
2021-03-12 11:54   ` [tip: x86/alternatives] x86/paravirt: Add new PVOP_ALT* macros to support " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 13/14] x86/paravirt: switch functions with custom code to ALTERNATIVE Juergen Gross
2021-03-11 14:23   ` Juergen Gross via Virtualization
2021-03-12 11:54   ` [tip: x86/alternatives] x86/paravirt: Switch " tip-bot2 for Juergen Gross
2021-03-11 14:23 ` [PATCH v7 14/14] x86/paravirt: have only one paravirt patch function Juergen Gross
2021-03-11 14:23   ` Juergen Gross
2021-03-12 11:54   ` [tip: x86/alternatives] x86/paravirt: Have " tip-bot2 for Juergen Gross

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=20210311142319.4723-3-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=ardb@kernel.org \
    --cc=jbaron@akamai.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.