Skip to contentSkip to conversation

powerpc: fix compile error on 64K pages on 40x, 44x

PATCH Superseded Christian Lamparter 2 participants 3 messages Sep 26, 2017 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
index 0ac741fae90e..436d42a7d761 100644
@@ -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
#1 lore raw

Le 26/09/2017 à 21:03, Christian Lamparter a écrit :

Quoted 21 lines

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 +0 -0
index 0ac741fae90e..436d42a7d761 100644

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 -0
  	init_mm.context.pte_frag = NULL;
  #endif
  #ifdef CONFIG_SPAPR_TCE_IOMMU
#2 lore raw
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_frag entry. This causes gcc abort the compilation due to:
=20
setup-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 the pte_frag variable in the

Quoted 8 lines

arch/powerpc/kernel/s=

Quoted 8 lines

mmu context.
=20

---
  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..436d42a7d761 100644

arch/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_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. =20
Therefore you can't have both BOOK3S_64 and BOOK3E_MMU at 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?