]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge branch 'linus' into core/objtool, to pick up dependent fixes
authorIngo Molnar <mingo@kernel.org>
Tue, 7 Nov 2017 09:48:05 +0000 (10:48 +0100)
committerIngo Molnar <mingo@kernel.org>
Tue, 7 Nov 2017 09:48:05 +0000 (10:48 +0100)
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/Makefile
arch/x86/kernel/head_64.S
arch/x86/kernel/verify_cpu.S
arch/x86/xen/xen-head.S
tools/objtool/check.c
tools/objtool/objtool.c

index 5f70044340ff1c6a379691c3d9ad6f5959c34bed..fbb0cbd4f2aa8407444417dc1a6727ca84859fc9 100644 (file)
@@ -27,7 +27,6 @@ KASAN_SANITIZE_dumpstack.o                            := n
 KASAN_SANITIZE_dumpstack_$(BITS).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_ftrace_$(BITS).o             := y
 OBJECT_FILES_NON_STANDARD_test_nx.o                    := y
index 6dde3f3fc1f8e7cc213ded1d9098a17649d0e54d..6733cac7cba5b89dd57988ee79639b326c28d2a5 100644 (file)
@@ -50,6 +50,7 @@ L3_START_KERNEL = pud_index(__START_KERNEL_map)
        .code64
        .globl startup_64
 startup_64:
+       UNWIND_HINT_EMPTY
        /*
         * At this point the CPU runs in 64bit mode CS.L = 1 CS.D = 0,
         * and someone has loaded an identity mapped page table
@@ -89,6 +90,7 @@ startup_64:
        addq    $(early_top_pgt - __START_KERNEL_map), %rax
        jmp 1f
 ENTRY(secondary_startup_64)
+       UNWIND_HINT_EMPTY
        /*
         * At this point the CPU runs in 64bit mode CS.L = 1 CS.D = 0,
         * and someone has loaded a mapped page table.
@@ -133,6 +135,7 @@ ENTRY(secondary_startup_64)
        movq    $1f, %rax
        jmp     *%rax
 1:
+       UNWIND_HINT_EMPTY
 
        /* Check if nx is implemented */
        movl    $0x80000001, %eax
@@ -235,7 +238,7 @@ ENTRY(secondary_startup_64)
        pushq   %rax            # target address in negative space
        lretq
 .Lafter_lret:
-ENDPROC(secondary_startup_64)
+END(secondary_startup_64)
 
 #include "verify_cpu.S"
 
@@ -247,6 +250,7 @@ ENDPROC(secondary_startup_64)
  */
 ENTRY(start_cpu0)
        movq    initial_stack(%rip), %rsp
+       UNWIND_HINT_EMPTY
        jmp     .Ljump_to_C_code
 ENDPROC(start_cpu0)
 #endif
@@ -266,26 +270,24 @@ ENDPROC(start_cpu0)
        .quad  init_thread_union + THREAD_SIZE - SIZEOF_PTREGS
        __FINITDATA
 
-bad_address:
-       jmp bad_address
-
        __INIT
 ENTRY(early_idt_handler_array)
-       # 104(%rsp) %rflags
-       #  96(%rsp) %cs
-       #  88(%rsp) %rip
-       #  80(%rsp) error code
        i = 0
        .rept NUM_EXCEPTION_VECTORS
        .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
        pushq $i                # 72(%rsp) Vector number
        jmp early_idt_handler_common
+       UNWIND_HINT_IRET_REGS
        i = i + 1
        .fill early_idt_handler_array + i*EARLY_IDT_HANDLER_SIZE - ., 1, 0xcc
        .endr
-ENDPROC(early_idt_handler_array)
+       UNWIND_HINT_IRET_REGS offset=16
+END(early_idt_handler_array)
 
 early_idt_handler_common:
        /*
@@ -313,6 +315,7 @@ early_idt_handler_common:
        pushq %r13                              /* pt_regs->r13 */
        pushq %r14                              /* pt_regs->r14 */
        pushq %r15                              /* pt_regs->r15 */
+       UNWIND_HINT_REGS
 
        cmpq $14,%rsi           /* Page fault? */
        jnz 10f
