2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-23 12:43:55 +08:00

Merge branch 'core/objtool' into x86/asm, to pick up dependent changes

Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
Ingo Molnar 2017-10-23 13:31:17 +02:00
commit bae9525531
6 changed files with 32 additions and 23 deletions

View File

@ -26,7 +26,6 @@ KASAN_SANITIZE_dumpstack.o := n
KASAN_SANITIZE_dumpstack_$(BITS).o := n KASAN_SANITIZE_dumpstack_$(BITS).o := n
KASAN_SANITIZE_stacktrace.o := n KASAN_SANITIZE_stacktrace.o := n
OBJECT_FILES_NON_STANDARD_head_$(BITS).o := y
OBJECT_FILES_NON_STANDARD_relocate_kernel_$(BITS).o := y OBJECT_FILES_NON_STANDARD_relocate_kernel_$(BITS).o := y
OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o := y OBJECT_FILES_NON_STANDARD_ftrace_$(BITS).o := y
OBJECT_FILES_NON_STANDARD_test_nx.o := y OBJECT_FILES_NON_STANDARD_test_nx.o := y

View File

@ -49,6 +49,7 @@ L3_START_KERNEL = pud_index(__START_KERNEL_map)
.code64 .code64
.globl startup_64 .globl startup_64
startup_64: startup_64:
UNWIND_HINT_EMPTY
/* /*
* At this point the CPU runs in 64bit mode CS.L = 1 CS.D = 0, * At this point the CPU runs in 64bit mode CS.L = 1 CS.D = 0,
* and someone has loaded an identity mapped page table * and someone has loaded an identity mapped page table
@ -88,6 +89,7 @@ startup_64:
addq $(early_top_pgt - __START_KERNEL_map), %rax addq $(early_top_pgt - __START_KERNEL_map), %rax
jmp 1f jmp 1f
ENTRY(secondary_startup_64) ENTRY(secondary_startup_64)
UNWIND_HINT_EMPTY
/* /*
* At this point the CPU runs in 64bit mode CS.L = 1 CS.D = 0, * At this point the CPU runs in 64bit mode CS.L = 1 CS.D = 0,
* and someone has loaded a mapped page table. * and someone has loaded a mapped page table.
@ -132,6 +134,7 @@ ENTRY(secondary_startup_64)
movq $1f, %rax movq $1f, %rax
jmp *%rax jmp *%rax
1: 1:
UNWIND_HINT_EMPTY
/* Check if nx is implemented */ /* Check if nx is implemented */
movl $0x80000001, %eax movl $0x80000001, %eax
@ -234,7 +237,7 @@ ENTRY(secondary_startup_64)
pushq %rax # target address in negative space pushq %rax # target address in negative space
lretq lretq
.Lafter_lret: .Lafter_lret:
ENDPROC(secondary_startup_64) END(secondary_startup_64)
#include "verify_cpu.S" #include "verify_cpu.S"
@ -246,6 +249,7 @@ ENDPROC(secondary_startup_64)
*/ */
ENTRY(start_cpu0) ENTRY(start_cpu0)
movq initial_stack(%rip), %rsp movq initial_stack(%rip), %rsp
UNWIND_HINT_EMPTY
jmp .Ljump_to_C_code jmp .Ljump_to_C_code
ENDPROC(start_cpu0) ENDPROC(start_cpu0)
#endif #endif
@ -265,26 +269,24 @@ ENDPROC(start_cpu0)
.quad init_thread_union + THREAD_SIZE - SIZEOF_PTREGS .quad init_thread_union + THREAD_SIZE - SIZEOF_PTREGS
__FINITDATA __FINITDATA
bad_address:
jmp bad_address
__INIT __INIT
ENTRY(early_idt_handler_array) ENTRY(early_idt_handler_array)
# 104(%rsp) %rflags
# 96(%rsp) %cs
# 88(%rsp) %rip
# 80(%rsp) error code
i = 0 i = 0
.rept NUM_EXCEPTION_VECTORS .rept NUM_EXCEPTION_VECTORS
.ifeq (EXCEPTION_ERRCODE_MASK >> i) & 1 .ifeq (EXCEPTION_ERRCODE_MASK >> i) & 1
pushq $0 # Dummy error code, to make stack frame uniform UNWIND_HINT_IRET_REGS
pushq $0 # Dummy error code, to make stack frame uniform
.else
UNWIND_HINT_IRET_REGS offset=8
.endif .endif
pushq $i # 72(%rsp) Vector number pushq $i # 72(%rsp) Vector number
jmp early_idt_handler_common jmp early_idt_handler_common
UNWIND_HINT_IRET_REGS
i = i + 1 i = i + 1
.fill early_idt_handler_array + i*EARLY_IDT_HANDLER_SIZE - ., 1, 0xcc .fill early_idt_handler_array + i*EARLY_IDT_HANDLER_SIZE - ., 1, 0xcc
.endr .endr
ENDPROC(early_idt_handler_array) UNWIND_HINT_IRET_REGS offset=16
END(early_idt_handler_array)
early_idt_handler_common: early_idt_handler_common:
/* /*
@ -312,6 +314,7 @@ early_idt_handler_common:
pushq %r13 /* pt_regs->r13 */ pushq %r13 /* pt_regs->r13 */
pushq %r14 /* pt_regs->r14 */ pushq %r14 /* pt_regs->r14 */
pushq %r15 /* pt_regs->r15 */ pushq %r15 /* pt_regs->r15 */
UNWIND_HINT_REGS
cmpq $14,%rsi /* Page fault? */ cmpq $14,%rsi /* Page fault? */
jnz 10f jnz 10f
@ -327,7 +330,7 @@ early_idt_handler_common:
20: 20:
decl early_recursion_flag(%rip) decl early_recursion_flag(%rip)
jmp restore_regs_and_iret jmp restore_regs_and_iret
ENDPROC(early_idt_handler_common) END(early_idt_handler_common)
__INITDATA __INITDATA
@ -434,7 +437,7 @@ ENTRY(phys_base)
EXPORT_SYMBOL(phys_base) EXPORT_SYMBOL(phys_base)
#include "../../x86/xen/xen-head.S" #include "../../x86/xen/xen-head.S"
__PAGE_ALIGNED_BSS __PAGE_ALIGNED_BSS
NEXT_PAGE(empty_zero_page) NEXT_PAGE(empty_zero_page)
.skip PAGE_SIZE .skip PAGE_SIZE

