• Yinghai Lu's avatar
    x86, percpu: fix kexec with vmlinux · ef3892bd
    Yinghai Lu authored
    Impact: fix regression with kexec with vmlinux
    
    Split data.init into data.init, percpu, data.init2 sections
    instead of let data.init wrap percpu secion.
    
    Thus kexec loading will be happy, because sections will not
    overlap.
    
    Before the patch we have:
    
    Elf file type is EXEC (Executable file)
    Entry point 0x200000
    There are 6 program headers, starting at offset 64
    
    Program Headers:
      Type           Offset             VirtAddr           PhysAddr
                     FileSiz            MemSiz              Flags  Align
      LOAD           0x0000000000200000 0xffffffff80200000 0x0000000000200000
                     0x0000000000ca6000 0x0000000000ca6000  R E    200000
      LOAD           0x0000000000ea6000 0xffffffff80ea6000 0x0000000000ea6000
                     0x000000000014dfe0 0x000000000014dfe0  RWE    200000
      LOAD           0x0000000001000000 0xffffffffff600000 0x0000000000ff4000
                     0x0000000000000888 0x0000000000000888  RWE    200000
      LOAD           0x00000000011f6000 0xffffffff80ff6000 0x0000000000ff6000
                     0x0000000000073086 0x0000000000a2d938  RWE    200000
      LOAD           0x0000000001400000 0x0000000000000000 0x000000000106a000
                     0x00000000001d2ce0 0x00000000001d2ce0  RWE    200000
      NOTE           0x00000000009e2c1c 0xffffffff809e2c1c 0x00000000009e2c1c
                     0x0000000000000024 0x0000000000000024         4
    
     Section to Segment mapping:
      Segment Sections...
       00     .text .notes __ex_table .rodata __bug_table .pci_fixup .builtin_fw __ksymtab __ksymtab_gpl __ksymtab_strings __init_rodata __param
       01     .data .init.rodata .data.cacheline_aligned .data.read_mostly
       02     .vsyscall_0 .vsyscall_fn .vsyscall_gtod_data .vsyscall_1 .vsyscall_2 .vgetcpu_mode .jiffies
       03     .data.init_task .smp_locks .init.text .init.data .init.setup .initcall.init .con_initcall.init .x86_cpu_dev.init .altinstructions .altinstr_replacement .exit.text .init.ramfs .bss
       04     .data.percpu
       05     .notes
    
    After patch we've got:
    
    Elf file type is EXEC (Executable file)
    Entry point 0x200000
    There are 7 program headers, starting at offset 64
    
    Program Headers:
      Type           Offset             VirtAddr           PhysAddr
                     FileSiz            MemSiz              Flags  Align
      LOAD           0x0000000000200000 0xffffffff80200000 0x0000000000200000
                     0x0000000000ca6000 0x0000000000ca6000  R E    200000
      LOAD           0x0000000000ea6000 0xffffffff80ea6000 0x0000000000ea6000
                     0x000000000014dfe0 0x000000000014dfe0  RWE    200000
      LOAD           0x0000000001000000 0xffffffffff600000 0x0000000000ff4000
                     0x0000000000000888 0x0000000000000888  RWE    200000
      LOAD           0x00000000011f6000 0xffffffff80ff6000 0x0000000000ff6000
                     0x0000000000073086 0x0000000000073086  RWE    200000
      LOAD           0x0000000001400000 0x0000000000000000 0x000000000106a000
                     0x00000000001d2ce0 0x00000000001d2ce0  RWE    200000
      LOAD           0x000000000163d000 0xffffffff8123d000 0x000000000123d000
                     0x0000000000000000 0x00000000007e6938  RWE    200000
      NOTE           0x00000000009e2c1c 0xffffffff809e2c1c 0x00000000009e2c1c
                     0x0000000000000024 0x0000000000000024         4
    
     Section to Segment mapping:
      Segment Sections...
       00     .text .notes __ex_table .rodata __bug_table .pci_fixup .builtin_fw __ksymtab __ksymtab_gpl __ksymtab_strings __init_rodata __param
       01     .data .init.rodata .data.cacheline_aligned .data.read_mostly
       02     .vsyscall_0 .vsyscall_fn .vsyscall_gtod_data .vsyscall_1 .vsyscall_2 .vgetcpu_mode .jiffies
       03     .data.init_task .smp_locks .init.text .init.data .init.setup .initcall.init .con_initcall.init .x86_cpu_dev.init .altinstructions .altinstr_replacement .exit.text .init.ramfs
       04     .data.percpu
       05     .bss
       06     .notes
    Signed-off-by: default avatarYinghai Lu <yinghai@kernel.org>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    ef3892bd
vmlinux_64.lds.S 6.81 KB