Thread (6 messages) flat view 6 messages, 3 authors, 2017-07-14

Re: [bug] KVM: Unrecoverable TM Unavailable Exception f60

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2017-07-13 20:59:45

On Thu, 2017-07-13 at 11:46 -0300, Gustavo Romero wrote:
Hi Jan
Looks like that TM unavailable exception will only able to recover
properly if it comes from problem state and since the trigger comes
from kernel space (kvm module) it does not match
"if (user_mode(regs))" in tm_unavailable().

I'm able to avoid this problem using the following patch:
I think the KVM exit path should be enabling TM if necessary rather
than taking the fault.
quoted hunk ↗ jump to hunk
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index d4e545d27ef9..1091dc4f4274 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -1433,13 +1433,11 @@ void vsx_unavailable_exception(struct pt_regs *regs)
 static void tm_unavailable(struct pt_regs *regs)
 {
 #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
-       if (user_mode(regs)) {
-               current->thread.load_tm++;
-               regs->msr |= MSR_TM;
-               tm_enable();
-               tm_restore_sprs(&current->thread);
-               return;
-       }
+       current->thread.load_tm++;
+       regs->msr |= MSR_TM;
+       tm_enable();
+       tm_restore_sprs(&current->thread);
+       return;
 #endif
        pr_emerg("Unrecoverable TM Unavailable Exception "
                        "%lx at %lx\n", regs->trap, regs->nip);
Regards,
Gustavo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help