powerpc: fix compile error on 64K pages on 40x, 44x
PATCH 1/1 powerpc: fix compile error on 64K pages on 40x, 44x
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.
--- arch/powerpc/kernel/setup-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/powerpc/kernel/setup-common.c +3 -1
@@ -904,7 +904,9 @@ 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
Signature · 1 line
2.14.2
Le 26/09/2017 à 21:03, Christian Lamparter a écrit :
Quoted 21 lines
The mmu context on the 40x, 44x does not define
pte_fragentry. 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_fragvariable in the mmu context.Signed-off-by Christian Lamparter <[email protected]>--- arch/powerpc/kernel/setup-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)arch/powerpc/kernel/setup-common.c +0
-0
arch/powerpc/kernel/setup-common.c void __init setup_arch(char **cmdline_p) · line 909
Quoted 7 lines
arch/powerpc/kernel/setup-common.c +3
-1@@ -904,7 +904,9 @@ 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 )
There must be something wrong here.BOOK3E_MMU is defined if BOOK3E_64 or FSL_BOOKE BOOK3S_64 and BOOK3E_64 are mutually exclusive FSL_BOOKE is PPC32 which is mutually exclusive from PPC64.
Therefore you can't have both BOOK3S_64 and BOOK3E_MMU at the same time
Christophe
Quoted 4 lines
arch/powerpc/kernel/setup-common.c +0
-0init_mm.context.pte_frag =NULL ;#endif #ifdef CONFIG_SPAPR_TCE_IOMMU
Quoted 7 lines · CEST Christophe LEROY
=20
Le 26/09/2017 =C3=A0 21:03, Christian Lamparter a =C3=A9crit :Quoted 5 lines
The mmu context on the 40x, 44x does not define
pte_fragentry. This causes gcc abort the compilation due to:
=20setup-common.c: In function =E2=80=98setup_arch=E2=80=99:
setup-common.c:908: error: =E2=80=98mm_context_t=E2=80=99 has no =E2=80=
=98pte_frag=E2=80=99
Quoted 4 lines
Quoted 4 lines
=20
This patch fixes the issue by adding additional guard conditions, that limit the initialization to just platforms that define thepte_fragvariable in the
Quoted 8 lines
arch/powerpc/kernel/s=
Quoted 8 lines
mmu context.
=20Signed-off-by Christian Lamparter <[email protected]>--- arch/powerpc/kernel/setup-common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)=20
arch/powerpc/kernel/s= renamed from arch/powerpc/kernel/setup-common.c +0
-0
etup-common.c
Quoted 10 lines
Quoted 10 lines
index
0ac741fae90e..436d42a7d761100644arch/powerpc/kernel/setup-common.c +2
-1@@ -904,7 +904,9 @@ void __init setup_arch(char **cmdline_p)#endif #endif =20 -#ifdef CONFIG_PPC_64K_PAGES +#if defined(CONFIG_PPC_64K_PAGES) && \ + defined(CONFIG_PPC_BOOK3S_64) && \
Quoted 8 lines
arch/powerpc/kernel/setup-common.c void __init setup_arch(char **cmdline_p) · line 909
Quoted 1 line
arch/powerpc/kernel/setup-common.c +1
-0+defined (CONFIG_PPC_BOOK3E_MMU )=20
There must be something wrong here.BOOK3E_MMUis defined ifBOOK3E_64orFSL_BOOKEBOOK3S_64andBOOK3E_64are mutually exclusiveFSL_BOOKEis PPC32 which is mutually exclusive from PPC64. =20
Therefore you can't have bothBOOK3S_64andBOOK3E_MMUat the same time
Oops, yes. I guess it should be:
#if defined(CONFIG_PPC_64K_PAGES) && \
(defined(CONFIG_PPC_BOOK3S_64) || defined(CONFIG_PPC_BOOK3E_MMU))right?