@@ -328,7 +331,7 @@ early_idt_handler_common:
 20:
        decl early_recursion_flag(%rip)
        jmp restore_regs_and_iret
-ENDPROC(early_idt_handler_common)
+END(early_idt_handler_common)
 
        __INITDATA
 
@@ -435,7 +438,7 @@ ENTRY(phys_base)
 EXPORT_SYMBOL(phys_base)
 
 #include "../../x86/xen/xen-head.S"
-       
+
        __PAGE_ALIGNED_BSS
 NEXT_PAGE(empty_zero_page)
        .skip PAGE_SIZE
index 014ea59aa153e4f37725dd8771cdb37d88371e34..3d3c2f71f61719b8d504031e03171430c48d9dab 100644 (file)
@@ -33,7 +33,7 @@
 #include <asm/cpufeatures.h>
 #include <asm/msr-index.h>
 
-verify_cpu:
+ENTRY(verify_cpu)
        pushf                           # Save caller passed flags
        push    $0                      # Kill any dangerous flags
        popf
@@ -139,3 +139,4 @@ verify_cpu:
        popf                            # Restore caller passed flags
        xorl %eax, %eax
        ret
+ENDPROC(verify_cpu)
index b5b8d7f4355744d24b00404ac9eb35360d5e9e82..497cc55a0c16cccbe64f0a17e2518a6337e7d4e8 100644 (file)
@@ -10,6 +10,7 @@
 #include <asm/boot.h>
 #include <asm/asm.h>
 #include <asm/page_types.h>
+#include <asm/unwind_hints.h>
 
 #include <xen/interface/elfnote.h>
 #include <xen/interface/features.h>
@@ -20,6 +21,7 @@
 #ifdef CONFIG_XEN_PV
        __INIT
 ENTRY(startup_xen)
+       UNWIND_HINT_EMPTY
        cld
 
        /* Clear .bss */
@@ -34,21 +36,24 @@ ENTRY(startup_xen)
        mov $init_thread_union+THREAD_SIZE, %_ASM_SP
 
        jmp xen_start_kernel
-
+END(startup_xen)
        __FINIT
 #endif
 
 .pushsection .text
        .balign PAGE_SIZE
 ENTRY(hypercall_page)
-       .skip PAGE_SIZE
+       .rept (PAGE_SIZE / 32)
+               UNWIND_HINT_EMPTY
+               .skip 32
+       .endr
 
 #define HYPERCALL(n) \
        .equ xen_hypercall_##n, hypercall_page + __HYPERVISOR_##n * 32; \
        .type xen_hypercall_##n, @function; .size xen_hypercall_##n, 32
 #include <asm/xen-hypercalls.h>
 #undef HYPERCALL
-
+END(hypercall_page)
 .popsection
 
        ELFNOTE(Xen, XEN_ELFNOTE_GUEST_OS,       .asciz "linux")
index c0e26ad1fa7e3dbd212b3a4fd02fbcc4d8afc74c..9b341584eb1b56b05761bea127ee6cf94eacc190 100644 (file)
@@ -1757,11 +1757,14 @@ static int validate_branch(struct objtool_file *file, struct instruction *first,
                if (insn->dead_end)
                        return 0;
 
-               insn = next_insn;
-               if (!insn) {
+               if (!next_insn) {
+                       if (state.cfa.base == CFI_UNDEFINED)
+                               return 0;
                        WARN("%s: unexpected end of section", sec->name);
                        return 1;
                }
+
+               insn = next_insn;
        }
 
        return 0;
index 31e0f91438400677d654f0d23ea1011dc69588ed..07f32991982840b74b6feaed10056c4a0127083c 100644 (file)
@@ -70,7 +70,7 @@ static void cmd_usage(void)
 
        printf("\n");
 
-       exit(1);
+       exit(129);
 }
 
 static void handle_options(int *argc, const char ***argv)
@@ -86,9 +86,7 @@ static void handle_options(int *argc, const char ***argv)
                        break;
                } else {
                        fprintf(stderr, "Unknown option: %s\n", cmd);
-                       fprintf(stderr, "\n Usage: %s\n",
-                               objtool_usage_string);
-                       exit(1);
+                       cmd_usage();
                }
 
                (*argv)++;