linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Dennis Zhou <dennis@kernel.org>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	linux-bcachefs@vger.kernel.org, linux-arch@vger.kernel.org,
	netdev@vger.kernel.org, Thomas Gleixner <tglx@linutronix.de>,
	Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@linux.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andy Lutomirski <luto@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Nadav Amit <nadav.amit@gmail.com>,
	Brian Gerst <brgerst@gmail.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	"H . Peter Anvin" <hpa@zytor.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH v3 0/6] Enable strict percpu address space checks
Date: Mon, 9 Dec 2024 19:59:10 -0800	[thread overview]
Message-ID: <Z1e8jtHt93l0ONu1@V92F7Y9K0C> (raw)
In-Reply-To: <20241208204708.3742696-1-ubizjak@gmail.com>

Hi Uros,

On Sun, Dec 08, 2024 at 09:45:15PM +0100, Uros Bizjak wrote:
> Enable 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. The proposed patch by Dan Carpenter to implement
> __typeof_unqual__() handling in sparse is located at:
> 
> https://lore.kernel.org/lkml/5b8d0dee-8fb6-45af-ba6c-7f74aff9a4b8@stanley.mountain/
> 
> v2: - Add comment to remove test for __CHECKER__ once sparse learns
>       about __typeof_unqual__.
>     - Add Acked-by: tags.
> v3: - Rename __per_cpu_qual to __percpu_qual.
>     - Add more Acked-by: tags.
> 
> 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: Nadav Amit <nadav.amit@gmail.com>
> Cc: Brian Gerst <brgerst@gmail.com>
> Cc: Dan Carpenter <dan.carpenter@linaro.org>
> 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  | 38 ++++++++++++++++++++++++---------
>  arch/x86/kernel/kgdb.c         |  2 +-
>  fs/bcachefs/util.h             |  2 +-
>  include/asm-generic/percpu.h   | 39 ++++++++++++++++++++++------------
>  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, 82 insertions(+), 36 deletions(-)
> 
> -- 
> 2.42.0
> 

This all looks good to me.

Acked-by: Dennis Zhou <dennis@kernel.org>

Thanks,
Dennis


  parent reply	other threads:[~2024-12-10  3:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-08 20:45 Uros Bizjak
2024-12-08 20:45 ` [PATCH v3 1/6] x86/kgdb: Use IS_ERR_PCPU() macro Uros Bizjak
2024-12-08 20:45 ` [PATCH v3 2/6] compiler.h: Introduce TYPEOF_UNQUAL() macro Uros Bizjak
2024-12-09 11:30   ` Peter Zijlstra
2024-12-09 13:01     ` Uros Bizjak
2024-12-10 16:37     ` Uros Bizjak
2024-12-08 20:45 ` [PATCH v3 3/6] percpu: Use TYPEOF_UNQUAL() in variable declarations Uros Bizjak
2024-12-08 20:45 ` [PATCH v3 4/6] percpu: Use TYPEOF_UNQUAL() in *_cpu_ptr() accessors Uros Bizjak
2024-12-08 20:45 ` [PATCH v3 5/6] percpu: Repurpose __percpu tag as a named address space qualifier Uros Bizjak
2024-12-08 20:45 ` [PATCH v3 6/6] percpu/x86: Enable strict percpu checks via named AS qualifiers Uros Bizjak
2024-12-10  3:59 ` Dennis Zhou [this message]
2024-12-13  3:35 ` [PATCH v3 0/6] Enable strict percpu address space checks Andrew Morton
2024-12-13  4:28   ` Uros Bizjak
2024-12-13  7:13   ` Dan Carpenter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z1e8jtHt93l0ONu1@V92F7Y9K0C \
    --to=dennis@kernel.org \
    --cc=brgerst@gmail.com \
    --cc=cl@linux.com \
    --cc=dan.carpenter@linaro.org \
    --cc=hpa@zytor.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-bcachefs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=nadav.amit@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=ubizjak@gmail.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox