linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Nadav Amit <nadav.amit@gmail.com>
Cc: "the arch/x86 maintainers" <x86@kernel.org>,
	linux-sparse@vger.kernel.org,
	 "open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
	 Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-bcachefs@vger.kernel.org,  linux-arch@vger.kernel.org,
	netdev@vger.kernel.org,  Dennis Zhou <dennis@kernel.org>,
	Tejun Heo <tj@kernel.org>, Christoph Lameter <cl@linux.com>,
	 Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
	 Dave Hansen <dave.hansen@linux.intel.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	 Linus Torvalds <torvalds@linux-foundation.org>,
	Andy Lutomirski <luto@kernel.org>,
	 Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Brian Gerst <brgerst@gmail.com>,
	 Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH 6/6] percpu/x86: Enable strict percpu checks via named AS qualifiers
Date: Fri, 29 Nov 2024 17:33:33 +0100	[thread overview]
Message-ID: <CAFULd4Zs32G+NToyGSHv8quQbSOfaEC2UjtQ3vwnn9jufK47rA@mail.gmail.com> (raw)
In-Reply-To: <9CECB9F7-E700-4A92-98B9-6FD027F9CE65@gmail.com>

On Fri, Nov 29, 2024 at 4:45 PM Nadav Amit <nadav.amit@gmail.com> wrote:
>
>
> > On 26 Nov 2024, at 19:21, Uros Bizjak <ubizjak@gmail.com> wrote:
> >
> > This patch declares percpu variables in __seg_gs/__seg_fs named AS
> > and keeps them named AS qualified until they are dereferenced with
> > percpu accessor. This approach enables various compiler check
> > for cross-namespace variable assignments.
>
> [snip]
>
> > @@ -95,9 +95,19 @@
> >
> > #endif /* CONFIG_SMP */
> >
> > -#define __my_cpu_type(var) typeof(var) __percpu_seg_override
> > -#define __my_cpu_ptr(ptr) (__my_cpu_type(*(ptr))*)(__force uintptr_t)(ptr)
> > -#define __my_cpu_var(var) (*__my_cpu_ptr(&(var)))
> > +#if defined(CONFIG_USE_X86_SEG_SUPPORT) && \
> > +    defined(CONFIG_CC_HAS_TYPEOF_UNQUAL) && !defined(__CHECKER__)
>
> Is the __CHECKER__ check because of sparse, as in patch 2/6 ?
> If so, do you want to add a similar comment here?

Yes, this is the same check. We can declare _percpu variables in
__seg_gs named address space only when __typeof_unqual__ is used. I
will add a comment in the next revision of the patchset.

> Other than that, I went over the different patches and it looks good as
> much as I can tell.
>
> If it means anything, you have for the series
>
> Acked-by: Nadav Amit <nadav.amit@gmail.com <mailto:nadav.amit@gmail.com>>

Thanks!

Uros.


  reply	other threads:[~2024-11-29 16:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2024-12-04  7:24 ` [PATCH 0/6] Enable strict percpu address space checks 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=CAFULd4Zs32G+NToyGSHv8quQbSOfaEC2UjtQ3vwnn9jufK47rA@mail.gmail.com \
    --to=ubizjak@gmail.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=cl@linux.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dennis@kernel.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=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    --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=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