Skip to content

Commit 9589351

Browse files
committed
Merge branch 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 boot updates from Ingo Molnar: "Misc cleanups and small enhancements all around the map" * 'x86-boot-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86/boot/compressed: Fix debug_puthex() parameter type x86/setup: Fix static memory detection x86/vmlinux: Drop unneeded linker script discard of .eh_frame x86/*/Makefile: Use -fno-asynchronous-unwind-tables to suppress .eh_frame sections x86/boot/compressed: Remove .eh_frame section from bzImage x86/boot/compressed/64: Remove .bss/.pgtable from bzImage x86/boot/compressed/64: Use 32-bit (zero-extended) MOV for z_output_len x86/boot/compressed/64: Use LEA to initialize boot stack pointer
2 parents 3cd86a5 + c90beea commit 9589351

File tree

12 files changed

+32
-14
lines changed

12 files changed

+32
-14
lines changed

arch/x86/boot/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ clean-files += cpustr.h
6868
KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP
6969
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
7070
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
71+
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
7172
GCOV_PROFILE := n
7273
UBSAN_SANITIZE := n
7374

arch/x86/boot/compressed/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
3939
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
4040
KBUILD_CFLAGS += -Wno-pointer-sign
4141
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
42+
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
4243

4344
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
4445
GCOV_PROFILE := n

arch/x86/boot/compressed/head_64.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated)
529529
leaq input_data(%rip), %rdx /* input_data */
530530
movl $z_input_len, %ecx /* input_len */
531531
movq %rbp, %r8 /* output target address */
532-
movq $z_output_len, %r9 /* decompressed length, end of relocs */
532+
movl $z_output_len, %r9d /* decompressed length, end of relocs */
533533
call extract_kernel /* returns kernel location in %rax */
534534
popq %rsi
535535

@@ -780,7 +780,7 @@ SYM_DATA_END_LABEL(boot_stack, SYM_L_LOCAL, boot_stack_end)
780780
/*
781781
* Space for page tables (not in .bss so not zeroed)
782782
*/
783-
.section ".pgtable","a",@nobits
783+
.section ".pgtable","aw",@nobits
784784
.balign 4096
785785
SYM_DATA_LOCAL(pgtable, .fill BOOT_PGT_SIZE, 1, 0)
786786

arch/x86/boot/compressed/misc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void __puthex(unsigned long value);
5959

6060
static inline void debug_putstr(const char *s)
6161
{ }
62-
static inline void debug_puthex(const char *s)
62+
static inline void debug_puthex(unsigned long value)
6363
{ }
6464
#define debug_putaddr(x) /* */
6565

arch/x86/boot/setup.ld

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ SECTIONS
5252
_end = .;
5353

5454
/DISCARD/ : {
55-
*(.eh_frame)
5655
*(.note*)
5756
}
5857

arch/x86/include/asm/dwarf2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
* Emit CFI data in .debug_frame sections, not .eh_frame sections.
4343
* The latter we currently just discard since we don't do DWARF
4444
* unwinding at runtime. So only the offline DWARF information is
45-
* useful to anyone. Note we should not use this directive if
46-
* vmlinux.lds.S gets changed so it doesn't discard .eh_frame.
45+
* useful to anyone. Note we should not use this directive if we
46+
* ever decide to enable DWARF unwinding at runtime.
4747
*/
4848
.cfi_sections .debug_frame
4949
#else

arch/x86/include/asm/sections.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#ifndef _ASM_X86_SECTIONS_H
33
#define _ASM_X86_SECTIONS_H
44

5+
#define arch_is_kernel_initmem_freed arch_is_kernel_initmem_freed
6+
57
#include <asm-generic/sections.h>
68
#include <asm/extable.h>
79

@@ -14,4 +16,22 @@ extern char __end_rodata_hpage_align[];
1416

1517
extern char __end_of_kernel_reserve[];
1618

19+
extern unsigned long _brk_start, _brk_end;
20+
21+
static inline bool arch_is_kernel_initmem_freed(unsigned long addr)
22+
{
23+
/*
24+
* If _brk_start has not been cleared, brk allocation is incomplete,
25+
* and we can not make assumptions about its use.
26+
*/
27+
if (_brk_start)
28+
return 0;
29+
30+
/*
31+
* After brk allocation is complete, space between _brk_end and _end
32+
* is available for allocation.
33+
*/
34+
return addr >= _brk_end && addr < (unsigned long)&_end;
35+
}
36+
1737
#endif /* _ASM_X86_SECTIONS_H */

arch/x86/kernel/setup.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ RESERVE_BRK(dmi_alloc, 65536);
6464
* at link time, with RESERVE_BRK*() facility reserving additional
6565
* chunks.
6666
*/
67-
static __initdata
6867
unsigned long _brk_start = (unsigned long)__brk_base;
6968
unsigned long _brk_end = (unsigned long)__brk_base;
7069

arch/x86/kernel/vmlinux.lds.S

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,8 @@ SECTIONS
313313

314314
. = ALIGN(8);
315315
/*
316-
* .exit.text is discard at runtime, not link time, to deal with
317-
* references from .altinstructions and .eh_frame
316+
* .exit.text is discarded at runtime, not link time, to deal with
317+
* references from .altinstructions
318318
*/
319319
.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
320320
EXIT_TEXT
@@ -412,9 +412,6 @@ SECTIONS
412412
DWARF_DEBUG
413413

414414
DISCARDS
415-
/DISCARD/ : {
416-
*(.eh_frame)
417-
}
418415
}
419416

420417

arch/x86/realmode/rm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,6 @@ $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
7171
KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
7272
-I$(srctree)/arch/x86/boot
7373
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
74+
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
7475
GCOV_PROFILE := n
7576
UBSAN_SANITIZE := n

0 commit comments

Comments
 (0)