Christophe Leroy <christophe.le...@c-s.fr> writes: > Le 12/07/2019 à 08:25, Michael Ellerman a écrit : >> "Aneesh Kumar K.V" <aneesh.ku...@linux.ibm.com> writes: ... >>> diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c >>> index 11caa0291254..b181d6860f28 100644 >>> --- a/arch/powerpc/kernel/traps.c >>> +++ b/arch/powerpc/kernel/traps.c >>> @@ -250,15 +250,22 @@ static void oops_end(unsigned long flags, struct >>> pt_regs *regs, >>> } >>> NOKPROBE_SYMBOL(oops_end); >>> >>> +static char *get_mmu_str(void) >>> +{ >>> + if (early_radix_enabled()) >>> + return " MMU=Radix"; >>> + if (early_mmu_has_feature(MMU_FTR_HPTE_TABLE)) >>> + return " MMU=Hash"; >>> + return ""; >>> +} >> >> We don't change MMU once we're up, so just do this logic once and stash >> it into a static string, rather than rechecking on every oops. > > Do we really have oops so often that we have to worry about that ?
Sometimes :) But no I don't mean it's a performance issue, it just seems simpler to compute the value once and store it. In fact for most platforms it can just be a static string at compile time, it's only 64-bit Book3S that needs to do anything at runtime. cheers