Thread (8 messages) flat view 8 messages, 4 authors, 2017-05-25

Re: [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N

From: Michael Neuling <hidden>
Date: 2017-05-25 07:12:23

On Thu, 2017-05-25 at 08:23 +0530, Aneesh Kumar K.V wrote:
Michael Neuling [off-list ref] writes:
=20
quoted
On Wed, 2017-05-24 at 14:26 +0530, Aneesh Kumar K.V wrote:
quoted
Michael Neuling [off-list ref] writes:
=20
quoted
Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot =
on
quoted
quoted
quoted
a P9. This is because we still set MMU_FTR_TYPE_RADIX via
ibm,pa-features and MMU_FTR_TYPE_RADIX is what's used for code patc=
hing
quoted
quoted
quoted
in much of the asm code (ie. slb_miss_realmode)
=20
This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from be=
ing
quoted
quoted
quoted
set from ibm.pa-features.
=20
We may eventually end up removing the CONFIG_PPC_RADIX_MMU option
completely but until then this fixes the issue.
=20
Signed-off-by: Michael Neuling <redacted>
---
=C2=A0arch/powerpc/kernel/prom.c | 2 ++
=C2=A01 file changed, 2 insertions(+)
=20
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.=
c
quoted
quoted
quoted
index 40c4887c27..f830562974 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -161,7 +161,9 @@ static struct ibm_pa_feature {
=C2=A0	{ .pabyte =3D 0,=C2=A0=C2=A0.pabit =3D 3, .cpu_features=C2=
=A0=C2=A0=3D CPU_FTR_CTRL },
quoted
quoted
quoted
=C2=A0	{ .pabyte =3D 0,=C2=A0=C2=A0.pabit =3D 6, .cpu_features=C2=
=A0=C2=A0=3D CPU_FTR_NOEXECUTE
quoted
quoted
quoted
},
=C2=A0	{ .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 2, .mmu_features=C2=
=A0=C2=A0=3D
quoted
quoted
quoted
MMU_FTR_CI_LARGE_PAGE
},
+#ifdef CONFIG_PPC_RADIX_MMU
=C2=A0	{ .pabyte =3D 40, .pabit =3D 0, .mmu_features=C2=A0=C2=A0=3D=
 MMU_FTR_TYPE_RADIX
quoted
quoted
quoted
},
+#endif
=C2=A0	{ .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 1, .invert =3D 1, .cp=
u_features =3D
quoted
quoted
quoted
CPU_FTR_NODSISRALIGN },
=C2=A0	{ .pabyte =3D 5,=C2=A0=C2=A0.pabit =3D 0, .cpu_features=C2=
=A0=C2=A0=3D CPU_FTR_REAL_LE,
quoted
quoted
quoted
=C2=A0				=C2=A0=C2=A0=C2=A0=C2=A0.cpu_user_ftrs =3D
PPC_FEATURE_TRUE_LE },
--=C2=A0
2.11.0
=20
Instead can we do that feature removal in mmu_early_init_devtree. ie,
something like
=20
It looks like mmu_early_init_devtree() gets called after parsing
ibm,pa_features
so that should work.
=20
quoted
diff --git a/arch/powerpc/mm/init_64.c b/arch/powerpc/mm/init_64.c
index 8f6f2a173e47..8f43f3827bac 100644
--- a/arch/powerpc/mm/init_64.c
+++ b/arch/powerpc/mm/init_64.c
@@ -394,7 +394,7 @@ void __init mmu_early_init_devtree(v
oid)
=C2=A0{
=C2=A0	/* Disable radix mode based on kernel command line. */
=C2=A0	/* We don't yet have the machinery to do radix as a guest. */
-	if (disable_radix || !(mfmsr() & MSR_HV))
quoted
+	if (!IS_ENABLED(CONFIG_PPC_RADIX_MMU) || disable_radix ||
!(mfmsr() & MSR_HV))
=20
What tree is this patch against?=C2=A0=C2=A0Linus' tree doesn't look li=
ke that.
quoted
=20
=20
mpe/next at the time of this merge window. Do you want me to send a
complete patch against latest mpe/next ?
If you can test the broken case to make sure it fixes it... Sure!

Thanks,
Mikey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help