From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] arm: remove !CPU_V6 and !GENERIC_ATOMIC64 build dependencies for XEN
Date: Thu, 9 Jan 2014 18:42:51 +0000 [thread overview]
Message-ID: <20140109184251.GL17838@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1401091247000.21510@kaball.uk.xensource.com>
On Thu, Jan 09, 2014 at 12:47:24PM +0000, Stefano Stabellini wrote:
> On Thu, 9 Jan 2014, Arnd Bergmann wrote:
> > On Thursday 09 January 2014, Will Deacon wrote:
> > > On Wed, Jan 08, 2014 at 06:00:23PM +0000, Stefano Stabellini wrote:
> > > > Remove !GENERIC_ATOMIC64 build dependency:
> > > > - rename atomic64_xchg to armv7_atomic64_xchg and define it even ifdef
> > > > GENERIC_ATOMIC64;
> > > > - call armv7_atomic64_xchg directly from xen/events.h.
> > > >
> > > > Remove !CPU_V6 build dependency:
> > > > - introduce __cmpxchg8 and __cmpxchg16, compiled even ifdef
> > > > CONFIG_CPU_V6;
> > > > - implement sync_cmpxchg using __cmpxchg8 and __cmpxchg16.
> > > >
> > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > CC: arnd at arndb.de
> > > > CC: linux at arm.linux.org.uk
> > > > CC: will.deacon at arm.com
> > > > CC: gang.chen at asianux.com
> > > > CC: catalin.marinas at arm.com
> > > > CC: jaccon.bastiaansen at gmail.com
> > > > CC: linux-arm-kernel at lists.infradead.org
> > > > CC: linux-kernel at vger.kernel.org
> > > >
> > >
> > > I'm confused here. It looks like you want to call armv7 code in a v6 kernel.
> > > What am I missing?
> >
> > This is about being able to build a kernel that runs on ARMv6 and ARMv7
> > and also includes Xen. Because of obvious hardware limitations, Xen
> > will only run on v7, but currently you cannot even build it once you
> > enable (pre-v6K) ARMv6 support, since the combined v6+v7 kernel can't
> > do atomic accesses in a generic way on non-32bit variables.
>
> Yep, that's right.
Ok, thanks for the explanation. Looking at the patch, I wonder whether it's
not cleaner just to implement xchg code separately for Xen? The Linux code
isn't always sufficient (due to the GENERIC_ATOMIC64 stuff) and most of the
churn coming out of this patch is an attempt to provide some small code
reuse at the cost of code readability.
What do others think?
Will
WARNING: multiple messages have this Message-ID (diff)
From: Will Deacon <will.deacon@arm.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
Catalin Marinas <Catalin.Marinas@arm.com>,
"gang.chen@asianux.com" <gang.chen@asianux.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"jaccon.bastiaansen@gmail.com" <jaccon.bastiaansen@gmail.com>
Subject: Re: [PATCH v3] arm: remove !CPU_V6 and !GENERIC_ATOMIC64 build dependencies for XEN
Date: Thu, 9 Jan 2014 18:42:51 +0000 [thread overview]
Message-ID: <20140109184251.GL17838@mudshark.cambridge.arm.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1401091247000.21510@kaball.uk.xensource.com>
On Thu, Jan 09, 2014 at 12:47:24PM +0000, Stefano Stabellini wrote:
> On Thu, 9 Jan 2014, Arnd Bergmann wrote:
> > On Thursday 09 January 2014, Will Deacon wrote:
> > > On Wed, Jan 08, 2014 at 06:00:23PM +0000, Stefano Stabellini wrote:
> > > > Remove !GENERIC_ATOMIC64 build dependency:
> > > > - rename atomic64_xchg to armv7_atomic64_xchg and define it even ifdef
> > > > GENERIC_ATOMIC64;
> > > > - call armv7_atomic64_xchg directly from xen/events.h.
> > > >
> > > > Remove !CPU_V6 build dependency:
> > > > - introduce __cmpxchg8 and __cmpxchg16, compiled even ifdef
> > > > CONFIG_CPU_V6;
> > > > - implement sync_cmpxchg using __cmpxchg8 and __cmpxchg16.
> > > >
> > > > Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
> > > > CC: arnd@arndb.de
> > > > CC: linux@arm.linux.org.uk
> > > > CC: will.deacon@arm.com
> > > > CC: gang.chen@asianux.com
> > > > CC: catalin.marinas@arm.com
> > > > CC: jaccon.bastiaansen@gmail.com
> > > > CC: linux-arm-kernel@lists.infradead.org
> > > > CC: linux-kernel@vger.kernel.org
> > > >
> > >
> > > I'm confused here. It looks like you want to call armv7 code in a v6 kernel.
> > > What am I missing?
> >
> > This is about being able to build a kernel that runs on ARMv6 and ARMv7
> > and also includes Xen. Because of obvious hardware limitations, Xen
> > will only run on v7, but currently you cannot even build it once you
> > enable (pre-v6K) ARMv6 support, since the combined v6+v7 kernel can't
> > do atomic accesses in a generic way on non-32bit variables.
>
> Yep, that's right.
Ok, thanks for the explanation. Looking at the patch, I wonder whether it's
not cleaner just to implement xchg code separately for Xen? The Linux code
isn't always sufficient (due to the GENERIC_ATOMIC64 stuff) and most of the
churn coming out of this patch is an attempt to provide some small code
reuse at the cost of code readability.
What do others think?
Will
next prev parent reply other threads:[~2014-01-09 18:42 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-08 18:00 [PATCH v3] arm: remove !CPU_V6 and !GENERIC_ATOMIC64 build dependencies for XEN Stefano Stabellini
2014-01-08 18:00 ` Stefano Stabellini
2014-01-09 10:30 ` Will Deacon
2014-01-09 10:30 ` Will Deacon
2014-01-09 11:04 ` Arnd Bergmann
2014-01-09 11:04 ` Arnd Bergmann
2014-01-09 12:47 ` Stefano Stabellini
2014-01-09 12:47 ` Stefano Stabellini
2014-01-09 18:42 ` Will Deacon [this message]
2014-01-09 18:42 ` Will Deacon
2014-01-10 16:48 ` Chen Gang F T
2014-01-10 16:48 ` Chen Gang F T
2014-01-13 8:12 ` Jaccon Bastiaansen
2014-01-13 8:12 ` Jaccon Bastiaansen
2014-01-16 16:27 ` Stefano Stabellini
2014-01-16 16:27 ` Stefano Stabellini
2014-01-16 19:31 ` Will Deacon
2014-01-16 19:31 ` Will Deacon
2014-01-20 15:32 ` Stefano Stabellini
2014-01-20 15:32 ` Stefano Stabellini
2014-01-21 11:08 ` Will Deacon
2014-01-21 11:08 ` Will Deacon
2014-01-21 12:08 ` Stefano Stabellini
2014-01-21 12:08 ` Stefano Stabellini
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=20140109184251.GL17838@mudshark.cambridge.arm.com \
--to=will.deacon@arm.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.