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
This commit is contained in:
commit
9589351ccf
@ -68,6 +68,7 @@ clean-files += cpustr.h
|
|||||||
KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP
|
KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP
|
||||||
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
||||||
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
||||||
|
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
|
||||||
GCOV_PROFILE := n
|
GCOV_PROFILE := n
|
||||||
UBSAN_SANITIZE := n
|
UBSAN_SANITIZE := n
|
||||||
|
|
||||||
|
@ -39,6 +39,7 @@ KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
|
|||||||
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
|
KBUILD_CFLAGS += $(call cc-disable-warning, gnu)
|
||||||
KBUILD_CFLAGS += -Wno-pointer-sign
|
KBUILD_CFLAGS += -Wno-pointer-sign
|
||||||
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
KBUILD_CFLAGS += $(call cc-option,-fmacro-prefix-map=$(srctree)/=)
|
||||||
|
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
|
||||||
|
|
||||||
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
||||||
GCOV_PROFILE := n
|
GCOV_PROFILE := n
|
||||||
|
@ -529,7 +529,7 @@ SYM_FUNC_START_LOCAL_NOALIGN(.Lrelocated)
|
|||||||
leaq input_data(%rip), %rdx /* input_data */
|
leaq input_data(%rip), %rdx /* input_data */
|
||||||
movl $z_input_len, %ecx /* input_len */
|
movl $z_input_len, %ecx /* input_len */
|
||||||
movq %rbp, %r8 /* output target address */
|
movq %rbp, %r8 /* output target address */
|
||||||
movq $z_output_len, %r9 /* decompressed length, end of relocs */
|
movl $z_output_len, %r9d /* decompressed length, end of relocs */
|
||||||
call extract_kernel /* returns kernel location in %rax */
|
call extract_kernel /* returns kernel location in %rax */
|
||||||
popq %rsi
|
popq %rsi
|
||||||
|
|
||||||
@ -780,7 +780,7 @@ SYM_DATA_END_LABEL(boot_stack, SYM_L_LOCAL, boot_stack_end)
|
|||||||
/*
|
/*
|
||||||
* Space for page tables (not in .bss so not zeroed)
|
* Space for page tables (not in .bss so not zeroed)
|
||||||
*/
|
*/
|
||||||
.section ".pgtable","a",@nobits
|
.section ".pgtable","aw",@nobits
|
||||||
.balign 4096
|
.balign 4096
|
||||||
SYM_DATA_LOCAL(pgtable, .fill BOOT_PGT_SIZE, 1, 0)
|
SYM_DATA_LOCAL(pgtable, .fill BOOT_PGT_SIZE, 1, 0)
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ void __puthex(unsigned long value);
|
|||||||
|
|
||||||
static inline void debug_putstr(const char *s)
|
static inline void debug_putstr(const char *s)
|
||||||
{ }
|
{ }
|
||||||
static inline void debug_puthex(const char *s)
|
static inline void debug_puthex(unsigned long value)
|
||||||
{ }
|
{ }
|
||||||
#define debug_putaddr(x) /* */
|
#define debug_putaddr(x) /* */
|
||||||
|
|
||||||
|
@ -52,7 +52,6 @@ SECTIONS
|
|||||||
_end = .;
|
_end = .;
|
||||||
|
|
||||||
/DISCARD/ : {
|
/DISCARD/ : {
|
||||||
*(.eh_frame)
|
|
||||||
*(.note*)
|
*(.note*)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
* Emit CFI data in .debug_frame sections, not .eh_frame sections.
|
* Emit CFI data in .debug_frame sections, not .eh_frame sections.
|
||||||
* The latter we currently just discard since we don't do DWARF
|
* The latter we currently just discard since we don't do DWARF
|
||||||
* unwinding at runtime. So only the offline DWARF information is
|
* unwinding at runtime. So only the offline DWARF information is
|
||||||
* useful to anyone. Note we should not use this directive if
|
* useful to anyone. Note we should not use this directive if we
|
||||||
* vmlinux.lds.S gets changed so it doesn't discard .eh_frame.
|
* ever decide to enable DWARF unwinding at runtime.
|
||||||
*/
|
*/
|
||||||
.cfi_sections .debug_frame
|
.cfi_sections .debug_frame
|
||||||
#else
|
#else
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
#ifndef _ASM_X86_SECTIONS_H
|
#ifndef _ASM_X86_SECTIONS_H
|
||||||
#define _ASM_X86_SECTIONS_H
|
#define _ASM_X86_SECTIONS_H
|
||||||
|
|
||||||
|
#define arch_is_kernel_initmem_freed arch_is_kernel_initmem_freed
|
||||||
|
|
||||||
#include <asm-generic/sections.h>
|
#include <asm-generic/sections.h>
|
||||||
#include <asm/extable.h>
|
#include <asm/extable.h>
|
||||||
|
|
||||||
@ -14,4 +16,22 @@ extern char __end_rodata_hpage_align[];
|
|||||||
|
|
||||||
extern char __end_of_kernel_reserve[];
|
extern char __end_of_kernel_reserve[];
|
||||||
|
|
||||||
|
extern unsigned long _brk_start, _brk_end;
|
||||||
|
|
||||||
|
static inline bool arch_is_kernel_initmem_freed(unsigned long addr)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* If _brk_start has not been cleared, brk allocation is incomplete,
|
||||||
|
* and we can not make assumptions about its use.
|
||||||
|
*/
|
||||||
|
if (_brk_start)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* After brk allocation is complete, space between _brk_end and _end
|
||||||
|
* is available for allocation.
|
||||||
|
*/
|
||||||
|
return addr >= _brk_end && addr < (unsigned long)&_end;
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* _ASM_X86_SECTIONS_H */
|
#endif /* _ASM_X86_SECTIONS_H */
|
||||||
|
@ -64,7 +64,6 @@ RESERVE_BRK(dmi_alloc, 65536);
|
|||||||
* at link time, with RESERVE_BRK*() facility reserving additional
|
* at link time, with RESERVE_BRK*() facility reserving additional
|
||||||
* chunks.
|
* chunks.
|
||||||
*/
|
*/
|
||||||
static __initdata
|
|
||||||
unsigned long _brk_start = (unsigned long)__brk_base;
|
unsigned long _brk_start = (unsigned long)__brk_base;
|
||||||
unsigned long _brk_end = (unsigned long)__brk_base;
|
unsigned long _brk_end = (unsigned long)__brk_base;
|
||||||
|
|
||||||
|
@ -313,8 +313,8 @@ SECTIONS
|
|||||||
|
|
||||||
. = ALIGN(8);
|
. = ALIGN(8);
|
||||||
/*
|
/*
|
||||||
* .exit.text is discard at runtime, not link time, to deal with
|
* .exit.text is discarded at runtime, not link time, to deal with
|
||||||
* references from .altinstructions and .eh_frame
|
* references from .altinstructions
|
||||||
*/
|
*/
|
||||||
.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
|
.exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
|
||||||
EXIT_TEXT
|
EXIT_TEXT
|
||||||
@ -412,9 +412,6 @@ SECTIONS
|
|||||||
DWARF_DEBUG
|
DWARF_DEBUG
|
||||||
|
|
||||||
DISCARDS
|
DISCARDS
|
||||||
/DISCARD/ : {
|
|
||||||
*(.eh_frame)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,5 +71,6 @@ $(obj)/realmode.relocs: $(obj)/realmode.elf FORCE
|
|||||||
KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
|
KBUILD_CFLAGS := $(REALMODE_CFLAGS) -D_SETUP -D_WAKEUP \
|
||||||
-I$(srctree)/arch/x86/boot
|
-I$(srctree)/arch/x86/boot
|
||||||
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
|
||||||
|
KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
|
||||||
GCOV_PROFILE := n
|
GCOV_PROFILE := n
|
||||||
UBSAN_SANITIZE := n
|
UBSAN_SANITIZE := n
|
||||||
|
@ -71,7 +71,6 @@ SECTIONS
|
|||||||
/DISCARD/ : {
|
/DISCARD/ : {
|
||||||
*(.note*)
|
*(.note*)
|
||||||
*(.debug*)
|
*(.debug*)
|
||||||
*(.eh_frame*)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "pasyms.h"
|
#include "pasyms.h"
|
||||||
|
@ -12,7 +12,8 @@ cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \
|
|||||||
-mno-mmx -mno-sse -fshort-wchar \
|
-mno-mmx -mno-sse -fshort-wchar \
|
||||||
-Wno-pointer-sign \
|
-Wno-pointer-sign \
|
||||||
$(call cc-disable-warning, address-of-packed-member) \
|
$(call cc-disable-warning, address-of-packed-member) \
|
||||||
$(call cc-disable-warning, gnu)
|
$(call cc-disable-warning, gnu) \
|
||||||
|
-fno-asynchronous-unwind-tables
|
||||||
|
|
||||||
# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
|
# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
|
||||||
# disable the stackleak plugin
|
# disable the stackleak plugin
|
||||||
|
Loading…
Reference in New Issue
Block a user