[PATCH v2] powerpc/book3s/mm: Update Oops message to print the correct translation in use
Michael Ellerman
mpe at ellerman.id.au
Fri Jul 12 22:22:07 AEST 2019
Christophe Leroy <christophe.leroy at c-s.fr> writes:
> Le 12/07/2019 à 08:25, Michael Ellerman a écrit :
>> "Aneesh Kumar K.V" <aneesh.kumar at 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
More information about the Linuxppc-dev
mailing list