Patchwork [3/4] KVM: PPC: Book3S HV: Fix ABIv2 indirect branch issue

login
register
mail settings
Submitter Anton Blanchard
Date June 12, 2014, 8:16 a.m.
Message ID <20140612181610.3479c3f2@kryten>
Download mbox | patch
Permalink /patch/359034/
State New
Headers show

Comments

Anton Blanchard - June 12, 2014, 8:16 a.m.
To establish addressability quickly, ABIv2 requires the target
address of the function being called to be in r12.

Signed-off-by: Anton Blanchard <anton@samba.org>
---

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Graf - June 17, 2014, 4:05 p.m.
On 12.06.14 10:16, Anton Blanchard wrote:
> To establish addressability quickly, ABIv2 requires the target
> address of the function being called to be in r12.
>
> Signed-off-by: Anton Blanchard <anton@samba.org>

Thanks, applied to kvm-ppc-queue.


Alex

> ---
>
> Index: b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> ===================================================================
> --- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> +++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
> @@ -1920,8 +1920,8 @@ hcall_try_real_mode:
>   	lwax	r3,r3,r4
>   	cmpwi	r3,0
>   	beq	guest_exit_cont
> -	add	r3,r3,r4
> -	mtctr	r3
> +	add	r12,r3,r4
> +	mtctr	r12
>   	mr	r3,r9		/* get vcpu pointer */
>   	ld	r4,VCPU_GPR(R4)(r9)
>   	bctrl

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

Index: b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
===================================================================
--- a/arch/powerpc/kvm/book3s_hv_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_hv_rmhandlers.S
@@ -1920,8 +1920,8 @@  hcall_try_real_mode:
 	lwax	r3,r3,r4
 	cmpwi	r3,0
 	beq	guest_exit_cont
-	add	r3,r3,r4
-	mtctr	r3
+	add	r12,r3,r4
+	mtctr	r12
 	mr	r3,r9		/* get vcpu pointer */
 	ld	r4,VCPU_GPR(R4)(r9)
 	bctrl