linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nadav Amit <nadav.amit@gmail.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: "open list:MEMORY MANAGEMENT" <linux-mm@kvack.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
	Christoph Lameter <cl@linux.com>,
	Andy Lutomirski <luto@kernel.org>, Ingo Molnar <mingo@kernel.org>,
	Brian Gerst <brgerst@gmail.com>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: Re: [RFC PATCH v2 2/4] percpu: Assorted fixes found by strict percpu address space checks
Date: Mon, 12 Aug 2024 22:09:01 +0300	[thread overview]
Message-ID: <2EF46123-30B0-4A7E-9414-EE25CBCF255E@gmail.com> (raw)
In-Reply-To: <20240812115945.484051-3-ubizjak@gmail.com>


> On 12 Aug 2024, at 14:57, Uros Bizjak <ubizjak@gmail.com> wrote:
> Assorted fixes to prevent defconfig build failures when
> strict percpu address space checks will be enabled.
> 
> These show effeciveness of strict percpu address space checks.

[snip]

> --- a/drivers/base/devres.c
> +++ b/drivers/base/devres.c
> @@ -1231,6 +1231,6 @@ void devm_free_percpu(struct device *dev, void __percpu *pdata)
> 	 * devm_free_pages() does.
> 	 */
> 	WARN_ON(devres_release(dev, devm_percpu_release, devm_percpu_match,
> -			       (__force void *)pdata));
> +			       (__force void *)(uintptr_t)pdata));
> 

Since this pattern of casting appears multiple times (sometimes slightly
different), I think it would be best to give a name for this operation
and put it behind a macro.

This would allow both to audit the cases developers move data between
address-spaces, and also make them think whether what they do makes
sense.



  reply	other threads:[~2024-08-12 19:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-12 11:57 [RFC PATCH v2 0/4] Enable " Uros Bizjak
2024-08-12 11:57 ` [RFC PATCH v2 1/4] percpu: Define pcpu_typeof() Uros Bizjak
2024-08-12 11:57 ` [RFC PATCH v2 2/4] percpu: Assorted fixes found by strict percpu address space checks Uros Bizjak
2024-08-12 19:09   ` Nadav Amit [this message]
2024-08-12 20:36     ` Uros Bizjak
2024-08-12 11:57 ` [RFC PATCH v2 3/4] percpu: Repurpose __percpu tag as a named address space qualifier Uros Bizjak
2024-08-12 19:12   ` Nadav Amit
2024-08-12 20:01     ` Uros Bizjak
2024-08-12 11:57 ` [RFC PATCH v2 4/4] percpu/x86: Enable strict percpu checks via named AS qualifiers Uros Bizjak

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=2EF46123-30B0-4A7E-9414-EE25CBCF255E@gmail.com \
    --to=nadav.amit@gmail.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=cl@linux.com \
    --cc=dennis@kernel.org \
    --cc=dvlasenk@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=ubizjak@gmail.com \
    /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