]> 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>
1  2 
arch/x86/kernel/Makefile
arch/x86/kernel/head_64.S
arch/x86/xen/xen-head.S
tools/objtool/check.c

diff --combined arch/x86/kernel/Makefile
index d8e2b700d1dbe9516e8e73a79f2d61c6175afc71,5f70044340ff1c6a379691c3d9ad6f5959c34bed..fbb0cbd4f2aa8407444417dc1a6727ca84859fc9
@@@ -1,3 -1,4 +1,4 @@@
+ # SPDX-License-Identifier: GPL-2.0
  #
  # Makefile for the linux kernel.
  #
@@@ -26,6 -27,7 +27,6 @@@ KASAN_SANITIZE_dumpstack.o                            := 
  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 42e32c2e51bb5f5125db9032de3b343e37ec5100,6dde3f3fc1f8e7cc213ded1d9098a17649d0e54d..6733cac7cba5b89dd57988ee79639b326c28d2a5
@@@ -1,3 -1,4 +1,4 @@@
+ /* SPDX-License-Identifier: GPL-2.0 */
  /*
   *  linux/arch/x86/kernel/head_64.S -- start in 32bit and switch to 64bit
   *
@@@ -49,7 -50,6 +50,7 @@@ L3_START_KERNEL = pud_index(__START_KER
        .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,7 -89,6 +90,7 @@@
        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.
        movq    $1f, %rax
        jmp     *%rax
  1:
 +      UNWIND_HINT_EMPTY
  
        /* Check if nx is implemented */
        movl    $0x80000001, %eax
        pushq   %rax            # target address in negative space
        lretq
  .Lafter_lret:
 -ENDPROC(secondary_startup_64)
 +END(secondary_startup_64)
  
  #include "verify_cpu.S"
  
   */
  ENTRY(start_cpu0)
        movq    initial_stack(%rip), %rsp
 +      UNWIND_HINT_EMPTY
        jmp     .Ljump_to_C_code
  ENDPROC(start_cpu0)
  #endif
        .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:
        /*
        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
  20:
        decl early_recursion_flag(%rip)
        jmp restore_regs_and_iret
 -ENDPROC(early_idt_handler_common)
 +END(early_idt_handler_common)
  
        __INITDATA
  
@@@ -437,7 -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
diff --combined arch/x86/xen/xen-head.S
index 124941d09b2bc9d85fe835c750e3f7e28566a662,b5b8d7f4355744d24b00404ac9eb35360d5e9e82..497cc55a0c16cccbe64f0a17e2518a6337e7d4e8
@@@ -1,3 -1,4 +1,4 @@@
+ /* SPDX-License-Identifier: GPL-2.0 */
  /* Xen-specific pieces of head.S, intended to be included in the right
        place in head.S */
  
@@@ -9,7 -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,7 -20,6 +21,7 @@@
  #ifdef CONFIG_XEN_PV
        __INIT
  ENTRY(startup_xen)
 +      UNWIND_HINT_EMPTY
        cld
  
        /* Clear .bss */
        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")
diff --combined tools/objtool/check.c
index 83f370fa00c2a7f84c9a1df94e5a85eae591018b,c0e26ad1fa7e3dbd212b3a4fd02fbcc4d8afc74c..9b341584eb1b56b05761bea127ee6cf94eacc190
@@@ -267,12 -267,13 +267,13 @@@ static int decode_instructions(struct o
                                                      &insn->immediate,
                                                      &insn->stack_op);
                        if (ret)
-                               return ret;
+                               goto err;
  
                        if (!insn->type || insn->type > INSN_LAST) {
                                WARN_FUNC("invalid instruction type %d",
                                          insn->sec, insn->offset, insn->type);
-                               return -1;
+                               ret = -1;
+                               goto err;
                        }
  
                        hash_add(file->insn_hash, &insn->hash, insn->offset);
        }
  
        return 0;
+ err:
+       free(insn);
+       return ret;
  }
  
  /*
@@@ -1752,14 -1757,11 +1757,14 @@@ static int validate_branch(struct objto
                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;