Patchwork [4/4] KVM: PPC: Assembly functions exported to modules need _GLOBAL_TOC()

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

Comments

Anton Blanchard - June 12, 2014, 8:16 a.m.
Both kvmppc_hv_entry_trampoline and kvmppc_entry_trampoline are
assembly functions that are exported to modules and also require
a valid r2.

As such we need to use _GLOBAL_TOC so we provide a global entry
point that establishes the TOC (r2).

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:06 p.m.
On 12.06.14 10:16, Anton Blanchard wrote:
> Both kvmppc_hv_entry_trampoline and kvmppc_entry_trampoline are
> assembly functions that are exported to modules and also require
> a valid r2.
>
> As such we need to use _GLOBAL_TOC so we provide a global entry
> point that establishes the TOC (r2).
>
> Signed-off-by: Anton Blanchard <anton@samba.org>

Thanks, applied to kvm-ppc-queue.

I've not applied patches 1 and 2 for now, as they break BE module support.


Alex

--
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
@@ -51,7 +51,7 @@ 
  *
  * LR = return address to continue at after eventually re-enabling MMU
  */
-_GLOBAL(kvmppc_hv_entry_trampoline)
+_GLOBAL_TOC(kvmppc_hv_entry_trampoline)
 	mflr	r0
 	std	r0, PPC_LR_STKOFF(r1)
 	stdu	r1, -112(r1)
Index: b/arch/powerpc/kvm/book3s_rmhandlers.S
===================================================================
--- a/arch/powerpc/kvm/book3s_rmhandlers.S
+++ b/arch/powerpc/kvm/book3s_rmhandlers.S
@@ -140,7 +140,7 @@  kvmppc_handler_skip_ins:
  * On entry, r4 contains the guest shadow MSR
  * MSR.EE has to be 0 when calling this function
  */
-_GLOBAL(kvmppc_entry_trampoline)
+_GLOBAL_TOC(kvmppc_entry_trampoline)
 	mfmsr	r5
 	LOAD_REG_ADDR(r7, kvmppc_handler_trampoline_enter)
 	toreal(r7)