View File

@ -33,7 +33,7 @@
#include <asm/cpufeatures.h> #include <asm/cpufeatures.h>
#include <asm/msr-index.h> #include <asm/msr-index.h>
verify_cpu: ENTRY(verify_cpu)
pushf # Save caller passed flags pushf # Save caller passed flags
push $0 # Kill any dangerous flags push $0 # Kill any dangerous flags
popf popf
@ -139,3 +139,4 @@ verify_cpu:
popf # Restore caller passed flags popf # Restore caller passed flags
xorl %eax, %eax xorl %eax, %eax
ret ret
ENDPROC(verify_cpu)

View File

@ -9,6 +9,7 @@
#include <asm/boot.h> #include <asm/boot.h>
#include <asm/asm.h> #include <asm/asm.h>
#include <asm/page_types.h> #include <asm/page_types.h>
#include <asm/unwind_hints.h>
#include <xen/interface/elfnote.h> #include <xen/interface/elfnote.h>
#include <xen/interface/features.h> #include <xen/interface/features.h>
@ -19,6 +20,7 @@
#ifdef CONFIG_XEN_PV #ifdef CONFIG_XEN_PV
__INIT __INIT
ENTRY(startup_xen) ENTRY(startup_xen)
UNWIND_HINT_EMPTY
cld cld
/* Clear .bss */ /* Clear .bss */
@ -33,21 +35,24 @@ ENTRY(startup_xen)
mov $init_thread_union+THREAD_SIZE, %_ASM_SP mov $init_thread_union+THREAD_SIZE, %_ASM_SP
jmp xen_start_kernel jmp xen_start_kernel
END(startup_xen)
__FINIT __FINIT
#endif #endif
.pushsection .text .pushsection .text
.balign PAGE_SIZE .balign PAGE_SIZE
ENTRY(hypercall_page) ENTRY(hypercall_page)
.skip PAGE_SIZE .rept (PAGE_SIZE / 32)
UNWIND_HINT_EMPTY
.skip 32
.endr
#define HYPERCALL(n) \ #define HYPERCALL(n) \
.equ xen_hypercall_##n, hypercall_page + __HYPERVISOR_##n * 32; \ .equ xen_hypercall_##n, hypercall_page + __HYPERVISOR_##n * 32; \
.type xen_hypercall_##n, @function; .size xen_hypercall_##n, 32 .type xen_hypercall_##n, @function; .size xen_hypercall_##n, 32
#include <asm/xen-hypercalls.h> #include <asm/xen-hypercalls.h>
#undef HYPERCALL #undef HYPERCALL
END(hypercall_page)
.popsection .popsection
ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux") ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS, .asciz "linux")

View File

@ -1752,11 +1752,14 @@ static int validate_branch(struct objtool_file *file, struct instruction *first,
if (insn->dead_end) if (insn->dead_end)
return 0; return 0;
insn = next_insn; if (!next_insn) {
if (!insn) { if (state.cfa.base == CFI_UNDEFINED)
return 0;
WARN("%s: unexpected end of section", sec->name); WARN("%s: unexpected end of section", sec->name);
return 1; return 1;
} }
insn = next_insn;
} }
return 0; return 0;

View File

@ -70,7 +70,7 @@ static void cmd_usage(void)
printf("\n"); printf("\n");
exit(1); exit(129);
} }
static void handle_options(int *argc, const char ***argv) static void handle_options(int *argc, const char ***argv)
@ -86,9 +86,7 @@ static void handle_options(int *argc, const char ***argv)
break; break;
} else { } else {
fprintf(stderr, "Unknown option: %s\n", cmd); fprintf(stderr, "Unknown option: %s\n", cmd);
fprintf(stderr, "\n Usage: %s\n", cmd_usage();
objtool_usage_string);
exit(1);
} }
(*argv)++; (*argv)++;