Skip to content

arm64: Fix instrumentation escapes from noinstr path

Jisheng Zhang linux-arm-kernel linux-mm lkml sashiko-reviews 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 1 replyIn review
  2. v14 patches 2 repliesSuperseded

Changes in v2 from the cover letter

Mainly address sashiko review comments:
- add always inline to per cpu helpers
- use tif_test_bit() instead of test_thread_flag() in sme_enter_from_user_mode and sme_exit_to_user_mode
- a new patch to mark kasan_hw_tags_enabled always inlined
- a new patch to Disable branch profiling for architecture library code

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6arm64: percpu: Always inline helpers used by noinstr codearch/arm64/include/asm/percpu.h+9 -90 replies
2/6arm64: entry: Always inline helpers used by non-instrumentable pathsarch/arm64/include/asm/cpufeature.h arch/arm64/include/asm/entry-common.h arch/arm64/include/asm/fpsimd.h +2 more+16 -161 reply
3/6kasan: Always inline kasan_hw_tags_enabled()include/linux/kasan-enabled.h+2 -20 replies
4/6arm64: stacktrace: Always inline internal stack boundary helpersarch/arm64/include/asm/stacktrace.h arch/arm64/include/asm/stacktrace/common.h+14 -140 replies
5/6arm64: lib: Disable branch profiling for architecture library codearch/arm64/lib/Makefile+4 -00 replies
6/6arm64: alternatives: Make branch and ADRP offset helpers noinstarch/arm64/lib/insn.c+37 -200 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/6] arm64: Fix instrumentation escapes from noinstr path

Code marked with noinstr can only safely call other noinstr or __always_inline functions. When reading arm64 source code, I found necessary noinstr markers is missing somewhere. So I asked AI to scan the arm64, this series is the result.

Since v1:
Mainly address sashiko review comments:
- add always inline to per cpu helpers
- use tif_test_bit() instead of test_thread_flag() in sme_enter_from_user_mode and sme_exit_to_user_mode
- a new patch to mark kasan_hw_tags_enabled always inlined
- a new patch to Disable branch profiling for architecture library code

Jisheng Zhang (6):
arm64: percpu: Always inline helpers used by noinstr code
arm64: entry: Always inline helpers used by non-instrumentable paths
kasan: Always inline kasan_hw_tags_enabled()
arm64: stacktrace: Always inline internal stack boundary helpers
arm64: lib: Disable branch profiling for architecture library code
arm64: alternatives: Make branch and ADRP offset helpers noinst

 arch/arm64/include/asm/cpufeature.h        |  8 +--
 arch/arm64/include/asm/entry-common.h      |  2 +-
 arch/arm64/include/asm/fpsimd.h            |  8 +--
 arch/arm64/include/asm/mte-kasan.h         |  4 +-
 arch/arm64/include/asm/mte.h               | 10 ++--
 arch/arm64/include/asm/percpu.h            | 18 +++----
 arch/arm64/include/asm/stacktrace.h        | 16 +++---
 arch/arm64/include/asm/stacktrace/common.h | 12 ++---
 arch/arm64/lib/Makefile                    |  4 ++
 arch/arm64/lib/insn.c                      | 57 ++++++++++++++--------
 include/linux/kasan-enabled.h              |  4 +-
 11 files changed, 82 insertions(+), 61 deletions(-)
Signature · 1 line
2.55.0