Skip to content

Commit

Permalink
x86/init: Initialize signal frame size late
Browse files Browse the repository at this point in the history
commit 54d9a91 upstream

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
Signed-off-by: Daniel Sneddon <daniel.sneddon@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Thomas Gleixner authored and gregkh committed Aug 8, 2023
1 parent b083788 commit c956807
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions arch/x86/include/asm/sigframe.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,4 @@ struct rt_sigframe_x32 {

#endif /* CONFIG_X86_64 */

void __init init_sigframe_size(void);

#endif /* _ASM_X86_SIGFRAME_H */
3 changes: 0 additions & 3 deletions arch/x86/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,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>

Expand Down Expand Up @@ -1578,8 +1577,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
Expand Down
4 changes: 3 additions & 1 deletion arch/x86/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ SYSCALL_DEFINE0(rt_sigreturn)
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();

Expand All @@ -736,7 +736,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)
{
Expand Down

0 comments on commit c956807

Please sign in to comment.