All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoffer Dall <cdall@linaro.org>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	Arnd Bergmann <arnd@arndb.de>,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH] ARM: hyp-stub: Fix Thumb-2 compilation
Date: Thu, 20 Apr 2017 13:23:06 +0200	[thread overview]
Message-ID: <20170420112306.GE4104@cbox> (raw)
In-Reply-To: <20170420101620.1368-1-marc.zyngier@arm.com>

On Thu, Apr 20, 2017 at 11:16:20AM +0100, Marc Zyngier wrote:
> The assembler defaults to emiting the short form of ADR, leading
> to an out-of-range immediate. Using the wide version solves this
> issue.
> 
> Fixes: bc845e4fbbbb ("ARM: KVM: Implement HVC_RESET_VECTORS stub hypercall in the init code")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm/kernel/hyp-stub.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S
> index d8523cc47a54..ec7e7377d423 100644
> --- a/arch/arm/kernel/hyp-stub.S
> +++ b/arch/arm/kernel/hyp-stub.S
> @@ -125,7 +125,7 @@ ENTRY(__hyp_stub_install_secondary)
>   * (see safe_svcmode_maskall).
>   */
>  	@ Now install the hypervisor stub:
> -	adr	r7, __hyp_stub_vectors
> +	W(adr)	r7, __hyp_stub_vectors
>  	mcr	p15, 4, r7, c12, c0, 0	@ set hypervisor vector base (HVBAR)
>  
>  	@ Disable all traps, so we don't get any nasty surprise
> -- 
> 2.11.0
> 

This fixes the compile, but I get this when booting it on TC2:

