lkml.org 
[lkml]   [2021]   [Nov]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Subject[PATCH 0/3] x86-64: Stack protector and percpu improvements
    Date
    Currently, x86-64 uses an unusual per-cpu layout, where the percpu section
    is linked at absolute address 0. The reason behind this is that older GCC
    versions placed the stack protector (if enabled) at a fixed offset from the
    GS segment base. Since the GS segement is also used for percpu variables,
    this forced the current layout.

    GCC since version 8.1 supports a configurable location for the stack
    protector value, which allows removal of the restriction on where the percpu
    data is linked. Compatibility with older compilers is maintained until
    the minimum compiler version is raised.

    Brian Gerst (3):
    x86-64: Use per-cpu stack canary if supported by compiler
    x86/relocs: Make absolute percpu relocations conditional
    x86_64: Use relative per-cpu offsets

    arch/x86/Kconfig | 9 +++++++++
    arch/x86/Makefile | 21 ++++++++++++++-------
    arch/x86/boot/compressed/Makefile | 3 ++-
    arch/x86/entry/entry_64.S | 6 +++++-
    arch/x86/include/asm/percpu.h | 4 ++--
    arch/x86/include/asm/processor.h | 14 +++++++++++---
    arch/x86/include/asm/stackprotector.h | 17 ++++++-----------
    arch/x86/kernel/asm-offsets_64.c | 2 +-
    arch/x86/kernel/cpu/common.c | 14 ++++++++------
    arch/x86/kernel/head_64.S | 12 ++++++++----
    arch/x86/kernel/setup_percpu.c | 2 +-
    arch/x86/kernel/vmlinux.lds.S | 16 +++++++---------
    arch/x86/tools/relocs.c | 4 ++--
    arch/x86/tools/relocs.h | 4 ++--
    arch/x86/tools/relocs_common.c | 11 ++++++++---
    arch/x86/xen/xen-head.S | 10 ++++------
    init/Kconfig | 1 -
    17 files changed, 90 insertions(+), 60 deletions(-)

    --
    2.31.1

    \
     
     \ /
      Last update: 2021-11-13 13:42    [W:6.417 / U:0.732 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site