Skip to content

Commit 7cffdbe

Browse files
committed
Merge tag 'x86-boot-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 boot updates from Thomas Gleixner: "Initialize FPU late. Right now FPU is initialized very early during boot. There is no real requirement to do so. The only requirement is to have it done before alternatives are patched. That's done in check_bugs() which does way more than what the function name suggests. So first rename check_bugs() to arch_cpu_finalize_init() which makes it clear what this is about. Move the invocation of arch_cpu_finalize_init() earlier in start_kernel() as it has to be done before fork_init() which needs to know the FPU register buffer size. With those prerequisites the FPU initialization can be moved into arch_cpu_finalize_init(), which removes it from the early and fragile part of the x86 bringup" * tag 'x86-boot-2023-06-26' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/mem_encrypt: Unbreak the AMD_MEM_ENCRYPT=n build x86/fpu: Move FPU initialization into arch_cpu_finalize_init() x86/fpu: Mark init functions __init x86/fpu: Remove cpuinfo argument from init functions x86/init: Initialize signal frame size late init, x86: Move mem_encrypt_init() into arch_cpu_finalize_init() init: Invoke arch_cpu_finalize_init() earlier init: Remove check_bugs() leftovers um/cpu: Switch to arch_cpu_finalize_init() sparc/cpu: Switch to arch_cpu_finalize_init() sh/cpu: Switch to arch_cpu_finalize_init() mips/cpu: Switch to arch_cpu_finalize_init() m68k/cpu: Switch to arch_cpu_finalize_init() loongarch/cpu: Switch to arch_cpu_finalize_init() ia64/cpu: Switch to arch_cpu_finalize_init() ARM: cpu: Switch to arch_cpu_finalize_init() x86/cpu: Switch to arch_cpu_finalize_init() init: Provide arch_cpu_finalize_init()
2 parents 0017387 + 0a9567a commit 7cffdbe

File tree

44 files changed

+194
-352
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+194
-352
lines changed

arch/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ config ARCH_HAS_DMA_SET_UNCACHED
285285
config ARCH_HAS_DMA_CLEAR_UNCACHED
286286
bool
287287

288+
config ARCH_HAS_CPU_FINALIZE_INIT
289+
bool
290+
288291
# Select if arch init_task must go in the __init_task_data section
289292
config ARCH_TASK_STRUCT_ON_STACK
290293
bool

arch/alpha/include/asm/bugs.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ config ARM
55
select ARCH_32BIT_OFF_T
66
select ARCH_CORRECT_STACKTRACE_ON_KRETPROBE if HAVE_KRETPROBES && FRAME_POINTER && !ARM_UNWIND
77
select ARCH_HAS_BINFMT_FLAT
8+
select ARCH_HAS_CPU_FINALIZE_INIT if MMU
89
select ARCH_HAS_CURRENT_STACK_POINTER
910
select ARCH_HAS_DEBUG_VIRTUAL if MMU
1011
select ARCH_HAS_DMA_WRITE_COMBINE if !ARM_DMA_MEM_BUFFERABLE

arch/arm/include/asm/bugs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
3-
* arch/arm/include/asm/bugs.h
4-
*
53
* Copyright (C) 1995-2003 Russell King
64
*/
75
#ifndef __ASM_BUGS_H
@@ -10,10 +8,8 @@
108
extern void check_writebuffer_bugs(void);
119

1210
#ifdef CONFIG_MMU
13-
extern void check_bugs(void);
1411
extern void check_other_bugs(void);
1512
#else
16-
#define check_bugs() do { } while (0)
1713
#define check_other_bugs() do { } while (0)
1814
#endif
1915

arch/arm/kernel/bugs.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <linux/init.h>
3+
#include <linux/cpu.h>
34
#include <asm/bugs.h>
45
#include <asm/proc-fns.h>
56

@@ -11,7 +12,7 @@ void check_other_bugs(void)
1112
#endif
1213
}
1314

14-
void __init check_bugs(void)
15+
void __init arch_cpu_finalize_init(void)
1516
{
1617
check_writebuffer_bugs();
1718
check_other_bugs();

arch/ia64/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ menu "Processor type and features"
99
config IA64
1010
bool
1111
select ARCH_BINFMT_ELF_EXTRA_PHDRS
12+
select ARCH_HAS_CPU_FINALIZE_INIT
1213
select ARCH_HAS_DMA_MARK_CLEAN
1314
select ARCH_HAS_STRNCPY_FROM_USER
1415
select ARCH_HAS_STRNLEN_USER

arch/ia64/include/asm/bugs.h

Lines changed: 0 additions & 20 deletions
This file was deleted.

arch/ia64/kernel/setup.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1067,8 +1067,7 @@ cpu_init (void)
10671067
}
10681068
}
10691069

1070-
void __init
1071-
check_bugs (void)
1070+
void __init arch_cpu_finalize_init(void)
10721071
{
10731072
ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles,
10741073
(unsigned long) __end___mckinley_e9_bundles);

arch/loongarch/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ config LOONGARCH
1010
select ARCH_ENABLE_MEMORY_HOTPLUG
1111
select ARCH_ENABLE_MEMORY_HOTREMOVE
1212
select ARCH_HAS_ACPI_TABLE_UPGRADE if ACPI
13+
select ARCH_HAS_CPU_FINALIZE_INIT
1314
select ARCH_HAS_FORTIFY_SOURCE
1415
select ARCH_HAS_NMI_SAFE_THIS_CPU_OPS
1516
select ARCH_HAS_PTE_SPECIAL

arch/loongarch/include/asm/bugs.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)