Skip to contentSkip to conversation

KVM: PPC: Fix PR KVM on POWER7 bare metal

PATCH In review Alexander Graf 1 participant 2 messages Apr 25, 2012 – Apr 26, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: PPC: Fix PR KVM on POWER7 bare metal

When running on a system that is HV capable, some interrupts use HSRR SPRs instead of the normal SRR SPRs. These are also used in the Linux handlers to jump back to code after an interrupt got processed.

Unfortunately, in our "jump back to the real host handler after we've done the context switch" code, we were only setting the SRR SPRs, rendering Linux to jump back to some invalid IP after it's processed the interrupt.

This fixes random crashes on p7 opal mode with PR KVM for me.

---
 arch/powerpc/kvm/book3s_segment.S |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
arch/powerpc/kvm/book3s_segment.S +7 -0
index 0676ae2..64f9018 100644
@@ -347,6 +347,13 @@ no_dcbz32_off:
 	/* Load highmem handler address */
 	mtsrr0	r8
 
+#ifdef CONFIG_PPC64
+BEGIN_FTR_SECTION
+	mtspr	SPRN_HSRR1, r6
+	mtspr	SPRN_HSRR0, r8
+END_FTR_SECTION_IFSET(CPU_FTR_HVMODE)
+#endif
+
 	/* RFI into the highmem handler, or jump to interrupt handler */
 	beqctr
 	RFI
Signature · 1 line
1.6.0.2
#1 lore raw
Quoted 10 lines · Alexander Graf

When running on a system that is HV capable, some interrupts use HSRR SPRs instead of the normal SRR SPRs. These are also used in the Linux handlers to jump back to code after an interrupt got processed.

Unfortunately, in our "jump back to the real host handler after we've done the context switch" code, we were only setting the SRR SPRs, rendering Linux to jump back to some invalid IP after it's processed the interrupt.

This fixes random crashes on p7 opal mode with PR KVM for me.

Drop this one; better patch following.

Alex