Skip to content

Commit 677733e

Browse files
kvaneeshmpe
authored andcommitted
powerpc/book3s64/mm: Don't do tlbie fixup for some hardware revisions
The store ordering vs tlbie issue mentioned in commit a5d4b58 ("powerpc/mm: Fixup tlbie vs store ordering issue on POWER9") is fixed for Nimbus 2.3 and Cumulus 1.3 revisions. We don't need to apply the fixup if we are running on them We can only do this on PowerNV. On pseries guest with KVM we still don't support redoing the feature fixup after migration. So we should be enabling all the workarounds needed, because whe can possibly migrate between DD 2.3 and DD 2.2 Fixes: a5d4b58 ("powerpc/mm: Fixup tlbie vs store ordering issue on POWER9") Cc: [email protected] # v4.16+ Signed-off-by: Aneesh Kumar K.V <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 59545eb commit 677733e

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

arch/powerpc/kernel/dt_cpu_ftrs.c

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,35 @@ static bool __init cpufeatures_process_feature(struct dt_cpu_feature *f)
692692
return true;
693693
}
694694

695+
/*
696+
* Handle POWER9 broadcast tlbie invalidation issue using
697+
* cpu feature flag.
698+
*/
699+
static __init void update_tlbie_feature_flag(unsigned long pvr)
700+
{
701+
if (PVR_VER(pvr) == PVR_POWER9) {
702+
/*
703+
* Set the tlbie feature flag for anything below
704+
* Nimbus DD 2.3 and Cumulus DD 1.3
705+
*/
706+
if ((pvr & 0xe000) == 0) {
707+
/* Nimbus */
708+
if ((pvr & 0xfff) < 0x203)
709+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG;
710+
} else if ((pvr & 0xc000) == 0) {
711+
/* Cumulus */
712+
if ((pvr & 0xfff) < 0x103)
713+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG;
714+
} else {
715+
WARN_ONCE(1, "Unknown PVR");
716+
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG;
717+
}
718+
}
719+
}
720+
695721
static __init void cpufeatures_cpu_quirks(void)
696722
{
697-
int version = mfspr(SPRN_PVR);
723+
unsigned long version = mfspr(SPRN_PVR);
698724

699725
/*
700726
* Not all quirks can be derived from the cpufeatures device tree.
@@ -713,10 +739,10 @@ static __init void cpufeatures_cpu_quirks(void)
713739

714740
if ((version & 0xffff0000) == 0x004e0000) {
715741
cur_cpu_spec->cpu_features &= ~(CPU_FTR_DAWR);
716-
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TLBIE_BUG;
717742
cur_cpu_spec->cpu_features |= CPU_FTR_P9_TIDR;
718743
}
719744

745+
update_tlbie_feature_flag(version);
720746
/*
721747
* PKEY was not in the initial base or feature node
722748
* specification, but it should become optional in the next

0 commit comments

Comments
 (0)