Subject: Re: [PATCH 1/2] powerpc: Enable MMU feature sections for inline asm

From: Michael Ellerman <[email-masked]>
Date: Wed, 29 Apr 2009 10:52:13 +1000

On Wed, 2009-04-29 at 10:26 +1000, Michael Neuling wrote:
> From: Milton Miller <[email-masked]>
> 
> powerpc: Enable MMU feature sections for inline asm
> 
> This adds the ability to do MMU feature sections for inline asm.
> 
> Signed-off-by: Milton Miller <[email-masked]>
> Signed-off-by: Michael Neuling <[email-masked]>
> ---
> 
>  arch/powerpc/include/asm/feature-fixups.h |   25 ++++++++++++++++++++-----
>  1 file changed, 20 insertions(+), 5 deletions(-)
> 
> Index: linux-2.6-ozlabs/arch/powerpc/include/asm/feature-fixups.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/include/asm/feature-fixups.h
> +++ linux-2.6-ozlabs/arch/powerpc/include/asm/feature-fixups.h
> @@ -8,8 +8,6 @@
>   * 2 of the License, or (at your option) any later version.
>   */
>  
> -#ifdef __ASSEMBLY__
> -
>  /*
>   * Feature section common macros
>   *
> @@ -23,10 +21,12 @@
>  /* 64 bits kernel, 32 bits code (ie. vdso32) */
>  #define FTR_ENTRY_LONG		.llong
>  #define FTR_ENTRY_OFFSET	.long 0xffffffff; .long
> +#elif defined(CONFIG_PPC64)
> +#define FTR_ENTRY_LONG		.llong
> +#define FTR_ENTRY_OFFSET	.llong
>  #else
> -/* 64 bit kernel 64 bit code, or 32 bit kernel 32 bit code */
> -#define FTR_ENTRY_LONG		PPC_LONG
> -#define FTR_ENTRY_OFFSET	PPC_LONG
> +#define FTR_ENTRY_LONG		.long
> +#define FTR_ENTRY_OFFSET	.long
>  #endif

This is a bit of a pity, I take it you can't nest stringify_in_c(). It
is probably worth a comment here about why you're not using PPC_LONG,
otherwise someone will try and "clean it up".

> @@ -141,6 +141,21 @@ label##5:					       	\
>  #define ALT_FW_FTR_SECTION_END_IFCLR(msk)	\
>  	ALT_FW_FTR_SECTION_END_NESTED_IFCLR(msk, 97)
>  
> +#ifndef __ASSEMBLY__
> +
> +#define ASM_MMU_FTR_IF_X(string, estring, msk, val)		\
> +	stringify_in_c(BEGIN_MMU_FTR_SECTION)			\
> +	string "; "						\
> +	stringify_in_c(MMU_FTR_SECTION_ELSE)			\
> +	estring "; "						\
> +	stringify_in_c(ALT_MMU_FTR_SECTION_END((msk), (val)))

Just call it ASM_MMU_FTR_IF() ?  And "string" and "estring" don't mean
much to me.

cheers