Skip to content

Enable strict percpu address space checks

Uros Bizjak linux-arch linux-bcachefs linux-mm linux-sparse lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6x86/kgdb: Use IS_ERR_PCPU() macroarch/x86/kernel/kgdb.c+1 -10 replies
2/6compiler.h: Introduce TYPEOF_UNQUAL() macroinclude/linux/compiler.h init/Kconfig+16 -00 replies
3/6percpu: Use TYPEOF_UNQUAL() in variable declarationsarch/x86/include/asm/percpu.h fs/bcachefs/util.h include/asm-generic/percpu.h +5 more+27 -280 replies
4/6percpu: Use TYPEOF_UNQUAL() in *_cpu_ptr() accessorsarch/x86/include/asm/percpu.h include/linux/percpu-defs.h+7 -30 replies
5/6percpu: Repurpose __percpu tag as a named address space qualifierinclude/asm-generic/percpu.h include/linux/compiler_types.h+16 -10 replies
6/6percpu/x86: Enable strict percpu checks via named AS qualifiersarch/x86/include/asm/percpu.h+13 -32 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchNadav Amit
1/6
2/6
3/6
4/6
5/6
6/6A-b

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

Read the v1 thread

Cover letter [PATCH 0/6] Enable strict percpu address space checks

This patchset enables strict percpu address space checks via x86 named address space qualifiers. Percpu variables are declared in __seg_gs/__seg_fs named AS and kept named AS qualified until they are dereferenced via percpu accessor. This approach enables various compiler checks for cross-namespace variable assignments.

Please note that current version of sparse doesn't know anything about __typeof_unqual__() operator. Avoid the usage of __typeof_unqual__() when sparse checking is active to prevent sparse errors with unknowing keyword.

Cc Thomas Gleixner <[email protected]>
Cc Dennis Zhou <[email protected]>
Cc Tejun Heo <[email protected]>
Cc Christoph Lameter <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Andy Lutomirski <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Luc Van Oostenryck <[email protected]>
Cc Nadav Amit <[email protected]>
Cc Brian Gerst <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Peter Zijlstra <[email protected]>

Uros Bizjak (6):
x86/kgdb: Use IS_ERR_PCPU() macro
compiler.h: Introduce TYPEOF_UNQUAL() macro
percpu: Use TYPEOF_UNQUAL() in variable declarations
percpu: Use TYPEOF_UNQUAL() in *_cpu_ptr() accessors
percpu: Repurpose __percpu tag as a named address space qualifier percpu/x86: Enable strict percpu checks via named AS qualifiers

 arch/x86/include/asm/percpu.h  | 34 +++++++++++++++++++---------
 arch/x86/kernel/kgdb.c         |  2 +-
 fs/bcachefs/util.h             |  2 +-
 include/asm-generic/percpu.h   | 41 +++++++++++++++++++++++-----------
 include/linux/compiler.h       | 13 +++++++++++
 include/linux/compiler_types.h |  2 +-
 include/linux/part_stat.h      |  2 +-
 include/linux/percpu-defs.h    |  6 ++---
 include/net/snmp.h             |  5 ++---
 init/Kconfig                   |  3 +++
 kernel/locking/percpu-rwsem.c  |  2 +-
 net/mpls/internal.h            |  4 ++--
 12 files changed, 80 insertions(+), 36 deletions(-)
Signature · 1 line
2.42.0