kvm [1]: 8-bit VMID
kvm [1]: IDMAP page: 80201000
kvm [1]: HYP VA range: 80000000:ffffffff
kvm [1]: Hyp mode initialized successfully
kvm [1]: vgic-v2@2c004000
kvm [1]: vgic interrupt IRQ16
kvm [1]: virtual timer IRQ19
Kernel panic - not syncing:
HYP panic: UNDEF PC:802010ac CPSR:800001da
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.11.0-rc3+ #140
Hardware name: ARM-Versatile Express
[<8021c5f1>] (unwind_backtrace) from [<802199eb>] (show_stack+0xb/0xc)
[<802199eb>] (show_stack) from [<803ccc15>] (dump_stack+0x71/0x80)
[<803ccc15>] (dump_stack) from [<80289467>] (panic+0xbb/0x1d4)
[<80289467>] (panic) from [<8020b1f5>]
(_kvm_arch_hardware_disable+0x11/0x20)
[<8020b1f5>] (_kvm_arch_hardware_disable) from [<8026c497>]
(flush_smp_call_function_queue+0x77/0x134)
[<8026c497>] (flush_smp_call_function_queue) from [<8021b8f9>]
(handle_IPI+0xd9/0x150)
[<8021b8f9>] (handle_IPI) from [<80201425>] (gic_handle_irq+0x65/0x6c)
[<80201425>] (gic_handle_irq) from [<8021a213>] (__irq_svc+0x53/0x7c)
Exception stack(0x80a01f18 to 0x80a01f60)
1f00:                                                       00000001
00000000
1f20: 80a01f70 802231c1 00000000 80a00000 00000000 80a03c80 80a03c34
808445d8
1f40: 80a01f70 80a03c88 805b31d1 80a01f68 80217ce1 80217ce2 40000033
ffffffff
[<8021a213>] (__irq_svc) from [<80217ce2>] (arch_cpu_idle+0x22/0x24)
[<80217ce2>] (arch_cpu_idle) from [<8024ca89>] (do_idle+0xf9/0x158)
[<8024ca89>] (do_idle) from [<8024ccaf>] (cpu_startup_entry+0x13/0x14)
[<8024ccaf>] (cpu_startup_entry) from [<80800a4d>]
(start_kernel+0x309/0x314)
[<80800a4d>] (start_kernel) from [<80008095>] (0x80008095)
CPU1: stopping
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc3+ #140
Hardware name: ARM-Versatile Express
[<8021c5f1>] (unwind_backtrace) from [<802199eb>] (show_stack+0xb/0xc)
[<802199eb>] (show_stack) from [<803ccc15>] (dump_stack+0x71/0x80)
[<803ccc15>] (dump_stack) from [<8021b95d>] (handle_IPI+0x13d/0x150)
[<8021b95d>] (handle_IPI) from [<80201425>] (gic_handle_irq+0x65/0x6c)
[<80201425>] (gic_handle_irq) from [<8021a213>] (__irq_svc+0x53/0x7c)
Exception stack(0xeec47e20 to 0xeec47e68)
7e20: 00000000 ef1a96dc 80000000 80000000 80a03de4 80a03cf8 ef1b5a84
ef1b5a80
7e40: 00000001 00000008 80a03de4 80845a00 00000000 eec47e70 8026c9ed
8026ca02
7e60: a0000033 ffffffff
[<8021a213>] (__irq_svc) from [<8026ca02>]
(smp_call_function_many+0x1aa/0x1f0)
[<8026ca02>] (smp_call_function_many) from [<8026ca89>]
(on_each_cpu+0x1d/0x30)
[<8026ca89>] (on_each_cpu) from [<8020c369>] (kvm_arch_init+0x339/0x3fc)
[<8020c369>] (kvm_arch_init) from [<80207149>] (kvm_init+0x11/0x214)
[<80207149>] (kvm_init) from [<8020177d>] (do_one_initcall+0x2d/0x104)
[<8020177d>] (do_one_initcall) from [<80800bed>]
(kernel_init_freeable+0x195/0x208)
[<80800bed>] (kernel_init_freeable) from [<805b2383>]
(kernel_init+0x7/0xd4)
[<805b2383>] (kernel_init) from [<80217361>] (ret_from_fork+0x11/0x30)
SMP: failed to stop secondary CPUs
---[ end Kernel panic - not syncing:
HYP panic: UNDEF PC:802010ac CPSR:800001da


Thanks,
-Christoffer

WARNING: multiple messages have this Message-ID (diff)
From: cdall@linaro.org (Christoffer Dall)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: hyp-stub: Fix Thumb-2 compilation
Date: Thu, 20 Apr 2017 13:23:06 +0200	[thread overview]
Message-ID: <20170420112306.GE4104@cbox> (raw)
In-Reply-To: <20170420101620.1368-1-marc.zyngier@arm.com>

On Thu, Apr 20, 2017 at 11:16:20AM +0100, Marc Zyngier wrote:
> The assembler defaults to emiting the short form of ADR, leading
> to an out-of-range immediate. Using the wide version solves this
> issue.
> 
> Fixes: bc845e4fbbbb ("ARM: KVM: Implement HVC_RESET_VECTORS stub hypercall in the init code")
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> ---
>  arch/arm/kernel/hyp-stub.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S
> index d8523cc47a54..ec7e7377d423 100644
> --- a/arch/arm/kernel/hyp-stub.S
> +++ b/arch/arm/kernel/hyp-stub.S
> @@ -125,7 +125,7 @@ ENTRY(__hyp_stub_install_secondary)
>   * (see safe_svcmode_maskall).
>   */
>  	@ Now install the hypervisor stub:
> -	adr	r7, __hyp_stub_vectors
> +	W(adr)	r7, __hyp_stub_vectors
>  	mcr	p15, 4, r7, c12, c0, 0	@ set hypervisor vector base (HVBAR)
>  
>  	@ Disable all traps, so we don't get any nasty surprise
> -- 
> 2.11.0
> 

This fixes the compile, but I get this when booting it on TC2:

kvm [1]: 8-bit VMID
kvm [1]: IDMAP page: 80201000
kvm [1]: HYP VA range: 80000000:ffffffff
kvm [1]: Hyp mode initialized successfully
kvm [1]: vgic-v2 at 2c004000
kvm [1]: vgic interrupt IRQ16
kvm [1]: virtual timer IRQ19
Kernel panic - not syncing:
HYP panic: UNDEF PC:802010ac CPSR:800001da
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.11.0-rc3+ #140
Hardware name: ARM-Versatile Express
[<8021c5f1>] (unwind_backtrace) from [<802199eb>] (show_stack+0xb/0xc)
[<802199eb>] (show_stack) from [<803ccc15>] (dump_stack+0x71/0x80)
[<803ccc15>] (dump_stack) from [<80289467>] (panic+0xbb/0x1d4)
[<80289467>] (panic) from [<8020b1f5>]
(_kvm_arch_hardware_disable+0x11/0x20)
[<8020b1f5>] (_kvm_arch_hardware_disable) from [<8026c497>]
(flush_smp_call_function_queue+0x77/0x134)
[<8026c497>] (flush_smp_call_function_queue) from [<8021b8f9>]
(handle_IPI+0xd9/0x150)
[<8021b8f9>] (handle_IPI) from [<80201425>] (gic_handle_irq+0x65/0x6c)
[<80201425>] (gic_handle_irq) from [<8021a213>] (__irq_svc+0x53/0x7c)
Exception stack(0x80a01f18 to 0x80a01f60)
1f00:                                                       00000001
00000000
1f20: 80a01f70 802231c1 00000000 80a00000 00000000 80a03c80 80a03c34
808445d8
1f40: 80a01f70 80a03c88 805b31d1 80a01f68 80217ce1 80217ce2 40000033
ffffffff
[<8021a213>] (__irq_svc) from [<80217ce2>] (arch_cpu_idle+0x22/0x24)
[<80217ce2>] (arch_cpu_idle) from [<8024ca89>] (do_idle+0xf9/0x158)
[<8024ca89>] (do_idle) from [<8024ccaf>] (cpu_startup_entry+0x13/0x14)
[<8024ccaf>] (cpu_startup_entry) from [<80800a4d>]
(start_kernel+0x309/0x314)
[<80800a4d>] (start_kernel) from [<80008095>] (0x80008095)
CPU1: stopping
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.11.0-rc3+ #140
Hardware name: ARM-Versatile Express
[<8021c5f1>] (unwind_backtrace) from [<802199eb>] (show_stack+0xb/0xc)
[<802199eb>] (show_stack) from [<803ccc15>] (dump_stack+0x71/0x80)
[<803ccc15>] (dump_stack) from [<8021b95d>] (handle_IPI+0x13d/0x150)
[<8021b95d>] (handle_IPI) from [<80201425>] (gic_handle_irq+0x65/0x6c)
[<80201425>] (gic_handle_irq) from [<8021a213>] (__irq_svc+0x53/0x7c)
Exception stack(0xeec47e20 to 0xeec47e68)
7e20: 00000000 ef1a96dc 80000000 80000000 80a03de4 80a03cf8 ef1b5a84
ef1b5a80
7e40: 00000001 00000008 80a03de4 80845a00 00000000 eec47e70 8026c9ed
8026ca02
7e60: a0000033 ffffffff
[<8021a213>] (__irq_svc) from [<8026ca02>]
(smp_call_function_many+0x1aa/0x1f0)
[<8026ca02>] (smp_call_function_many) from [<8026ca89>]
(on_each_cpu+0x1d/0x30)
[<8026ca89>] (on_each_cpu) from [<8020c369>] (kvm_arch_init+0x339/0x3fc)
[<8020c369>] (kvm_arch_init) from [<80207149>] (kvm_init+0x11/0x214)
[<80207149>] (kvm_init) from [<8020177d>] (do_one_initcall+0x2d/0x104)
[<8020177d>] (do_one_initcall) from [<80800bed>]
(kernel_init_freeable+0x195/0x208)
[<80800bed>] (kernel_init_freeable) from [<805b2383>]
(kernel_init+0x7/0xd4)
[<805b2383>] (kernel_init) from [<80217361>] (ret_from_fork+0x11/0x30)
SMP: failed to stop secondary CPUs
---[ end Kernel panic - not syncing:
HYP panic: UNDEF PC:802010ac CPSR:800001da


Thanks,
-Christoffer

  reply	other threads:[~2017-04-20 11:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-20 10:16 [PATCH] ARM: hyp-stub: Fix Thumb-2 compilation Marc Zyngier
2017-04-20 10:16 ` Marc Zyngier
2017-04-20 11:23 ` Christoffer Dall [this message]
2017-04-20 11:23   ` Christoffer Dall
2017-04-20 14:56   ` Marc Zyngier
2017-04-20 14:56     ` Marc Zyngier

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=20170420112306.GE4104@cbox \
    --to=cdall@linaro.org \
    --cc=arnd@arndb.de \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.com \
    /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.