All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [arm:for-next 24/31] arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support ARM mode `ubfx r7,r7,#28,#4'
@ 2016-02-17 16:26 kbuild test robot
  2016-02-17 19:51 ` Jean-Philippe Brucker
  0 siblings, 1 reply; 5+ messages in thread
From: kbuild test robot @ 2016-02-17 16:26 UTC (permalink / raw
  To: linux-arm-kernel

tree:   http://repo.or.cz/linux-2.6/linux-2.6-arm.git for-next
head:   5aeac3b523644cbc300f17d67c8fce73df9060c0
commit: e59941b9b3817c9b1dd6662d903150fe3f3c3b0b [24/31] ARM: 8527/1: virt: enable GICv3 system registers
config: arm-allmodconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout e59941b9b3817c9b1dd6662d903150fe3f3c3b0b
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   arch/arm/kernel/hyp-stub.S: Assembler messages:
>> arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support ARM mode `ubfx r7,r7,#28,#4'
>> arch/arm/kernel/hyp-stub.S:176: Error: selected processor does not support ARM mode `isb'

vim +168 arch/arm/kernel/hyp-stub.S

   162	1:
   163	#endif
   164	
   165	#ifdef CONFIG_ARM_GIC_V3
   166		@ Check whether GICv3 system registers are available
   167		mrc	p15, 0, r7, c0, c1, 1	@ ID_PFR1
 > 168		ubfx	r7, r7, #28, #4
   169		cmp	r7, #1
   170		bne	2f
   171	
   172		@ Enable system register accesses
   173		mrc	p15, 4, r7, c12, c9, 5	@ ICC_HSRE
   174		orr	r7, r7, #(ICC_SRE_EL2_ENABLE | ICC_SRE_EL2_SRE)
   175		mcr	p15, 4, r7, c12, c9, 5	@ ICC_HSRE
 > 176		isb
   177	
   178		@ SRE bit could be forced to 0 by firmware.
   179		@ Check whether it sticks before accessing any other sysreg

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 56246 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160218/1033e90f/attachment-0001.obj>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [arm:for-next 24/31] arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support ARM mode `ubfx r7,r7,#28,#4'
  2016-02-17 16:26 [arm:for-next 24/31] arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support ARM mode `ubfx r7,r7,#28,#4' kbuild test robot
@ 2016-02-17 19:51 ` Jean-Philippe Brucker
  2016-02-17 21:25   ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Philippe Brucker @ 2016-02-17 19:51 UTC (permalink / raw
  To: linux-arm-kernel

On Thu, Feb 18, 2016 at 12:26:46AM +0800, kbuild test robot wrote:
> tree:   http://repo.or.cz/linux-2.6/linux-2.6-arm.git for-next
> head:   5aeac3b523644cbc300f17d67c8fce73df9060c0
> commit: e59941b9b3817c9b1dd6662d903150fe3f3c3b0b [24/31] ARM: 8527/1: virt: enable GICv3 system registers
> config: arm-allmodconfig (attached as .config)
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         git checkout e59941b9b3817c9b1dd6662d903150fe3f3c3b0b
>         # save the attached .config to linux build tree
>         make.cross ARCH=arm 
> 
> All errors (new ones prefixed by >>):
> 
>    arch/arm/kernel/hyp-stub.S: Assembler messages:
> >> arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support ARM mode `ubfx r7,r7,#28,#4'
> >> arch/arm/kernel/hyp-stub.S:176: Error: selected processor does not support ARM mode `isb'

Selected processor being arm1136j-s, it doesn't make sense to build
hyp-stub.S at all, in my opinion. We should select ARM_VIRT_EXT only
when CPU_32v6 and lower are deselected (as with LPAE). I realize such a
change might be too invasive for a fix, so I attached a version of my
patch that builds for older architectures. If there is no objection, it
will supersede the previous one.

Thanks,
Jean-Philippe

---
>From 2e188d870dcfeff0db5098d9c6ad3eaa139a7ddd Mon Sep 17 00:00:00 2001
From: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
Date: Tue, 22 Sep 2015 09:27:17 +0100
Subject: [PATCH v2] ARM: virt: enable GICv3 system registers

ARMv8 introduces system registers for the Generic Interrupt Controller's
CPU and virtual interfaces.
When GICv3 is implemented, EL2 needs to allow the kernel to use those
registers, by changing the value of ICC_HSRE.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
---
 arch/arm/kernel/hyp-stub.S |   24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S
index 2a55373..6c98210 100644
--- a/arch/arm/kernel/hyp-stub.S
+++ b/arch/arm/kernel/hyp-stub.S
@@ -17,6 +17,7 @@
  */
 
 #include <linux/init.h>
+#include <linux/irqchip/arm-gic-v3.h>
 #include <linux/linkage.h>
 #include <asm/assembler.h>
 #include <asm/virt.h>
@@ -161,6 +162,29 @@ ARM_BE8(orr	r7, r7, #(1 << 25))     @ HSCTLR.EE
 1:
 #endif
 
+#ifdef CONFIG_ARM_GIC_V3
+	@ Check whether GICv3 system registers are available
+	mrc	p15, 0, r7, c0, c1, 1	@ ID_PFR1
+	lsr	r7, r7, #28
+	cmp	r7, #1
+	bne	2f
+
+	@ Enable system register accesses
+	mrc	p15, 4, r7, c12, c9, 5	@ ICC_HSRE
+	orr	r7, r7, #(ICC_SRE_EL2_ENABLE | ICC_SRE_EL2_SRE)
+	mcr	p15, 4, r7, c12, c9, 5	@ ICC_HSRE
+	instr_sync
+
+	@ SRE bit could be forced to 0 by firmware.
+	@ Check whether it sticks before accessing any other sysreg
+	mrc	p15, 4, r7, c12, c9, 5	@ ICC_HSRE
+	tst	r7, #ICC_SRE_EL2_SRE
+	beq	2f
+	mov	r7, #0
+	mcr	p15, 4, r7, c12, c11, 0	@ ICH_HCR
+2:
+#endif
+
 	bx	lr			@ The boot CPU mode is left in r4.
 ENDPROC(__hyp_stub_install_secondary)
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [arm:for-next 24/31] arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support ARM mode `ubfx r7,r7,#28,#4'
  2016-02-17 19:51 ` Jean-Philippe Brucker
@ 2016-02-17 21:25   ` Russell King - ARM Linux
  2016-02-18 12:41     ` [PATCH] ARM: virt: fix hyp-stub build for pre-ARMv7 CPUs Jean-Philippe Brucker
  0 siblings, 1 reply; 5+ messages in thread
From: Russell King - ARM Linux @ 2016-02-17 21:25 UTC (permalink / raw
  To: linux-arm-kernel

On Wed, Feb 17, 2016 at 07:51:28PM +0000, Jean-Philippe Brucker wrote:
> On Thu, Feb 18, 2016 at 12:26:46AM +0800, kbuild test robot wrote:
> > tree:   http://repo.or.cz/linux-2.6/linux-2.6-arm.git for-next
> > head:   5aeac3b523644cbc300f17d67c8fce73df9060c0
> > commit: e59941b9b3817c9b1dd6662d903150fe3f3c3b0b [24/31] ARM: 8527/1: virt: enable GICv3 system registers
> > config: arm-allmodconfig (attached as .config)
> > reproduce:
> >         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         git checkout e59941b9b3817c9b1dd6662d903150fe3f3c3b0b
> >         # save the attached .config to linux build tree
> >         make.cross ARCH=arm 
> > 
> > All errors (new ones prefixed by >>):
> > 
> >    arch/arm/kernel/hyp-stub.S: Assembler messages:
> > >> arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support ARM mode `ubfx r7,r7,#28,#4'
> > >> arch/arm/kernel/hyp-stub.S:176: Error: selected processor does not support ARM mode `isb'
> 
> Selected processor being arm1136j-s, it doesn't make sense to build
> hyp-stub.S at all, in my opinion. We should select ARM_VIRT_EXT only
> when CPU_32v6 and lower are deselected (as with LPAE). I realize such a
> change might be too invasive for a fix, so I attached a version of my
> patch that builds for older architectures. If there is no objection, it
> will supersede the previous one.

Well, in order to get to the ubfx instruction, you need the CPU to be
in HYP mode, which these older CPUs aren't going to be.  So, it's safe
to use ubfx here.

The solution to this is to add:

AFLAGS_hyp-stub.o		:=-Wa,-march=armv7

to the makefile so the toolchain will build it for ARMv7 even though
older CPUs are selected.

Thanks.

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] ARM: virt: fix hyp-stub build for pre-ARMv7 CPUs
  2016-02-17 21:25   ` Russell King - ARM Linux
@ 2016-02-18 12:41     ` Jean-Philippe Brucker
  2016-02-18 23:41       ` Russell King - ARM Linux
  0 siblings, 1 reply; 5+ messages in thread
From: Jean-Philippe Brucker @ 2016-02-18 12:41 UTC (permalink / raw
  To: linux-arm-kernel

ARMv6 CPUs do not have virtualisation extensions, but hyp-stub.S is
still included into the image to keep it generic. In order to use ARMv7
instructions during HYP initialisation, add -march=armv7-a flag to
hyp-stub's build.

On an ARMv6 CPU, __hyp_stub_install returns as soon as it detects that
the mode isn't HYP, so we will never reach those instructions.

Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>
---
 arch/arm/boot/compressed/Makefile |    2 ++
 arch/arm/kernel/Makefile          |    1 +
 2 files changed, 3 insertions(+)

diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
index 7a6a58e..43788b1 100644
--- a/arch/arm/boot/compressed/Makefile
+++ b/arch/arm/boot/compressed/Makefile
@@ -195,5 +195,7 @@ CFLAGS_font.o := -Dstatic=
 $(obj)/font.c: $(FONTC)
 	$(call cmd,shipped)
 
+AFLAGS_hyp-stub.o := -Wa,-march=armv7-a
+
 $(obj)/hyp-stub.S: $(srctree)/arch/$(SRCARCH)/kernel/hyp-stub.S
 	$(call cmd,shipped)
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index 2c5f160..ad325a8 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -88,6 +88,7 @@ obj-$(CONFIG_DEBUG_LL)	+= debug.o
 obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
 
 obj-$(CONFIG_ARM_VIRT_EXT)	+= hyp-stub.o
+AFLAGS_hyp-stub.o		:=-Wa,-march=armv7-a
 ifeq ($(CONFIG_ARM_PSCI),y)
 obj-$(CONFIG_SMP)		+= psci_smp.o
 endif
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] ARM: virt: fix hyp-stub build for pre-ARMv7 CPUs
  2016-02-18 12:41     ` [PATCH] ARM: virt: fix hyp-stub build for pre-ARMv7 CPUs Jean-Philippe Brucker
@ 2016-02-18 23:41       ` Russell King - ARM Linux
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King - ARM Linux @ 2016-02-18 23:41 UTC (permalink / raw
  To: linux-arm-kernel

On Thu, Feb 18, 2016 at 12:41:49PM +0000, Jean-Philippe Brucker wrote:
> ARMv6 CPUs do not have virtualisation extensions, but hyp-stub.S is
> still included into the image to keep it generic. In order to use ARMv7
> instructions during HYP initialisation, add -march=armv7-a flag to
> hyp-stub's build.
> 
> On an ARMv6 CPU, __hyp_stub_install returns as soon as it detects that
> the mode isn't HYP, so we will never reach those instructions.
> 
> Signed-off-by: Jean-Philippe Brucker <jean-philippe.brucker@arm.com>

Please drop this in the patch system, thanks.

> ---
>  arch/arm/boot/compressed/Makefile |    2 ++
>  arch/arm/kernel/Makefile          |    1 +
>  2 files changed, 3 insertions(+)
> 
> diff --git a/arch/arm/boot/compressed/Makefile b/arch/arm/boot/compressed/Makefile
> index 7a6a58e..43788b1 100644
> --- a/arch/arm/boot/compressed/Makefile
> +++ b/arch/arm/boot/compressed/Makefile
> @@ -195,5 +195,7 @@ CFLAGS_font.o := -Dstatic=
>  $(obj)/font.c: $(FONTC)
>  	$(call cmd,shipped)
>  
> +AFLAGS_hyp-stub.o := -Wa,-march=armv7-a
> +
>  $(obj)/hyp-stub.S: $(srctree)/arch/$(SRCARCH)/kernel/hyp-stub.S
>  	$(call cmd,shipped)
> diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
> index 2c5f160..ad325a8 100644
> --- a/arch/arm/kernel/Makefile
> +++ b/arch/arm/kernel/Makefile
> @@ -88,6 +88,7 @@ obj-$(CONFIG_DEBUG_LL)	+= debug.o
>  obj-$(CONFIG_EARLY_PRINTK)	+= early_printk.o
>  
>  obj-$(CONFIG_ARM_VIRT_EXT)	+= hyp-stub.o
> +AFLAGS_hyp-stub.o		:=-Wa,-march=armv7-a
>  ifeq ($(CONFIG_ARM_PSCI),y)
>  obj-$(CONFIG_SMP)		+= psci_smp.o
>  endif
> -- 
> 1.7.9.5
> 

-- 
RMK's Patch system: http://www.arm.linux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-02-18 23:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-17 16:26 [arm:for-next 24/31] arch/arm/kernel/hyp-stub.S:168: Error: selected processor does not support ARM mode `ubfx r7,r7,#28,#4' kbuild test robot
2016-02-17 19:51 ` Jean-Philippe Brucker
2016-02-17 21:25   ` Russell King - ARM Linux
2016-02-18 12:41     ` [PATCH] ARM: virt: fix hyp-stub build for pre-ARMv7 CPUs Jean-Philippe Brucker
2016-02-18 23:41       ` Russell King - ARM Linux

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.