* [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N
@ 2017-05-24 7:03 Michael Neuling
2017-05-24 8:56 ` Aneesh Kumar K.V
2017-05-25 13:22 ` Michael Ellerman
0 siblings, 2 replies; 8+ messages in thread
From: Michael Neuling @ 2017-05-24 7:03 UTC (permalink / raw)
To: mpe, linuxppc-dev, anton, aneesh.kumar, mikey, Greg Johnson
Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot on
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 patching
in much of the asm code (ie. slb_miss_realmode)
This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from being
set from ibm.pa-features.
We may eventually end up removing the CONFIG_PPC_RADIX_MMU option
completely but until then this fixes the issue.
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
arch/powerpc/kernel/prom.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
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 {
{ .pabyte = 0, .pabit = 3, .cpu_features = CPU_FTR_CTRL },
{ .pabyte = 0, .pabit = 6, .cpu_features = CPU_FTR_NOEXECUTE },
{ .pabyte = 1, .pabit = 2, .mmu_features = MMU_FTR_CI_LARGE_PAGE },
+#ifdef CONFIG_PPC_RADIX_MMU
{ .pabyte = 40, .pabit = 0, .mmu_features = MMU_FTR_TYPE_RADIX },
+#endif
{ .pabyte = 1, .pabit = 1, .invert = 1, .cpu_features = CPU_FTR_NODSISRALIGN },
{ .pabyte = 5, .pabit = 0, .cpu_features = CPU_FTR_REAL_LE,
.cpu_user_ftrs = PPC_FEATURE_TRUE_LE },
--
2.11.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N
2017-05-24 7:03 [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N Michael Neuling
@ 2017-05-24 8:56 ` Aneesh Kumar K.V
2017-05-25 0:13 ` Michael Neuling
2017-05-25 13:22 ` Michael Ellerman
1 sibling, 1 reply; 8+ messages in thread
From: Aneesh Kumar K.V @ 2017-05-24 8:56 UTC (permalink / raw)
To: Michael Neuling, mpe, linuxppc-dev, anton, mikey, Greg Johnson
Michael Neuling <mikey@neuling.org> writes:
> Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot on
> 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 patching
> in much of the asm code (ie. slb_miss_realmode)
>
> This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from being
> set from ibm.pa-features.
>
> We may eventually end up removing the CONFIG_PPC_RADIX_MMU option
> completely but until then this fixes the issue.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
> ---
> arch/powerpc/kernel/prom.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> 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 {
> { .pabyte = 0, .pabit = 3, .cpu_features = CPU_FTR_CTRL },
> { .pabyte = 0, .pabit = 6, .cpu_features = CPU_FTR_NOEXECUTE },
> { .pabyte = 1, .pabit = 2, .mmu_features = MMU_FTR_CI_LARGE_PAGE },
> +#ifdef CONFIG_PPC_RADIX_MMU
> { .pabyte = 40, .pabit = 0, .mmu_features = MMU_FTR_TYPE_RADIX },
> +#endif
> { .pabyte = 1, .pabit = 1, .invert = 1, .cpu_features = CPU_FTR_NODSISRALIGN },
> { .pabyte = 5, .pabit = 0, .cpu_features = CPU_FTR_REAL_LE,
> .cpu_user_ftrs = PPC_FEATURE_TRUE_LE },
> --
> 2.11.0
Instead can we do that feature removal in mmu_early_init_devtree. ie, something like
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(void)
{
/* Disable radix mode based on kernel command line. */
/* We don't yet have the machinery to do radix as a guest. */
- if (disable_radix || !(mfmsr() & MSR_HV))
+ if (!IS_ENABLED(CONFIG_PPC_RADIX_MMU) || disable_radix || !(mfmsr() & MSR_HV))
cur_cpu_spec->mmu_features &= ~MMU_FTR_TYPE_RADIX;
/*
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N
2017-05-24 8:56 ` Aneesh Kumar K.V
@ 2017-05-25 0:13 ` Michael Neuling
2017-05-25 2:53 ` Aneesh Kumar K.V
2017-05-25 6:16 ` Michael Ellerman
0 siblings, 2 replies; 8+ messages in thread
From: Michael Neuling @ 2017-05-25 0:13 UTC (permalink / raw)
To: Aneesh Kumar K.V, mpe, linuxppc-dev, anton, Greg Johnson
On Wed, 2017-05-24 at 14:26 +0530, Aneesh Kumar K.V wrote:
> Michael Neuling <mikey@neuling.org> writes:
>=20
> > Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot on
> > 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 patching
> > in much of the asm code (ie. slb_miss_realmode)
> >=20
> > This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from being
> > 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 <mikey@neuling.org>
> > ---
> > =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
> > 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 },
> > =C2=A0 { .pabyte =3D 0,=C2=A0=C2=A0.pabit =3D 6, .cpu_features=C2=A0=C2=
=A0=3D CPU_FTR_NOEXECUTE },
> > =C2=A0 { .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 2, .mmu_features=C2=A0=C2=
=A0=3D 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 },
> > +#endif
> > =C2=A0 { .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 1, .invert =3D 1, .cpu_fe=
atures =3D
> > 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,
> > =C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0.cpu_user_ftrs =3D PPC_FEATURE_TRUE_L=
E },
> > --=C2=A0
> > 2.11.0
>=20
> Instead can we do that feature removal in mmu_early_init_devtree. ie,
> something like
It looks like mmu_early_init_devtree() gets called after parsing ibm,pa_fea=
tures
so that should work.
> 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))
> > + if (!IS_ENABLED(CONFIG_PPC_RADIX_MMU) || disable_radix || !(mfmsr() &=
MSR_HV))
What tree is this patch against? Linus' tree doesn't look like that.
Mikey
> =C2=A0 cur_cpu_spec->mmu_features &=3D ~MMU_FTR_TYPE_RADIX;
> =C2=A0
> =C2=A0 /*
>=20
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N
2017-05-25 0:13 ` Michael Neuling
@ 2017-05-25 2:53 ` Aneesh Kumar K.V
2017-05-25 7:12 ` Michael Neuling
2017-05-25 6:16 ` Michael Ellerman
1 sibling, 1 reply; 8+ messages in thread
From: Aneesh Kumar K.V @ 2017-05-25 2:53 UTC (permalink / raw)
To: Michael Neuling, mpe, linuxppc-dev, anton, Greg Johnson
Michael Neuling <mikey@neuling.org> writes:
> On Wed, 2017-05-24 at 14:26 +0530, Aneesh Kumar K.V wrote:
>> Michael Neuling <mikey@neuling.org> writes:
>>=20
>> > Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot on
>> > 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 patching
>> > in much of the asm code (ie. slb_miss_realmode)
>> >=20
>> > This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from being
>> > 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 <mikey@neuling.org>
>> > ---
>> > =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
>> > 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 },
>> > =C2=A0 { .pabyte =3D 0,=C2=A0=C2=A0.pabit =3D 6, .cpu_features=C2=A0=
=C2=A0=3D CPU_FTR_NOEXECUTE },
>> > =C2=A0 { .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 2, .mmu_features=C2=A0=
=C2=A0=3D 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 MM=
U_FTR_TYPE_RADIX },
>> > +#endif
>> > =C2=A0 { .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 1, .invert =3D 1, .cpu_f=
eatures =3D
>> > 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,
>> > =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
>
> It looks like mmu_early_init_devtree() gets called after parsing ibm,pa_f=
eatures
> so that should work.
>
>> 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))
>> > + if (!IS_ENABLED(CONFIG_PPC_RADIX_MMU) || disable_radix || !(mfmsr() =
& MSR_HV))
>
> What tree is this patch against? Linus' tree doesn't look like that.
>
mpe/next at the time of this merge window. Do you want me to send a
complete patch against latest mpe/next ?
-aneesh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N
2017-05-25 0:13 ` Michael Neuling
2017-05-25 2:53 ` Aneesh Kumar K.V
@ 2017-05-25 6:16 ` Michael Ellerman
2017-05-25 6:22 ` Aneesh Kumar K.V
1 sibling, 1 reply; 8+ messages in thread
From: Michael Ellerman @ 2017-05-25 6:16 UTC (permalink / raw)
To: Michael Neuling, Aneesh Kumar K.V, linuxppc-dev, anton,
Greg Johnson
Michael Neuling <mikey@neuling.org> writes:
> On Wed, 2017-05-24 at 14:26 +0530, Aneesh Kumar K.V wrote:
>> Michael Neuling <mikey@neuling.org> writes:
>>=20
>> > Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot on
>> > 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 patching
>> > in much of the asm code (ie. slb_miss_realmode)
>> >=20
>> > This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from being
>> > 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 <mikey@neuling.org>
>> > ---
>> > =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
>> > 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 },
>> > =C2=A0 { .pabyte =3D 0,=C2=A0=C2=A0.pabit =3D 6, .cpu_features=C2=A0=
=C2=A0=3D CPU_FTR_NOEXECUTE },
>> > =C2=A0 { .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 2, .mmu_features=C2=A0=
=C2=A0=3D 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 MM=
U_FTR_TYPE_RADIX },
>> > +#endif
>> > =C2=A0 { .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 1, .invert =3D 1, .cpu_f=
eatures =3D
>> > 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,
>> > =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
>
> It looks like mmu_early_init_devtree() gets called after parsing ibm,pa_f=
eatures
> so that should work.
But why is doing it later preferable?
Mikey's patch means it will never be set at any point during boot, which
seems obviously better to me.
cheers
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N
2017-05-25 6:16 ` Michael Ellerman
@ 2017-05-25 6:22 ` Aneesh Kumar K.V
0 siblings, 0 replies; 8+ messages in thread
From: Aneesh Kumar K.V @ 2017-05-25 6:22 UTC (permalink / raw)
To: Michael Ellerman, Michael Neuling, linuxppc-dev, anton,
Greg Johnson
On Thursday 25 May 2017 11:46 AM, Michael Ellerman wrote:
> Michael Neuling <mikey@neuling.org> writes:
>
>> On Wed, 2017-05-24 at 14:26 +0530, Aneesh Kumar K.V wrote:
>>> Michael Neuling <mikey@neuling.org> writes:
>>>
>>>> Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot on
>>>> 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 patching
>>>> in much of the asm code (ie. slb_miss_realmode)
>>>>
>>>> This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from being
>>>> set from ibm.pa-features.
>>>>
>>>> We may eventually end up removing the CONFIG_PPC_RADIX_MMU option
>>>> completely but until then this fixes the issue.
>>>>
>>>> Signed-off-by: Michael Neuling <mikey@neuling.org>
>>>> ---
>>>> arch/powerpc/kernel/prom.c | 2 ++
>>>> 1 file changed, 2 insertions(+)
>>>>
>>>> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
>>>> 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 {
>>>> { .pabyte = 0, .pabit = 3, .cpu_features = CPU_FTR_CTRL },
>>>> { .pabyte = 0, .pabit = 6, .cpu_features = CPU_FTR_NOEXECUTE },
>>>> { .pabyte = 1, .pabit = 2, .mmu_features = MMU_FTR_CI_LARGE_PAGE
>>>> },
>>>> +#ifdef CONFIG_PPC_RADIX_MMU
>>>> { .pabyte = 40, .pabit = 0, .mmu_features = MMU_FTR_TYPE_RADIX },
>>>> +#endif
>>>> { .pabyte = 1, .pabit = 1, .invert = 1, .cpu_features =
>>>> CPU_FTR_NODSISRALIGN },
>>>> { .pabyte = 5, .pabit = 0, .cpu_features = CPU_FTR_REAL_LE,
>>>> .cpu_user_ftrs = PPC_FEATURE_TRUE_LE },
>>>> --
>>>> 2.11.0
>>>
>>> Instead can we do that feature removal in mmu_early_init_devtree. ie,
>>> something like
>>
>> It looks like mmu_early_init_devtree() gets called after parsing ibm,pa_features
>> so that should work.
>
> But why is doing it later preferable?
>
> Mikey's patch means it will never be set at any point during boot, which
> seems obviously better to me.
My suggestion was w.r.t consolidating different ways of clearing
RADIX_MMU feature flag into one place. Also I was not sure we want to
conditionally parse the pa-feature device tree. Instead we parse it
without any #ifdef in there and clear things which are not supported by
the kernel either via command line or via Kconfig.
-aneesh
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N
2017-05-25 2:53 ` Aneesh Kumar K.V
@ 2017-05-25 7:12 ` Michael Neuling
0 siblings, 0 replies; 8+ messages in thread
From: Michael Neuling @ 2017-05-25 7:12 UTC (permalink / raw)
To: Aneesh Kumar K.V, mpe, linuxppc-dev, anton, Greg Johnson
On Thu, 2017-05-25 at 08:23 +0530, Aneesh Kumar K.V wrote:
> Michael Neuling <mikey@neuling.org> writes:
>=20
> > On Wed, 2017-05-24 at 14:26 +0530, Aneesh Kumar K.V wrote:
> > > Michael Neuling <mikey@neuling.org> writes:
> > >=20
> > > > Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot =
on
> > > > 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
> > > > 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
> > > > 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 <mikey@neuling.org>
> > > > ---
> > > > =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
> > > > 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 },
> > > > =C2=A0 { .pabyte =3D 0,=C2=A0=C2=A0.pabit =3D 6, .cpu_features=C2=
=A0=C2=A0=3D CPU_FTR_NOEXECUTE
> > > > },
> > > > =C2=A0 { .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 2, .mmu_features=C2=
=A0=C2=A0=3D
> > > > 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
> > > > },
> > > > +#endif
> > > > =C2=A0 { .pabyte =3D 1,=C2=A0=C2=A0.pabit =3D 1, .invert =3D 1, .cp=
u_features =3D
> > > > 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,
> > > > =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
> > > 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))
> > > > + 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.
> >=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
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N
2017-05-24 7:03 [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N Michael Neuling
2017-05-24 8:56 ` Aneesh Kumar K.V
@ 2017-05-25 13:22 ` Michael Ellerman
1 sibling, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2017-05-25 13:22 UTC (permalink / raw)
To: Michael Neuling, linuxppc-dev, anton, aneesh.kumar, mikey,
Greg Johnson
On Wed, 2017-05-24 at 07:03:26 UTC, Michael Neuling wrote:
> Currently if you disable CONFIG_PPC_RADIX_MMU you'll crash on boot on
> 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 patching
> in much of the asm code (ie. slb_miss_realmode)
>
> This patch fixes the problem by stopping MMU_FTR_TYPE_RADIX from being
> set from ibm.pa-features.
>
> We may eventually end up removing the CONFIG_PPC_RADIX_MMU option
> completely but until then this fixes the issue.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/d957fb4d173647640a2b83e7c7e56a
cheers
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-05-25 13:22 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-24 7:03 [PATCH] powerpc: Fix booting P9 hash with CONFIG_PPC_RADIX_MMU=N Michael Neuling
2017-05-24 8:56 ` Aneesh Kumar K.V
2017-05-25 0:13 ` Michael Neuling
2017-05-25 2:53 ` Aneesh Kumar K.V
2017-05-25 7:12 ` Michael Neuling
2017-05-25 6:16 ` Michael Ellerman
2017-05-25 6:22 ` Aneesh Kumar K.V
2017-05-25 13:22 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).