Skip to content

Upgrade READ_ONCE() to RCpc acquire on arm64 with LTO

Will Deacon linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v4 Latest4 patches 7 repliesIn review

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4arm64: alternatives: Split up alternative.harch/arm64/include/asm/alternative-macros.h arch/arm64/include/asm/alternative.h arch/arm64/include/asm/insn.h+279 -2672 replies
2/4arm64: cpufeatures: Add capability for LDAPR instructionarch/arm64/Kconfig arch/arm64/include/asm/cpucaps.h arch/arm64/kernel/cpufeature.c+15 -11 reply
3/4arm64: alternatives: Remove READ_ONCE() usage during patch operationarch/arm64/kernel/alternative.c+4 -31 reply
4/4arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=yarch/arm64/include/asm/rwonce.h arch/arm64/kernel/vdso/Makefile arch/arm64/kernel/vdso32/Makefile +1 more+66 -32 replies

Reviews trailers per patch

All 4 patches have a Reviewed-by or Acked-by.

PatchPeter Zijlstra (Intel)Mark Ryutland
1/4A-b A-b
2/4A-b A-b
3/4A-b A-b
4/4A-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/4] Upgrade READ_ONCE() to RCpc acquire on arm64 with LTO

Hi all,

These patches were previously posted as part of a larger series enabling architectures to override __READ_ONCE():

v3: https://lore.kernel.org/lkml/[email protected]/

With the bulk of that merged, the four patches here override READ_ONCE() so that it gains RCpc acquire semantics on arm64 when LTO is enabled. We can revisit this as and when the compiler provides a means for us to reason about the result of dependency-breaking optimisations. In the meantime, this unblocks LTO for arm64, which I would really like to see merged so that we can focus on enabling CFI.

I plan to queue these on their own branch in the arm64 tree for 5.11 at -rc3.

Cheers,

Will

Cc Kees Cook <[email protected]>
Cc Catalin Marinas <[email protected]>
Cc Sami Tolvanen <[email protected]>
Cc Masahiro Yamada <[email protected]>
Cc Peter Zijlstra <[email protected]>

--->8

Will Deacon (4):
arm64: alternatives: Split up alternative.h
arm64: cpufeatures: Add capability for LDAPR instruction
arm64: alternatives: Remove READ_ONCE() usage during patch operation
arm64: lto: Strengthen READ_ONCE() to acquire when CONFIG_LTO=y

 arch/arm64/Kconfig                          |   3 +
 arch/arm64/include/asm/alternative-macros.h | 276 ++++++++++++++++++++
 arch/arm64/include/asm/alternative.h        | 267 +------------------
 arch/arm64/include/asm/cpucaps.h            |   3 +-
 arch/arm64/include/asm/insn.h               |   3 +-
 arch/arm64/include/asm/rwonce.h             |  63 +++++
 arch/arm64/kernel/alternative.c             |   7 +-
 arch/arm64/kernel/cpufeature.c              |  10 +
 arch/arm64/kernel/vdso/Makefile             |   2 +-
 arch/arm64/kernel/vdso32/Makefile           |   2 +-
 arch/arm64/kernel/vmlinux.lds.S             |   2 +-
 11 files changed, 364 insertions(+), 274 deletions(-)
 create mode 100644 arch/arm64/include/asm/alternative-macros.h
 create mode 100644 arch/arm64/include/asm/rwonce.h
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog