x86/init: Initialize signal frame size late
authorThomas Gleixner <tglx@linutronix.de>
Tue, 13 Jun 2023 23:39:42 +0000 (01:39 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 16 Jun 2023 08:16:00 +0000 (10:16 +0200)
No point in doing this during really early boot. Move it to an early
initcall so that it is set up before possible user mode helpers are started
during device initialization.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/20230613224545.727330699@linutronix.de
arch/x86/include/asm/sigframe.h
arch/x86/kernel/cpu/common.c
arch/x86/kernel/signal.c

index 5b1ed650b12489f328c38645cebd66f446603532..84eab27248754233da3d75f9b27cecd8f0fb89ff 100644 (file)
@@ -85,6 +85,4 @@ struct rt_sigframe_x32 {
 
 #endif /* CONFIG_X86_64 */
 
-void __init init_sigframe_size(void);
-
 #endif /* _ASM_X86_SIGFRAME_H */
index 5ee8b31ef16c89fee65d8b1ed3f2f397174af6bf..b8a4db151209ebf73648521c5523bdb4ebb479da 100644 (file)
@@ -64,7 +64,6 @@
 #include <asm/cpu_device_id.h>
 #include <asm/uv/uv.h>
 #include <asm/set_memory.h>
-#include <asm/sigframe.h>
 #include <asm/traps.h>
 #include <asm/sev.h>
 
@@ -1607,8 +1606,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
 
        fpu__init_system(c);
 
-       init_sigframe_size();
-
 #ifdef CONFIG_X86_32
        /*
         * Regardless of whether PCID is enumerated, the SDM says
index 004cb30b74198faf3456b8db84c2a717ba8914dc..cfeec3ee877ebb9c4779a3ce9fe77ab172f685d4 100644 (file)
@@ -182,7 +182,7 @@ get_sigframe(struct ksignal *ksig, struct pt_regs *regs, size_t frame_size,
 static unsigned long __ro_after_init max_frame_size;
 static unsigned int __ro_after_init fpu_default_state_size;
 
-void __init init_sigframe_size(void)
+static int __init init_sigframe_size(void)
 {
        fpu_default_state_size = fpu__get_fpstate_size();
 
@@ -194,7 +194,9 @@ void __init init_sigframe_size(void)
        max_frame_size = round_up(max_frame_size, FRAME_ALIGNMENT);
 
        pr_info("max sigframe size: %lu\n", max_frame_size);
+       return 0;
 }
+early_initcall(init_sigframe_size);
 
 unsigned long get_sigframe_size(void)
 {