[Acked] [Utopic][SRU][PATCH] powernv: Use _GLOBAL_TOC for opal wrappers

Andy Whitcroft apw at canonical.com
Tue Mar 17 13:35:50 UTC 2015


On Mon, Mar 16, 2015 at 04:23:58PM -0500, Chris J Arges wrote:
> From: Jeremy Kerr <jk at ozlabs.org>
> 
> BugLink: http://bugs.launchpad.net/bugs/1431196
> 
> Currently, we can't call opal wrappers from modules when using the LE
> ABIv2, which requires a TOC init. If we do we'll try and load the opal
> entry point using the wrong toc and probably explode or worse jump to
> the wrong address.
> 
> Nothing in upstream is making opal calls from a module, but we do export
> one of the wrappers so we should fix this anyway.
> 
> This change uses the _GLOBAL_TOC() macro (rather than _GLOBAL) for the
> opal wrappers, so that we can do non-local calls to them.
> 
> Signed-off-by: Jeremy Kerr <jk at ozlabs.org>
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
> (cherry picked from commit 19d36c2152aaf093c97431b5b4d13d29305a63a3)
> Signed-off-by: Chris J Arges <chris.j.arges at canonical.com>
> ---
>  arch/powerpc/platforms/powernv/opal-wrappers.S | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/platforms/powernv/opal-wrappers.S b/arch/powerpc/platforms/powernv/opal-wrappers.S
> index 3711ba6..67c4709 100644
> --- a/arch/powerpc/platforms/powernv/opal-wrappers.S
> +++ b/arch/powerpc/platforms/powernv/opal-wrappers.S
> @@ -20,7 +20,7 @@
>   * - Get r11 feed up by Dave so I can have better register usage
>   */
>  #define OPAL_CALL(name, token)		\
> - _GLOBAL(name);				\
> + _GLOBAL_TOC(name);			\
>  	mflr	r0;			\
>  	mfcr	r12;			\
>  	std	r0,16(r1);		\
> -- 

This appears to do what is claimed.

Acked-by: Andy Whitcroft <apw at canonical.com>

-apw




More information about the kernel-team mailing list