public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2] arm64/signal: Silence sparse warning storing GCSPR_EL0
Date: Fri, 13 Dec 2024 16:45:04 +0000	[thread overview]
Message-ID: <418e279e-0628-473f-bd3c-4aa5e2d4dbcc@sirena.org.uk> (raw)
In-Reply-To: <Z1xgQGNZzR6h0Uly@arm.com>

[-- Attachment #1: Type: text/plain, Size: 1297 bytes --]

On Fri, Dec 13, 2024 at 04:26:40PM +0000, Catalin Marinas wrote:
> On Wed, Dec 11, 2024 at 01:00:35AM +0000, Mark Brown wrote:

> > -static bool gcs_signal_cap_valid(u64 addr, u64 val)
> > +static bool gcs_signal_cap_valid(unsigned long __user *addr, u64 val)
> >  {
> >  	return val == GCS_SIGNAL_CAP(addr);
> >  }

> Another personal preference - addresses should be (unsigned long),
> pointer to be accessed (... __user *). But we could even scrap this
> function, there's a single caller to a one-line function.

I'm not sure I follow what you're saying here - the pointer here is an
unsigned long __user *?  The value in val is not a pointer or address,
it's a cap value derived from a pointer.  But yeah, we could inline and
render it moot.

> > -	write_sysreg_s(gcspr_el0 + 1, SYS_GCSPR_EL0);
> > +	write_sysreg_s((__force u64)(gcspr_el0 + 1), SYS_GCSPR_EL0);

> Looking through the code, do we have a similar problem in
> gcs_signal_entry()? Or do we rely on sparse ignoring (unsigned long)
> casts?

> Whichever way we go, I think we should have consistency between these
> two functions.

It's not coming up since there's a cast to unsigned long in there which
sparse likes, I can adjust that to a cast to __force u64 in there since
people didn't seem to like the cast to unsigned long.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2024-12-13 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11  1:00 [PATCH v2] arm64/signal: Silence sparse warning storing GCSPR_EL0 Mark Brown
2024-12-13 16:26 ` Catalin Marinas
2024-12-13 16:45   ` Mark Brown [this message]

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=418e279e-0628-473f-bd3c-4aa5e2d4dbcc@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=will@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