From: robert.richter@caviumnetworks.com (Robert Richter)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] GICv3: Fixing 32 bit compatibility
Date: Tue, 9 Sep 2014 11:26:53 +0200 [thread overview]
Message-ID: <20140909092653.GC4588@rric.localhost> (raw)
In-Reply-To: <20140909091912.GQ23009@pengutronix.de>
On 09.09.14 11:19:12, Uwe Kleine-K?nig wrote:
> On Tue, Sep 09, 2014 at 11:12:01AM +0200, Robert Richter wrote:
> > On 09.09.14 10:00:42, Uwe Kleine-K?nig wrote:
> > > On Mon, Sep 08, 2014 at 04:11:19PM +0200, Robert Richter wrote:
> >
> > > > @@ -479,7 +479,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
> > > > smp_wmb();
> > > >
> > > > for_each_cpu_mask(cpu, *mask) {
> > > > - u64 cluster_id = cpu_logical_map(cpu) & ~0xffUL;
> > > > + u64 cluster_id = cpu_logical_map(cpu) & ~0xffULL;
> > > This doesn't change anything, does it?
> >
> > It does, not in 64 bit but in 32 bit there unsigned long is 32
> > bit. So, bit masks are broken if you compile a 32 bit kernel.
> Can you make an example where the result actually changes?
Upper 32 bits will be cleared above.
> > > I wonder if it would be cleaner to use (u64)0xff here.
> >
> > No, that's ULL for. This is commonly used in x86 too.
> I don't care much here, but I'd say ULL is to force an unsigned long
> long. If you want to make it obvious that you want a 64bit value, a cast
> to u64 makes this more clear.
ULL is no cast at all.
-Robert
WARNING: multiple messages have this Message-ID (diff)
From: Robert Richter <robert.richter@caviumnetworks.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Robert Richter <rric@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Jason Cooper <jason@lakedaemon.net>,
Marc Zyngier <marc.zyngier@arm.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] GICv3: Fixing 32 bit compatibility
Date: Tue, 9 Sep 2014 11:26:53 +0200 [thread overview]
Message-ID: <20140909092653.GC4588@rric.localhost> (raw)
In-Reply-To: <20140909091912.GQ23009@pengutronix.de>
On 09.09.14 11:19:12, Uwe Kleine-König wrote:
> On Tue, Sep 09, 2014 at 11:12:01AM +0200, Robert Richter wrote:
> > On 09.09.14 10:00:42, Uwe Kleine-König wrote:
> > > On Mon, Sep 08, 2014 at 04:11:19PM +0200, Robert Richter wrote:
> >
> > > > @@ -479,7 +479,7 @@ static void gic_raise_softirq(const struct cpumask *mask, unsigned int irq)
> > > > smp_wmb();
> > > >
> > > > for_each_cpu_mask(cpu, *mask) {
> > > > - u64 cluster_id = cpu_logical_map(cpu) & ~0xffUL;
> > > > + u64 cluster_id = cpu_logical_map(cpu) & ~0xffULL;
> > > This doesn't change anything, does it?
> >
> > It does, not in 64 bit but in 32 bit there unsigned long is 32
> > bit. So, bit masks are broken if you compile a 32 bit kernel.
> Can you make an example where the result actually changes?
Upper 32 bits will be cleared above.
> > > I wonder if it would be cleaner to use (u64)0xff here.
> >
> > No, that's ULL for. This is commonly used in x86 too.
> I don't care much here, but I'd say ULL is to force an unsigned long
> long. If you want to make it obvious that you want a 64bit value, a cast
> to u64 makes this more clear.
ULL is no cast at all.
-Robert
next prev parent reply other threads:[~2014-09-09 9:26 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-08 14:11 [PATCH] GICv3: Fixing 32 bit compatibility Robert Richter
2014-09-08 14:11 ` Robert Richter
2014-09-08 14:24 ` Marc Zyngier
2014-09-08 14:24 ` Marc Zyngier
2014-09-14 5:55 ` Jason Cooper
2014-09-14 5:55 ` Jason Cooper
2014-09-08 14:31 ` [PATCH] ITS: " Robert Richter
2014-09-08 14:31 ` Robert Richter
2014-09-09 8:00 ` [PATCH] GICv3: " Uwe Kleine-König
2014-09-09 8:00 ` Uwe Kleine-König
2014-09-09 9:12 ` Robert Richter
2014-09-09 9:12 ` Robert Richter
2014-09-09 9:19 ` Uwe Kleine-König
2014-09-09 9:19 ` Uwe Kleine-König
2014-09-09 9:26 ` Robert Richter [this message]
2014-09-09 9:26 ` Robert Richter
2014-09-09 9:43 ` Uwe Kleine-König
2014-09-09 9:43 ` Uwe Kleine-König
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=20140909092653.GC4588@rric.localhost \
--to=robert.richter@caviumnetworks.com \
--cc=linux-arm-kernel@lists.infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.