Thread (8 messages) flat view 8 messages, 5 authors, 2019-11-14

Re: [PATCH v2] powerpc/book3s/mm: Update Oops message to print the correct translation in use

From: Christophe Leroy <hidden>
Date: 2019-07-12 12:36:11


Le 12/07/2019 à 14:22, Michael Ellerman a écrit :
Christophe Leroy [off-list ref] writes:
quoted
Le 12/07/2019 à 08:25, Michael Ellerman a écrit :
quoted
"Aneesh Kumar K.V" [off-list ref] writes:
...
quoted
quoted
quoted
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.
Right, but I'm sure GCC will take care of that since the function is 
static and called only once.

Christophe
cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help