linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Enable strict percpu address space checks
@ 2024-11-26 17:21 Uros Bizjak
  2024-11-26 17:21 ` [PATCH 1/6] x86/kgdb: Use IS_ERR_PCPU() macro Uros Bizjak
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Uros Bizjak @ 2024-11-26 17:21 UTC (permalink / raw)
  To: x86, linux-sparse, linux-mm, linux-kernel, linux-bcachefs,
	linux-arch, netdev
  Cc: Uros Bizjak, Thomas Gleixner, Dennis Zhou, Tejun Heo,
	Christoph Lameter, Linus Torvalds, Andy Lutomirski, Ingo Molnar,
	Luc Van Oostenryck, Nadav Amit, Brian Gerst, H . Peter Anvin,
	Peter Zijlstra

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 <tglx@linutronix.de>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Nadav Amit <nadav.amit@gmail.com>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Peter Zijlstra <peterz@infradead.org>

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(-)

-- 
2.42.0



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

end of thread, other threads:[~2024-12-04  7:24 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-11-26 17:21 [PATCH 0/6] Enable strict percpu address space checks Uros Bizjak
2024-11-26 17:21 ` [PATCH 1/6] x86/kgdb: Use IS_ERR_PCPU() macro Uros Bizjak
2024-11-26 17:21 ` [PATCH 2/6] compiler.h: Introduce TYPEOF_UNQUAL() macro Uros Bizjak
2024-11-26 17:21 ` [PATCH 3/6] percpu: Use TYPEOF_UNQUAL() in variable declarations Uros Bizjak
2024-11-26 17:21 ` [PATCH 4/6] percpu: Use TYPEOF_UNQUAL() in *_cpu_ptr() accessors Uros Bizjak
2024-11-26 17:21 ` [PATCH 5/6] percpu: Repurpose __percpu tag as a named address space qualifier Uros Bizjak
2024-11-26 17:21 ` [PATCH 6/6] percpu/x86: Enable strict percpu checks via named AS qualifiers Uros Bizjak
2024-11-29 15:45   ` Nadav Amit
2024-11-29 16:33     ` Uros Bizjak
2024-12-04  7:24 ` [PATCH 0/6] Enable strict percpu address space checks Dan Carpenter

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