public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/6] x86-64: Stack protector and percpu improvements
@ 2021-11-30 20:55 Brian Gerst
  2021-11-30 20:55 ` [PATCH v2 1/6] x86: Remove stack protector test scripts Brian Gerst
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Brian Gerst @ 2021-11-30 20:55 UTC (permalink / raw)
  To: linux-kernel, x86
  Cc: Andy Lutomirski, Borislav Petkov, Thomas Gleixner,
	H . Peter Anvin, Peter Zijlstra, Brian Gerst

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 how the percpu
section is linked.

Changes from v1:
- Remove fixed location stack protector support

Brian Gerst (6):
  x86: Remove stack protector test scripts
  x86-64: Convert stack protector to normal percpu variable
  x86-64: Use relative per-cpu offsets
  x86-64: Remove inverse relocations
  kallsyms: Remove KALLSYMS_ABSOLUTE_PERCPU
  percpu: Remove PER_CPU_FIRST_SECTION

 arch/x86/Kconfig                          |   7 +-
 arch/x86/Makefile                         |  19 +--
 arch/x86/boot/compressed/misc.c           |  14 +--
 arch/x86/entry/entry_64.S                 |   2 +-
 arch/x86/include/asm/percpu.h             |  22 ----
 arch/x86/include/asm/processor.h          |  25 +---
 arch/x86/include/asm/stackprotector.h     |  36 ++----
 arch/x86/kernel/asm-offsets_64.c          |   6 -
 arch/x86/kernel/cpu/common.c              |   8 +-
 arch/x86/kernel/head_64.S                 |  10 +-
 arch/x86/kernel/irq_64.c                  |   1 -
 arch/x86/kernel/setup_percpu.c            |  12 +-
 arch/x86/kernel/vmlinux.lds.S             |  33 -----
 arch/x86/tools/relocs.c                   | 145 +---------------------
 arch/x86/xen/xen-head.S                   |  10 +-
 include/asm-generic/vmlinux.lds.h         |   1 -
 include/linux/percpu-defs.h               |  12 --
 init/Kconfig                              |  11 +-
 kernel/kallsyms.c                         |  12 +-
 scripts/gcc-x86_32-has-stack-protector.sh |   8 --
 scripts/gcc-x86_64-has-stack-protector.sh |   4 -
 scripts/kallsyms.c                        |  68 ++--------
 scripts/link-vmlinux.sh                   |   4 -
 23 files changed, 56 insertions(+), 414 deletions(-)
 delete mode 100755 scripts/gcc-x86_32-has-stack-protector.sh
 delete mode 100755 scripts/gcc-x86_64-has-stack-protector.sh

-- 
2.31.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-12-02 22:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-30 20:55 [PATCH v2 0/6] x86-64: Stack protector and percpu improvements Brian Gerst
2021-11-30 20:55 ` [PATCH v2 1/6] x86: Remove stack protector test scripts Brian Gerst
2021-11-30 20:55 ` [PATCH v2 2/6] x86-64: Convert stack protector to normal percpu variable Brian Gerst
2021-12-01  9:50   ` David Laight
2021-12-01 14:21     ` Brian Gerst
2021-12-02 22:51     ` Peter Zijlstra
2021-11-30 20:55 ` [PATCH v2 3/6] x86-64: Use relative per-cpu offsets Brian Gerst
2021-11-30 20:55 ` [PATCH v2 4/6] x86-64: Remove inverse relocations Brian Gerst
2021-11-30 20:55 ` [PATCH v2 5/6] kallsyms: Remove KALLSYMS_ABSOLUTE_PERCPU Brian Gerst
2021-11-30 20:55 ` [PATCH v2 6/6] percpu: Remove PER_CPU_FIRST_SECTION Brian Gerst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox