Skip to content

Introduce %rip-relative addressing to PER_CPU_VAR macro

Uros Bizjak lkml xen-devel 2 versions In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 6 repliesIn review
  2. v14 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4x86/percpu: Introduce PER_CPU_ARG and use it in cmpxchg{8,16}b_emu.Sarch/x86/include/asm/percpu.h arch/x86/lib/cmpxchg16b_emu.S arch/x86/lib/cmpxchg8b_emu.S+26 -120 replies
2/4x86/percpu: Correct PER_CPU_VAR usage to include symbol and its addendarch/x86/entry/calling.h arch/x86/entry/entry_32.S arch/x86/entry/entry_64.S +1 more+4 -40 replies
3/4x86/percpu, xen: Correct PER_CPU_VAR usage to include symbol and its addendarch/x86/xen/xen-asm.S+5 -50 replies
4/4x86/percpu: Introduce %rip-relative addressing to PER_CPU_VAR macroarch/x86/include/asm/percpu.h+5 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/4] Introduce %rip-relative addressing to PER_CPU_VAR macro

The following patch series introduces %rip-relative addressing to PER_CPU_VAR macro. Instruction with %rip-relative address operand is one byte shorter than its absolute address counterpart and is also compatible with position independent executable (-fpie) build.

The first three patches are cleanups that fix various inconsistencies throughout the assembly code.

The last patch introduces (%rip) suffix and uses it for x86_64 target, resulting in a small code size decrease:

text data bss dec hex filename

25510677        4386685  808388 30705750        1d48856 vmlinux-new.o
25510629        4386685  808388 30705702        1d48826 vmlinux-old.o

Patch series is against current mainline and can be applied independently of ongoing percpu work.

v2: Introduce PER_CPU_ARG macro to conditionally enable
segment registers in cmpxchg{8,16}b_emu.S for CONFIG_SMP.

Cc Juergen Gross <[email protected]>
Cc Boris Ostrovsky <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc "H. Peter Anvin" <[email protected]>

Uros Bizjak (4):
x86/percpu: Introduce PER_CPU_ARG and use it in cmpxchg{8,16}b_emu.S x86/percpu: Correct PER_CPU_VAR usage to include symbol and its addend x86/percpu, xen: Correct PER_CPU_VAR usage to include symbol and its
addend
x86/percpu: Introduce %rip-relative addressing to PER_CPU_VAR macro

 arch/x86/entry/calling.h      |  2 +-
 arch/x86/entry/entry_32.S     |  2 +-
 arch/x86/entry/entry_64.S     |  2 +-
 arch/x86/include/asm/percpu.h | 10 +++++++---
 arch/x86/kernel/head_64.S     |  2 +-
 arch/x86/lib/cmpxchg16b_emu.S | 12 ++++++------
 arch/x86/lib/cmpxchg8b_emu.S  | 24 ++++++++++++++++++------
 arch/x86/xen/xen-asm.S        | 10 +++++-----
 8 files changed, 40 insertions(+), 24 deletions(-)
Signature · 1 line
2.41.0