From: <arnd@arndb.de> Hi Russell, Here are some patches that belong into your domain, I hope you can just send the lot to Linus the next time you send other patches. These bug fixes all address problems found with automated build testing. Some of them have been around for a long time, other bugs are regressions since the merge window. Arnd The following changes since commit 0e51793e162ca432fc5f04178cf82b80a92c2659: Merge branch ''for-linus'' of git://git.linaro.org/people/rmk/linux-arm (2012-10-07 21:20:57 +0900) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git tags/fixes-for-rmk for you to fetch changes up to 93c6cee8e966ceb78a08e6a69a3afc948b74d254: ARM: warnings in arch/arm/include/asm/uaccess.h (2012-10-09 17:07:44 +0200) ---------------------------------------------------------------- Arnd Bergmann (9): ARM: kprobes: make more tests conditional ARM: export set_irq_flags ARM: Fix another build warning in arch/arm/mm/alignment.c ARM: export default read_current_timer ARM: Xen: fix initial build problems: ARM: pass -marm to gcc by default for both C and assembler ARM: be really quiet when building with ''make -s'' ARM: binfmt_flat: unused variable ''persistent'' ARM: warnings in arch/arm/include/asm/uaccess.h arch/arm/Kconfig | 1 + arch/arm/Makefile | 13 +++++++------ arch/arm/boot/Makefile | 10 +++++----- arch/arm/include/asm/flat.h | 2 +- arch/arm/include/asm/uaccess.h | 4 ++-- arch/arm/kernel/irq.c | 2 ++ arch/arm/kernel/kprobes-test-arm.c | 4 ++++ arch/arm/lib/delay.c | 1 + arch/arm/mm/alignment.c | 4 +++- arch/arm/tools/Makefile | 2 +- drivers/xen/Kconfig | 2 ++ drivers/xen/sys-hypervisor.c | 1 + 12 files changed, 30 insertions(+), 16 deletions(-) Cc: bryan.wu@canonical.com Cc: catalin.marinas@arm.com Cc: dave.martin@linaro.org Cc: jeremy@goop.org Cc: jonathan.austin@arm.com Cc: konrad.wilk@oracle.com Cc: leif.lindholm@arm.com Cc: linus.walleij@linaro.org Cc: damm@opensource.se Cc: mmarek@suse.cz Cc: rjw@sisk.pl Cc: rmk+kernel@arm.linux.org.uk Cc: stefano.stabellini@eu.citrix.com Cc: sboyd@codeaurora.org Cc: tglx@linutronix.de Cc: will.deacon@arm.com Cc: xen-devel@lists.xensource.com
* The XEN_BALLOON code requires the balloon infrastructure that is not getting built on ARM. * The tmem hypercall is not available on ARM * ARMv6 does not support cmpxchg on 16-bit words that are used in the * sys-hypervisor.c needs to include linux/err.h in order to use the IS_ERR/PTR_ERR/ERR_PTR family of functions. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Cc: Jeremy Fitzhardinge <jeremy@goop.org> Cc: xen-devel@lists.xensource.com --- arch/arm/Kconfig | 1 + drivers/xen/Kconfig | 2 ++ drivers/xen/sys-hypervisor.c | 1 + 3 files changed, 4 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 6d2f7f5..85eaac3 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -1846,6 +1846,7 @@ config XEN_DOM0 config XEN bool "Xen guest support on ARM (EXPERIMENTAL)" depends on EXPERIMENTAL && ARM && OF + depends on !CPU_V6 help Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index d4dffcd..126d8ce 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig @@ -3,6 +3,7 @@ menu "Xen driver support" config XEN_BALLOON bool "Xen memory balloon driver" + depends on !ARM default y help The balloon driver allows the Xen domain to request more memory from @@ -145,6 +146,7 @@ config SWIOTLB_XEN config XEN_TMEM bool + depends on !ARM default y if (CLEANCACHE || FRONTSWAP) help Shim to interface in-kernel Transcendent Memory hooks diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c index 5e5ad7e..66a0a14 100644 --- a/drivers/xen/sys-hypervisor.c +++ b/drivers/xen/sys-hypervisor.c @@ -11,6 +11,7 @@ #include <linux/kernel.h> #include <linux/module.h> #include <linux/kobject.h> +#include <linux/err.h> #include <asm/xen/hypervisor.h> #include <asm/xen/hypercall.h> -- 1.7.10
Ian Campbell
2012-Oct-09 15:35 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Tue, 2012-10-09 at 16:22 +0100, Arnd Bergmann wrote:> * The XEN_BALLOON code requires the balloon infrastructure that is not > getting built on ARM.I''ve got patches to enable this, but not for 3.7 so this looks good for now.> * The tmem hypercall is not available on ARM > > * ARMv6 does not support cmpxchg on 16-bit words that are used in themissing the end of this sentence?> * sys-hypervisor.c needs to include linux/err.h in order to use the > IS_ERR/PTR_ERR/ERR_PTR family of functions.I tripped over this too. Not sure where that patch got to though.> Signed-off-by: Arnd Bergmann <arnd@arndb.de>Acked-by: Ian Campbell <ian.campbell@citrix.com>> Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > Cc: Jeremy Fitzhardinge <jeremy@goop.org> > Cc: xen-devel@lists.xensource.com > --- > arch/arm/Kconfig | 1 + > drivers/xen/Kconfig | 2 ++ > drivers/xen/sys-hypervisor.c | 1 + > 3 files changed, 4 insertions(+) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 6d2f7f5..85eaac3 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -1846,6 +1846,7 @@ config XEN_DOM0 > config XEN > bool "Xen guest support on ARM (EXPERIMENTAL)" > depends on EXPERIMENTAL && ARM && OF > + depends on !CPU_V6 > help > Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. > > diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig > index d4dffcd..126d8ce 100644 > --- a/drivers/xen/Kconfig > +++ b/drivers/xen/Kconfig > @@ -3,6 +3,7 @@ menu "Xen driver support" > > config XEN_BALLOON > bool "Xen memory balloon driver" > + depends on !ARM > default y > help > The balloon driver allows the Xen domain to request more memory from > @@ -145,6 +146,7 @@ config SWIOTLB_XEN > > config XEN_TMEM > bool > + depends on !ARM > default y if (CLEANCACHE || FRONTSWAP) > help > Shim to interface in-kernel Transcendent Memory hooks > diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c > index 5e5ad7e..66a0a14 100644 > --- a/drivers/xen/sys-hypervisor.c > +++ b/drivers/xen/sys-hypervisor.c > @@ -11,6 +11,7 @@ > #include <linux/kernel.h> > #include <linux/module.h> > #include <linux/kobject.h> > +#include <linux/err.h> > > #include <asm/xen/hypervisor.h> > #include <asm/xen/hypercall.h>
Stefano Stabellini
2012-Oct-09 15:37 UTC
Re: [PATCH 5/9] ARM: Xen: fix initial build problems:
Thanks for the patch and sorry for the build breakage! On Tue, 9 Oct 2012, Arnd Bergmann wrote:> * The XEN_BALLOON code requires the balloon infrastructure that is not > getting built on ARM. > > * The tmem hypercall is not available on ARM > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the > > * sys-hypervisor.c needs to include linux/err.h in order to use the > IS_ERR/PTR_ERR/ERR_PTR family of functions. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> > Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com> > Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> > Cc: Jeremy Fitzhardinge <jeremy@goop.org> > Cc: xen-devel@lists.xensource.com > --- > arch/arm/Kconfig | 1 + > drivers/xen/Kconfig | 2 ++ > drivers/xen/sys-hypervisor.c | 1 + > 3 files changed, 4 insertions(+) > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > index 6d2f7f5..85eaac3 100644 > --- a/arch/arm/Kconfig > +++ b/arch/arm/Kconfig > @@ -1846,6 +1846,7 @@ config XEN_DOM0 > config XEN > bool "Xen guest support on ARM (EXPERIMENTAL)" > depends on EXPERIMENTAL && ARM && OF > + depends on !CPU_V6 > help > Say Y if you want to run Linux in a Virtual Machine on Xen on ARM.Considering that we rely on the virtualization extensions, this one can be: depends on CPU_V7 The rest looks fine. I can submit a second patch to change !CPU_V6 into CPU_V7 later, if you prefer.> diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig > index d4dffcd..126d8ce 100644 > --- a/drivers/xen/Kconfig > +++ b/drivers/xen/Kconfig > @@ -3,6 +3,7 @@ menu "Xen driver support" > > config XEN_BALLOON > bool "Xen memory balloon driver" > + depends on !ARM > default y > help > The balloon driver allows the Xen domain to request more memory from > @@ -145,6 +146,7 @@ config SWIOTLB_XEN > > config XEN_TMEM > bool > + depends on !ARM > default y if (CLEANCACHE || FRONTSWAP) > help > Shim to interface in-kernel Transcendent Memory hooks > > diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c > index 5e5ad7e..66a0a14 100644 > --- a/drivers/xen/sys-hypervisor.c > +++ b/drivers/xen/sys-hypervisor.c > @@ -11,6 +11,7 @@ > #include <linux/kernel.h> > #include <linux/module.h> > #include <linux/kobject.h> > +#include <linux/err.h> > > #include <asm/xen/hypervisor.h> > #include <asm/xen/hypercall.h> > -- > 1.7.10 >
Arnd Bergmann
2012-Oct-09 15:39 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Tuesday 09 October 2012, Ian Campbell wrote:> > * The tmem hypercall is not available on ARM > > > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the > > missing the end of this sentence?Right, I meant to say * ARMv6 does not support cmpxchg on 16-bit words that are used in the Xen grant table code, so we must ensure that Xen support is only built on ARMv7-only kernels not combined ARMv6/v7 kernels. This should be fixed differently in the future. Arnd
Russell King - ARM Linux
2012-Oct-09 16:04 UTC
Re: [PATCH 5/9] ARM: Xen: fix initial build problems:
On Tue, Oct 09, 2012 at 05:22:59PM +0200, Arnd Bergmann wrote:> * The XEN_BALLOON code requires the balloon infrastructure that is not > getting built on ARM. > > * The tmem hypercall is not available on ARM > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the"in the" what?
Russell King - ARM Linux
2012-Oct-09 16:08 UTC
Re: [GIT PULL 0/9] ARM architecture fixes for 3.7
On Tue, Oct 09, 2012 at 05:22:54PM +0200, Arnd Bergmann wrote:> Here are some patches that belong into your domain, I hope you can > just send the lot to Linus the next time you send other patches. > > These bug fixes all address problems found with automated build testing. > Some of them have been around for a long time, other bugs are > regressions since the merge window.Apart from the sliced off comment in one commit (which XEN people need to confirm they''re happy with the final version), I think these are otherwise fine... I''ll hold off pulling them until that can be fixed. Thanks.
Ian Campbell
2012-Oct-09 16:10 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Tue, 2012-10-09 at 16:39 +0100, Arnd Bergmann wrote:> On Tuesday 09 October 2012, Ian Campbell wrote: > > > * The tmem hypercall is not available on ARM > > > > > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the > > > > missing the end of this sentence? > > Right, I meant to say > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the > Xen grant table code, so we must ensure that Xen support is only built > on ARMv7-only kernels not combined ARMv6/v7 kernels. > > This should be fixed differently in the future.Is this is a build time failure because gcc/gas/etc refuses to generate these instructions if it is configured for v6? I ask because if it is only a runtime issue then we can reason that if we are running Xen specific grant table code, then we must be running on Xen and therefore must necessarily be running on a v7 (because Xen only support v7+virt extensions) even if the kernel happens to be capable of running on v6 too. Ian.
Stefano Stabellini
2012-Oct-09 17:06 UTC
Re: [GIT PULL 0/9] ARM architecture fixes for 3.7
On Tue, 9 Oct 2012, Russell King - ARM Linux wrote:> On Tue, Oct 09, 2012 at 05:22:54PM +0200, Arnd Bergmann wrote: > > Here are some patches that belong into your domain, I hope you can > > just send the lot to Linus the next time you send other patches. > > > > These bug fixes all address problems found with automated build testing. > > Some of them have been around for a long time, other bugs are > > regressions since the merge window. > > Apart from the sliced off comment in one commit (which XEN people need > to confirm they''re happy with the final version), I think these are > otherwise fine... I''ll hold off pulling them until that can be fixed.I am OK with the comment being truncated. I am going to submit a better fix for the Kconfig issues separately anyway, on top of this patch.
Arnd Bergmann
2012-Oct-09 18:19 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Tuesday 09 October 2012, Ian Campbell wrote:> On Tue, 2012-10-09 at 16:39 +0100, Arnd Bergmann wrote: > > On Tuesday 09 October 2012, Ian Campbell wrote: > > > > * The tmem hypercall is not available on ARM > > > > > > > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the > > > > > > missing the end of this sentence? > > > > Right, I meant to say > > > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the > > Xen grant table code, so we must ensure that Xen support is only built > > on ARMv7-only kernels not combined ARMv6/v7 kernels. > > > > This should be fixed differently in the future. > > Is this is a build time failure because gcc/gas/etc refuses to generate > these instructions if it is configured for v6? > > I ask because if it is only a runtime issue then we can reason that if > we are running Xen specific grant table code, then we must be running on > Xen and therefore must necessarily be running on a v7 (because Xen only > support v7+virt extensions) even if the kernel happens to be capable of > running on v6 too.The underlying reason of course is that ARMv6 doesn''t have those instructions. The symptom you see is a link error because gcc emits a reference to the (intentionally missing) __bad_cmpxchg() function from static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) { unsigned long oldval, res; switch (size) { #ifndef CONFIG_CPU_V6 /* min ARCH >= ARMv6K */ case 1: ... break; case 2: ... break; #endif case 4: ... break; default: __bad_cmpxchg(ptr, size); oldval = 0; } return oldval; } The possible solutions I can see for this are: * change the grant table format to use 32 bits for the flags on ARM * change the code to always cmpxchg the entire 32 bit word including the flags. * implement your own cmpxchg wrapper that may be implemented using a spinlock rather than cmpxchg if ARMv6 is enabled. Arnd
On Tuesday 09 October 2012, Stefano Stabellini wrote:> > config XEN > > bool "Xen guest support on ARM (EXPERIMENTAL)" > > depends on EXPERIMENTAL && ARM && OF > > + depends on !CPU_V6 > > help > > Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. > > Considering that we rely on the virtualization extensions, this one can > be: > > depends on CPU_V7 > > The rest looks fine. I can submit a second patch to change !CPU_V6 into > CPU_V7 later, if you prefer.CPU_V6 and CPU_V7 are not exclusive, I saw the problem when building a combined kernel for both V6 and V7. The code also needs to depend on ARMv7 with virtualization extensions, but that is a different issue. We don''t actually have a configuration symbol for that yet, as far as I can tell. Arnd
On Tuesday 09 October 2012, Russell King - ARM Linux wrote:> > On Tue, Oct 09, 2012 at 05:22:54PM +0200, Arnd Bergmann wrote: > > Here are some patches that belong into your domain, I hope you can > > just send the lot to Linus the next time you send other patches. > > > > These bug fixes all address problems found with automated build testing. > > Some of them have been around for a long time, other bugs are > > regressions since the merge window. > > Apart from the sliced off comment in one commit (which XEN people need > to confirm they''re happy with the final version), I think these are > otherwise fine... I''ll hold off pulling them until that can be fixed.Fixed that now, and I also added the Acks that I got in the meantime, changed the dependency from Xen on (CPU_v7 && !CPU_V6), and edited the description for patch 6 as Dave suggested. Arnd 8<--- The following changes since commit 0e51793e162ca432fc5f04178cf82b80a92c2659: Merge branch ''for-linus'' of git://git.linaro.org/people/rmk/linux-arm (2012-10-07 21:20:57 +0900) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git tags/fixes-for-rmk for you to fetch changes up to 8e7fc18b5eacc37b6e6fcf486ec4eafbfef91738: ARM: warnings in arch/arm/include/asm/uaccess.h (2012-10-09 20:29:07 +0200) ---------------------------------------------------------------- These bug fixes all address problems found with automated build testing. Some of them have been around for a long time, other bugs are regressions since the merge window. ---------------------------------------------------------------- Arnd Bergmann (9): ARM: kprobes: make more tests conditional ARM: export set_irq_flags ARM: Fix another build warning in arch/arm/mm/alignment.c ARM: export default read_current_timer ARM: Xen: fix initial build problems ARM: pass -marm to gcc by default for both C and assembler ARM: be really quiet when building with ''make -s'' ARM: binfmt_flat: unused variable ''persistent'' ARM: warnings in arch/arm/include/asm/uaccess.h arch/arm/Kconfig | 1 + arch/arm/Makefile | 13 +++++++------ arch/arm/boot/Makefile | 10 +++++----- arch/arm/include/asm/flat.h | 2 +- arch/arm/include/asm/uaccess.h | 4 ++-- arch/arm/kernel/irq.c | 2 ++ arch/arm/kernel/kprobes-test-arm.c | 4 ++++ arch/arm/lib/delay.c | 1 + arch/arm/mm/alignment.c | 4 +++- arch/arm/tools/Makefile | 2 +- drivers/xen/Kconfig | 2 ++ drivers/xen/sys-hypervisor.c | 1 + 12 files changed, 30 insertions(+), 16 deletions(-)
Dan Magenheimer
2012-Oct-09 19:24 UTC
Re: [PATCH 5/9] ARM: Xen: fix initial build problems:
> From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > Sent: Tuesday, October 09, 2012 9:36 AM > To: Arnd Bergmann > Cc: Jeremy Fitzhardinge; xen-devel@lists.xensource.com; Stefano Stabellini; Konrad Rzeszutek Wilk; > linux-kernel@vger.kernel.org; Russell King; linux-arm-kernel@lists.infradead.org > Subject: Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems: > > On Tue, 2012-10-09 at 16:22 +0100, Arnd Bergmann wrote: > > * The XEN_BALLOON code requires the balloon infrastructure that is not > > getting built on ARM. > > I''ve got patches to enable this, but not for 3.7 so this looks good for > now. > > > * The tmem hypercall is not available on ARM[reduced cc list to just us Xen chickens] Any reason that the tmem hypercall is not available on ARM? At a minimum, it should be available, but always return failure. Then an ARM Linux kernel can be ready for the Xen implementation when the Xen hypervisor supports it. Ballooning also... why disable it rather than just have the hypervisor fail all calls? Wondering if it just has never been tried/tested, or if there are known problems since everything should have been coded quite portably. (I do recall some arch-specific code in the hypervisor, now that I think of it, but it was pretty small.) I haven''t been plugged in to Xen/ARM, so I don''t know the target market, but I do know that some Android distros have been using the in-kernel tmem version (called zcache) even though it is still a Linux staging driver, so there probably will be demand for Xen tmem too. Dan
On Tue, 2012-10-09 at 20:24 +0100, Dan Magenheimer wrote:> > From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > > Sent: Tuesday, October 09, 2012 9:36 AM > > To: Arnd Bergmann > > Cc: Jeremy Fitzhardinge; xen-devel@lists.xensource.com; Stefano Stabellini; Konrad Rzeszutek Wilk; > > linux-kernel@vger.kernel.org; Russell King; linux-arm-kernel@lists.infradead.org > > Subject: Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems: > > > > On Tue, 2012-10-09 at 16:22 +0100, Arnd Bergmann wrote: > > > * The XEN_BALLOON code requires the balloon infrastructure that is not > > > getting built on ARM. > > > > I''ve got patches to enable this, but not for 3.7 so this looks good for > > now. > > > > > * The tmem hypercall is not available on ARM > > [reduced cc list to just us Xen chickens] > > Any reason that the tmem hypercall is not available on ARM? > At a minimum, it should be available, but always return failure.The hypercall is available from a hypervisor point of view, although it will return -Esomething since some of the required arch functions are still stubs. The issue Arnd is fixing is that the client code in the kernel doesn''t currently compile because we haven''t added all the required per-arch scaffolding yet. Or at least that is the case for ballooning, I haven''t tried building tmem myself but I assume Arnd wouldn''t be sending the patch if it built. I posted a series to enable ballooning on ARM last week (see <1349363496.866.49.camel@zakaz.uk.xensource.com>). Ian.
Ian Campbell
2012-Oct-10 07:54 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Tue, 2012-10-09 at 19:21 +0100, Arnd Bergmann wrote:> On Tuesday 09 October 2012, Stefano Stabellini wrote: > > > config XEN > > > bool "Xen guest support on ARM (EXPERIMENTAL)" > > > depends on EXPERIMENTAL && ARM && OF > > > + depends on !CPU_V6 > > > help > > > Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. > > > > Considering that we rely on the virtualization extensions, this one can > > be: > > > > depends on CPU_V7 > > > > The rest looks fine. I can submit a second patch to change !CPU_V6 into > > CPU_V7 later, if you prefer. > > CPU_V6 and CPU_V7 are not exclusive, I saw the problem when building a > combined kernel for both V6 and V7. The code also needs to depend on ARMv7 > with virtualization extensions, but that is a different issue. We don''t > actually have a configuration symbol for that yet, as far as I can tell.I don''t think the guest kernels (including dom0) need the extensions to run under Xen, they are only need by Xen itself. The guests should just see a relatively normal v7 processor. Stefano, does that sound right? Ian.
Ian Campbell
2012-Oct-10 09:46 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Tue, 2012-10-09 at 19:19 +0100, Arnd Bergmann wrote:> On Tuesday 09 October 2012, Ian Campbell wrote: > > On Tue, 2012-10-09 at 16:39 +0100, Arnd Bergmann wrote: > > > On Tuesday 09 October 2012, Ian Campbell wrote: > > > > > * The tmem hypercall is not available on ARM > > > > > > > > > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the > > > > > > > > missing the end of this sentence? > > > > > > Right, I meant to say > > > > > > * ARMv6 does not support cmpxchg on 16-bit words that are used in the > > > Xen grant table code, so we must ensure that Xen support is only built > > > on ARMv7-only kernels not combined ARMv6/v7 kernels. > > > > > > This should be fixed differently in the future. > > > > Is this is a build time failure because gcc/gas/etc refuses to generate > > these instructions if it is configured for v6? > > > > I ask because if it is only a runtime issue then we can reason that if > > we are running Xen specific grant table code, then we must be running on > > Xen and therefore must necessarily be running on a v7 (because Xen only > > support v7+virt extensions) even if the kernel happens to be capable of > > running on v6 too. > > The underlying reason of course is that ARMv6 doesn''t have those > instructions. The symptom you see is a link error because gcc emits > a reference to the (intentionally missing) __bad_cmpxchg() function > fromOK, then your fix is the best one for now.> [...] > The possible solutions I can see for this are: > > * change the grant table format to use 32 bits for the flags on ARM > * change the code to always cmpxchg the entire 32 bit word including the flags.I''d need to check the grant table semantics to see if this will be possible.> * implement your own cmpxchg wrapper that may be implemented using a spinlock > rather than cmpxchg if ARMv6 is enabled.Even if ARMv6 is enabled the grant table code will never be running on one so so it might be ok to just have our own wrapper which unconditionally uses the v7 instruction? That might upset gas though.> > Arnd
Arnd Bergmann
2012-Oct-10 11:07 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Wednesday 10 October 2012, Ian Campbell wrote:> > * implement your own cmpxchg wrapper that may be implemented using a spinlock > > rather than cmpxchg if ARMv6 is enabled. > > Even if ARMv6 is enabled the grant table code will never be running on > one so so it might be ok to just have our own wrapper which > unconditionally uses the v7 instruction? That might upset gas though.Yes, that would be possible. You can tell gas to ignore the instruction set in this case. If you do this, you can implement the update functions more efficiently using direct ldrexh/strexh in assembler to avoid doing two nested loops. I assume that you don''t need the v1 grant table code on ARM anyway, so the only code you need to look at is while (!((flags = *pflags) & GTF_transfer_committed)) { if (sync_cmpxchg(pflags, flags, 0) == flags) return 0; cpu_relax(); } which should transform nicely into a few lines of inline assembly. Arnd
Stefano Stabellini
2012-Oct-10 14:47 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Wed, 10 Oct 2012, Ian Campbell wrote:> On Tue, 2012-10-09 at 19:21 +0100, Arnd Bergmann wrote: > > On Tuesday 09 October 2012, Stefano Stabellini wrote: > > > > config XEN > > > > bool "Xen guest support on ARM (EXPERIMENTAL)" > > > > depends on EXPERIMENTAL && ARM && OF > > > > + depends on !CPU_V6 > > > > help > > > > Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. > > > > > > Considering that we rely on the virtualization extensions, this one can > > > be: > > > > > > depends on CPU_V7 > > > > > > The rest looks fine. I can submit a second patch to change !CPU_V6 into > > > CPU_V7 later, if you prefer. > > > > CPU_V6 and CPU_V7 are not exclusive, I saw the problem when building a > > combined kernel for both V6 and V7. The code also needs to depend on ARMv7 > > with virtualization extensions, but that is a different issue. We don''t > > actually have a configuration symbol for that yet, as far as I can tell. > > I don''t think the guest kernels (including dom0) need the extensions to > run under Xen, they are only need by Xen itself. The guests should just > see a relatively normal v7 processor. > > Stefano, does that sound right?Keep in mind that we are using HVC to issue hypercalls, and HVC has been introduced with the virtualization extensions, if I am not mistaken.
Stefano Stabellini
2012-Oct-10 14:51 UTC
Re: [PATCH 5/9] ARM: Xen: fix initial build problems:
On Wed, 10 Oct 2012, Ian Campbell wrote:> On Tue, 2012-10-09 at 20:24 +0100, Dan Magenheimer wrote: > > > From: Ian Campbell [mailto:Ian.Campbell@citrix.com] > > > Sent: Tuesday, October 09, 2012 9:36 AM > > > To: Arnd Bergmann > > > Cc: Jeremy Fitzhardinge; xen-devel@lists.xensource.com; Stefano Stabellini; Konrad Rzeszutek Wilk; > > > linux-kernel@vger.kernel.org; Russell King; linux-arm-kernel@lists.infradead.org > > > Subject: Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems: > > > > > > On Tue, 2012-10-09 at 16:22 +0100, Arnd Bergmann wrote: > > > > * The XEN_BALLOON code requires the balloon infrastructure that is not > > > > getting built on ARM. > > > > > > I''ve got patches to enable this, but not for 3.7 so this looks good for > > > now. > > > > > > > * The tmem hypercall is not available on ARM > > > > [reduced cc list to just us Xen chickens] > > > > Any reason that the tmem hypercall is not available on ARM? > > At a minimum, it should be available, but always return failure. > > The hypercall is available from a hypervisor point of view, although it > will return -Esomething since some of the required arch functions are > still stubs.We are probably just missing the implementation of HYPERVISOR_tmem_op.
Ian Campbell
2012-Oct-10 14:53 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Wed, 2012-10-10 at 15:47 +0100, Stefano Stabellini wrote:> On Wed, 10 Oct 2012, Ian Campbell wrote: > > On Tue, 2012-10-09 at 19:21 +0100, Arnd Bergmann wrote: > > > On Tuesday 09 October 2012, Stefano Stabellini wrote: > > > > > config XEN > > > > > bool "Xen guest support on ARM (EXPERIMENTAL)" > > > > > depends on EXPERIMENTAL && ARM && OF > > > > > + depends on !CPU_V6 > > > > > help > > > > > Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. > > > > > > > > Considering that we rely on the virtualization extensions, this one can > > > > be: > > > > > > > > depends on CPU_V7 > > > > > > > > The rest looks fine. I can submit a second patch to change !CPU_V6 into > > > > CPU_V7 later, if you prefer. > > > > > > CPU_V6 and CPU_V7 are not exclusive, I saw the problem when building a > > > combined kernel for both V6 and V7. The code also needs to depend on ARMv7 > > > with virtualization extensions, but that is a different issue. We don''t > > > actually have a configuration symbol for that yet, as far as I can tell. > > > > I don''t think the guest kernels (including dom0) need the extensions to > > run under Xen, they are only need by Xen itself. The guests should just > > see a relatively normal v7 processor. > > > > Stefano, does that sound right? > > Keep in mind that we are using HVC to issue hypercalls, and HVC has been > introduced with the virtualization extensions, if I am not mistaken.I think we can ignore that in this context since it is only used by bits which are already virtualisation aware -- i.e. you wouldn''t want to add it to the Kconfig as a dependency for Xen. Ian.
Stefano Stabellini
2012-Oct-10 14:58 UTC
Re: [GIT PULL 0/9] ARM architecture fixes for 3.7
On Tue, 9 Oct 2012, Arnd Bergmann wrote:> On Tuesday 09 October 2012, Russell King - ARM Linux wrote: > > > > On Tue, Oct 09, 2012 at 05:22:54PM +0200, Arnd Bergmann wrote: > > > Here are some patches that belong into your domain, I hope you can > > > just send the lot to Linus the next time you send other patches. > > > > > > These bug fixes all address problems found with automated build testing. > > > Some of them have been around for a long time, other bugs are > > > regressions since the merge window. > > > > Apart from the sliced off comment in one commit (which XEN people need > > to confirm they''re happy with the final version), I think these are > > otherwise fine... I''ll hold off pulling them until that can be fixed. > > Fixed that now, and I also added the Acks that I got in the meantime, > changed the dependency from Xen on (CPU_v7 && !CPU_V6), and edited the > description for patch 6 as Dave suggested.Thanks for the update, the new Xen patch is fine by me
Stefano Stabellini
2012-Oct-10 16:01 UTC
Re: [Xen-devel] [PATCH 5/9] ARM: Xen: fix initial build problems:
On Wed, 10 Oct 2012, Ian Campbell wrote:> On Wed, 2012-10-10 at 15:47 +0100, Stefano Stabellini wrote: > > On Wed, 10 Oct 2012, Ian Campbell wrote: > > > On Tue, 2012-10-09 at 19:21 +0100, Arnd Bergmann wrote: > > > > On Tuesday 09 October 2012, Stefano Stabellini wrote: > > > > > > config XEN > > > > > > bool "Xen guest support on ARM (EXPERIMENTAL)" > > > > > > depends on EXPERIMENTAL && ARM && OF > > > > > > + depends on !CPU_V6 > > > > > > help > > > > > > Say Y if you want to run Linux in a Virtual Machine on Xen on ARM. > > > > > > > > > > Considering that we rely on the virtualization extensions, this one can > > > > > be: > > > > > > > > > > depends on CPU_V7 > > > > > > > > > > The rest looks fine. I can submit a second patch to change !CPU_V6 into > > > > > CPU_V7 later, if you prefer. > > > > > > > > CPU_V6 and CPU_V7 are not exclusive, I saw the problem when building a > > > > combined kernel for both V6 and V7. The code also needs to depend on ARMv7 > > > > with virtualization extensions, but that is a different issue. We don''t > > > > actually have a configuration symbol for that yet, as far as I can tell. > > > > > > I don''t think the guest kernels (including dom0) need the extensions to > > > run under Xen, they are only need by Xen itself. The guests should just > > > see a relatively normal v7 processor. > > > > > > Stefano, does that sound right? > > > > Keep in mind that we are using HVC to issue hypercalls, and HVC has been > > introduced with the virtualization extensions, if I am not mistaken. > > I think we can ignore that in this context since it is only used by bits > which are already virtualisation aware -- i.e. you wouldn''t want to add > it to the Kconfig as a dependency for Xen.Considering that ARM CPU_V* symbols are not mutually exclusive, if Linux had a CPU_V7_VIRTEXT symbol I don''t see why we shouldn''t add it to our list of dependencies. It is more accurate than CPU_V7 after all. But I don''t think that it is necessary to introduce one now only for Xen, because like you said, we only need HVC and that is only used in virtualization aware code.
Hi Arnd, Russell, On Tue, Oct 09, 2012 at 07:40:24PM +0100, Arnd Bergmann wrote:> On Tuesday 09 October 2012, Russell King - ARM Linux wrote: > > > > On Tue, Oct 09, 2012 at 05:22:54PM +0200, Arnd Bergmann wrote: > > > Here are some patches that belong into your domain, I hope you can > > > just send the lot to Linus the next time you send other patches. > > > > > > These bug fixes all address problems found with automated build testing. > > > Some of them have been around for a long time, other bugs are > > > regressions since the merge window. > > > > Apart from the sliced off comment in one commit (which XEN people need > > to confirm they''re happy with the final version), I think these are > > otherwise fine... I''ll hold off pulling them until that can be fixed. > > Fixed that now, and I also added the Acks that I got in the meantime, > changed the dependency from Xen on (CPU_v7 && !CPU_V6), and edited the > description for patch 6 as Dave suggested. > > Arnd > > 8<--- > The following changes since commit 0e51793e162ca432fc5f04178cf82b80a92c2659: > > Merge branch ''for-linus'' of git://git.linaro.org/people/rmk/linux-arm (2012-10-07 21:20:57 +0900) > > are available in the git repository at: > > > git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git tags/fixes-for-rmk > > for you to fetch changes up to 8e7fc18b5eacc37b6e6fcf486ec4eafbfef91738: > > ARM: warnings in arch/arm/include/asm/uaccess.h (2012-10-09 20:29:07 +0200)It would be good to see these for -rc1 if there''s still time. I''m tired of seeing patches to fix the export of the read_current_timer symbol! Cheers, Will