Skip to content

Commit d71ec0e

Browse files
committed
Merge tag 'x86-build-2024-05-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 build updates from Ingo Molnar: - Use -fpic to build the kexec 'purgatory' (the self-contained code that runs between two kernels) - Clean up vmlinux.lds.S generation - Simplify the X86_EXTENDED_PLATFORM section of the x86 Kconfig - Misc cleanups & fixes * tag 'x86-build-2024-05-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/Kconfig: Merge the two CONFIG_X86_EXTENDED_PLATFORM entries x86/purgatory: Switch to the position-independent small code model x86/boot: Replace __PHYSICAL_START with LOAD_PHYSICAL_ADDR x86/vmlinux.lds.S: Take __START_KERNEL out conditional definition x86/vmlinux.lds.S: Remove conditional definition of LOAD_OFFSET vmlinux.lds.h: Fix a typo in comment
2 parents 7e35914 + 71d99ea commit d71ec0e

File tree

6 files changed

+16
-35
lines changed

6 files changed

+16
-35
lines changed

arch/x86/Kconfig

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -503,10 +503,9 @@ config X86_FRED
503503
ring transitions and exception/interrupt handling if the
504504
system supports.
505505

506-
if X86_32
507506
config X86_BIGSMP
508507
bool "Support for big SMP systems with more than 8 CPUs"
509-
depends on SMP
508+
depends on SMP && X86_32
510509
help
511510
This option is needed for the systems that have more than 8 CPUs.
512511

@@ -519,36 +518,25 @@ config X86_EXTENDED_PLATFORM
519518
systems out there.)
520519

521520
If you enable this option then you'll be able to select support
522-
for the following (non-PC) 32 bit x86 platforms:
521+
for the following non-PC x86 platforms, depending on the value of
522+
CONFIG_64BIT.
523+
524+
32-bit platforms (CONFIG_64BIT=n):
523525
Goldfish (Android emulator)
524526
AMD Elan
525527
RDC R-321x SoC
526528
SGI 320/540 (Visual Workstation)
527529
STA2X11-based (e.g. Northville)
528530
Moorestown MID devices
529531

530-
If you have one of these systems, or if you want to build a
531-
generic distribution kernel, say Y here - otherwise say N.
532-
endif # X86_32
533-
534-
if X86_64
535-
config X86_EXTENDED_PLATFORM
536-
bool "Support for extended (non-PC) x86 platforms"
537-
default y
538-
help
539-
If you disable this option then the kernel will only support
540-
standard PC platforms. (which covers the vast majority of
541-
systems out there.)
542-
543-
If you enable this option then you'll be able to select support
544-
for the following (non-PC) 64 bit x86 platforms:
532+
64-bit platforms (CONFIG_64BIT=y):
545533
Numascale NumaChip
546534
ScaleMP vSMP
547535
SGI Ultraviolet
548536

549537
If you have one of these systems, or if you want to build a
550538
generic distribution kernel, say Y here - otherwise say N.
551-
endif # X86_64
539+
552540
# This is an alphabetically sorted list of 64 bit extended platforms
553541
# Please maintain the alphabetic order if and when there are additions
554542
config X86_NUMACHIP

arch/x86/include/asm/boot.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
#include <asm/pgtable_types.h>
77
#include <uapi/asm/boot.h>
88

9-
/* Physical address where kernel should be loaded. */
10-
#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
11-
+ (CONFIG_PHYSICAL_ALIGN - 1)) \
12-
& ~(CONFIG_PHYSICAL_ALIGN - 1))
13-
149
/* Minimum kernel alignment, as a power of two */
1510
#ifdef CONFIG_X86_64
1611
# define MIN_KERNEL_ALIGN_LG2 PMD_SHIFT

arch/x86/include/asm/page_types.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,12 @@
3131

3232
#define VM_DATA_DEFAULT_FLAGS VM_DATA_FLAGS_TSK_EXEC
3333

34-
#define __PHYSICAL_START ALIGN(CONFIG_PHYSICAL_START, \
35-
CONFIG_PHYSICAL_ALIGN)
34+
/* Physical address where kernel should be loaded. */
35+
#define LOAD_PHYSICAL_ADDR ((CONFIG_PHYSICAL_START \
36+
+ (CONFIG_PHYSICAL_ALIGN - 1)) \
37+
& ~(CONFIG_PHYSICAL_ALIGN - 1))
3638

37-
#define __START_KERNEL (__START_KERNEL_map + __PHYSICAL_START)
39+
#define __START_KERNEL (__START_KERNEL_map + LOAD_PHYSICAL_ADDR)
3840

3941
#ifdef CONFIG_X86_64
4042
#include <asm/page_64_types.h>

arch/x86/kernel/vmlinux.lds.S

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515
* put it inside the section definition.
1616
*/
1717

18-
#ifdef CONFIG_X86_32
19-
#define LOAD_OFFSET __PAGE_OFFSET
20-
#else
2118
#define LOAD_OFFSET __START_KERNEL_map
22-
#endif
2319

2420
#define RUNTIME_DISCARD_EXIT
2521
#define EMITS_PT_NOTE
@@ -114,11 +110,10 @@ PHDRS {
114110

115111
SECTIONS
116112
{
113+
. = __START_KERNEL;
117114
#ifdef CONFIG_X86_32
118-
. = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
119115
phys_startup_32 = ABSOLUTE(startup_32 - LOAD_OFFSET);
120116
#else
121-
. = __START_KERNEL;
122117
phys_startup_64 = ABSOLUTE(startup_64 - LOAD_OFFSET);
123118
#endif
124119

arch/x86/purgatory/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ KCOV_INSTRUMENT := n
4242
# make up the standalone purgatory.ro
4343

4444
PURGATORY_CFLAGS_REMOVE := -mcmodel=kernel
45-
PURGATORY_CFLAGS := -mcmodel=large -ffreestanding -fno-zero-initialized-in-bss -g0
45+
PURGATORY_CFLAGS := -mcmodel=small -ffreestanding -fno-zero-initialized-in-bss -g0
46+
PURGATORY_CFLAGS += -fpic -fvisibility=hidden
4647
PURGATORY_CFLAGS += $(DISABLE_STACKLEAK_PLUGIN) -DDISABLE_BRANCH_PROFILING
4748
PURGATORY_CFLAGS += -fno-stack-protector
4849

include/asm-generic/vmlinux.lds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* linker scripts.
44
*
55
* A minimal linker scripts has following content:
6-
* [This is a sample, architectures may have special requiriements]
6+
* [This is a sample, architectures may have special requirements]
77
*
88
* OUTPUT_FORMAT(...)
99
* OUTPUT_ARCH(...)

0 commit comments

Comments
 (0)