KVM: PPC: Fix PR KVM on POWER7 bare metal
Subsystems (3)
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
@@ -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
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