[FIX PATCH] powerpc/prom: Enable Radix GTSE in cpu pa-features
Nicholas Piggin
npiggin at gmail.com
Mon Jul 20 15:38:29 AEST 2020
Excerpts from Bharata B Rao's message of July 20, 2020 2:42 pm:
> From: Nicholas Piggin <npiggin at gmail.com>
>
> When '029ab30b4c0a ("powerpc/mm: Enable radix GTSE only if supported.")'
> made GTSE an MMU feature, it was enabled by default in
> powerpc-cpu-features but was missed in pa-features. This causes
> random memory corruption during boot of PowerNV kernels where
> CONFIG_PPC_DT_CPU_FTRS isn't enabled.
Thanks for writing this up, I got a bit bogged down with other things.
> Fixes: 029ab30b4c0a ("powerpc/mm: Enable radix GTSE only if supported.")
> Reported-by: Qian Cai <cai at lca.pw>
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
> Signed-off-by: Bharata B Rao <bharata at linux.ibm.com>
> ---
> arch/powerpc/kernel/prom.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
> index 9cc49f265c86..a9594bad572a 100644
> --- a/arch/powerpc/kernel/prom.c
> +++ b/arch/powerpc/kernel/prom.c
> @@ -163,7 +163,8 @@ static struct ibm_pa_feature {
> { .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 },
> + { .pabyte = 40, .pabit = 0,
> + .mmu_features = (MMU_FTR_TYPE_RADIX | MMU_FTR_GTSE) },
It might look better like this:
{ .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 },
{ .pabyte = 40, .pabit = 0, .mmu_features = MMU_FTR_TYPE_RADIX |
MMU_FTR_GTSE },
#endif
{ .pabyte = 1, .pabit = 1, .invert = 1, .cpu_features = CPU_FTR_NODSISRALIGN },
But that's bikeshedding a bit and the optional bits already put it out
of alignment.
Thanks,
Nick
More information about the Linuxppc-dev
mailing list