All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/static-call: fix 32-bit build
@ 2024-12-18  8:02 Juergen Gross
  2024-12-18  9:43 ` [tip: x86/urgent] x86/static-call: Fix " tip-bot2 for Juergen Gross
  2024-12-18  9:47 ` [PATCH] x86/static-call: fix " Peter Zijlstra
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Gross @ 2024-12-18  8:02 UTC (permalink / raw)
  To: linux-kernel
  Cc: torvalds, Juergen Gross, Peter Zijlstra, Josh Poimboeuf,
	Jason Baron, Steven Rostedt, Ard Biesheuvel, Stephen Rothwell

In 32-bit x86 builds CONFIG_STATIC_CALL_INLINE isn't set, leading to
static_call_initialized not being available.

Define it as "0" in that case.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Fixes: 0ef8047b737d ("x86/static-call: provide a way to do very early static-call updates")
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 include/linux/static_call.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 785980af8972..78a77a4ae0ea 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -138,7 +138,6 @@
 #ifdef CONFIG_HAVE_STATIC_CALL
 #include <asm/static_call.h>
 
-extern int static_call_initialized;
 /*
  * Either @site or @tramp can be NULL.
  */
@@ -161,6 +160,8 @@ extern void arch_static_call_transform(void *site, void *tramp, void *func, bool
 
 #ifdef CONFIG_HAVE_STATIC_CALL_INLINE
 
+extern int static_call_initialized;
+
 extern int __init static_call_init(void);
 
 extern void static_call_force_reinit(void);
@@ -226,6 +227,8 @@ extern long __static_call_return0(void);
 
 #elif defined(CONFIG_HAVE_STATIC_CALL)
 
+#define static_call_initialized 0
+
 static inline int static_call_init(void) { return 0; }
 
 #define DEFINE_STATIC_CALL(name, _func)					\
@@ -282,6 +285,8 @@ extern long __static_call_return0(void);
 
 #else /* Generic implementation */
 
+#define static_call_initialized 0
+
 static inline int static_call_init(void) { return 0; }
 
 static inline long __static_call_return0(void)
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [tip: x86/urgent] x86/static-call: Fix 32-bit build
  2024-12-18  8:02 [PATCH] x86/static-call: fix 32-bit build Juergen Gross
@ 2024-12-18  9:43 ` tip-bot2 for Juergen Gross
  2024-12-18  9:47 ` [PATCH] x86/static-call: fix " Peter Zijlstra
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot2 for Juergen Gross @ 2024-12-18  9:43 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Stephen Rothwell, Juergen Gross, Ingo Molnar, x86, linux-kernel

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     45dec3ca1fe153cabd79ef8cd05bff64cd2efa52
Gitweb:        https://git.kernel.org/tip/45dec3ca1fe153cabd79ef8cd05bff64cd2efa52
Author:        Juergen Gross <jgross@suse.com>
AuthorDate:    Wed, 18 Dec 2024 09:02:28 +01:00
Committer:     Ingo Molnar <mingo@kernel.org>
CommitterDate: Wed, 18 Dec 2024 10:36:43 +01:00

x86/static-call: Fix 32-bit build

In 32-bit x86 builds CONFIG_STATIC_CALL_INLINE isn't set, leading to
static_call_initialized not being available.

Define it as "0" in that case.

Fixes: 0ef8047b737d ("x86/static-call: provide a way to do very early static-call updates")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20241218080228.9742-1-jgross@suse.com
---
 include/linux/static_call.h | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/linux/static_call.h b/include/linux/static_call.h
index 785980a..78a77a4 100644
--- a/include/linux/static_call.h
+++ b/include/linux/static_call.h
@@ -138,7 +138,6 @@
 #ifdef CONFIG_HAVE_STATIC_CALL
 #include <asm/static_call.h>
 
-extern int static_call_initialized;
 /*
  * Either @site or @tramp can be NULL.
  */
@@ -161,6 +160,8 @@ extern void arch_static_call_transform(void *site, void *tramp, void *func, bool
 
 #ifdef CONFIG_HAVE_STATIC_CALL_INLINE
 
+extern int static_call_initialized;
+
 extern int __init static_call_init(void);
 
 extern void static_call_force_reinit(void);
@@ -226,6 +227,8 @@ extern long __static_call_return0(void);
 
 #elif defined(CONFIG_HAVE_STATIC_CALL)
 
+#define static_call_initialized 0
+
 static inline int static_call_init(void) { return 0; }
 
 #define DEFINE_STATIC_CALL(name, _func)					\
@@ -282,6 +285,8 @@ extern long __static_call_return0(void);
 
 #else /* Generic implementation */
 
+#define static_call_initialized 0
+
 static inline int static_call_init(void) { return 0; }
 
 static inline long __static_call_return0(void)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/static-call: fix 32-bit build
  2024-12-18  8:02 [PATCH] x86/static-call: fix 32-bit build Juergen Gross
  2024-12-18  9:43 ` [tip: x86/urgent] x86/static-call: Fix " tip-bot2 for Juergen Gross
@ 2024-12-18  9:47 ` Peter Zijlstra
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2024-12-18  9:47 UTC (permalink / raw)
  To: Juergen Gross
  Cc: linux-kernel, torvalds, Josh Poimboeuf, Jason Baron,
	Steven Rostedt, Ard Biesheuvel, Stephen Rothwell

On Wed, Dec 18, 2024 at 09:02:28AM +0100, Juergen Gross wrote:
> In 32-bit x86 builds CONFIG_STATIC_CALL_INLINE isn't set, leading to
> static_call_initialized not being available.
> 
> Define it as "0" in that case.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Fixes: 0ef8047b737d ("x86/static-call: provide a way to do very early static-call updates")
> Signed-off-by: Juergen Gross <jgross@suse.com>

Works for me -- I seem to have missed those patches landing, and I'm
assuming this patch is going to go along with them others that introduce
the problem.

Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>

> ---
>  include/linux/static_call.h | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/include/linux/static_call.h b/include/linux/static_call.h
> index 785980af8972..78a77a4ae0ea 100644
> --- a/include/linux/static_call.h
> +++ b/include/linux/static_call.h
> @@ -138,7 +138,6 @@
>  #ifdef CONFIG_HAVE_STATIC_CALL
>  #include <asm/static_call.h>
>  
> -extern int static_call_initialized;
>  /*
>   * Either @site or @tramp can be NULL.
>   */
> @@ -161,6 +160,8 @@ extern void arch_static_call_transform(void *site, void *tramp, void *func, bool
>  
>  #ifdef CONFIG_HAVE_STATIC_CALL_INLINE
>  
> +extern int static_call_initialized;
> +
>  extern int __init static_call_init(void);
>  
>  extern void static_call_force_reinit(void);
> @@ -226,6 +227,8 @@ extern long __static_call_return0(void);
>  
>  #elif defined(CONFIG_HAVE_STATIC_CALL)
>  
> +#define static_call_initialized 0
> +
>  static inline int static_call_init(void) { return 0; }
>  
>  #define DEFINE_STATIC_CALL(name, _func)					\
> @@ -282,6 +285,8 @@ extern long __static_call_return0(void);
>  
>  #else /* Generic implementation */
>  
> +#define static_call_initialized 0
> +
>  static inline int static_call_init(void) { return 0; }
>  
>  static inline long __static_call_return0(void)
> -- 
> 2.43.0
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-18  9:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-18  8:02 [PATCH] x86/static-call: fix 32-bit build Juergen Gross
2024-12-18  9:43 ` [tip: x86/urgent] x86/static-call: Fix " tip-bot2 for Juergen Gross
2024-12-18  9:47 ` [PATCH] x86/static-call: fix " Peter Zijlstra

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.