[PATCH v2] powerpc: fix compile error on 64K pages on 40x, 44x
christophe leroy
christophe.leroy at c-s.fr
Sat Sep 30 18:25:45 AEST 2017
Le 28/09/2017 à 20:32, Christian Lamparter a écrit :
> The mmu context on the 40x, 44x does not define pte_frag
> entry. This causes gcc abort the compilation due to:
>
> setup-common.c: In function ‘setup_arch’:
> setup-common.c:908: error: ‘mm_context_t’ has no ‘pte_frag’
>
> This patch fixes the issue by adding additional guard
> conditions, that limit the initialization to just
> platforms that define the pte_frag variable in the
> mmu context.
Wouldn't it be better to amend mm_context_t with the following, just
like other platforms, instead of a #ifdef in setup_arch() ?
#ifdef CONFIG_PPC_64K_PAGES
/* for 4K PTE fragment support */
void *pte_frag;
#endif
Otherwise, since init_mm is defined in BSS, is setting pte_frag to NULL
needed at all ?
I think removing this line would be better.
Christophe
>
> Signed-off-by: Christian Lamparter <chunkeey at googlemail.com>
> ---
> arch/powerpc/kernel/setup-common.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
> index 0ac741fae90e..4a22ec6b34de 100644
> --- a/arch/powerpc/kernel/setup-common.c
> +++ b/arch/powerpc/kernel/setup-common.c
> @@ -904,7 +904,8 @@ void __init setup_arch(char **cmdline_p)
> #endif
> #endif
>
> -#ifdef CONFIG_PPC_64K_PAGES
> +#if defined(CONFIG_PPC_64K_PAGES) && \
> + (defined(CONFIG_PPC_BOOK3S_64) || defined(CONFIG_PPC_BOOK3E_MMU))
> init_mm.context.pte_frag = NULL;
> #endif
> #ifdef CONFIG_SPAPR_TCE_IOMMU
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
More information about the Linuxppc-dev
mailing list