Skip to content

Commit 2621e94

Browse files
committed
powerpc/kexec: Fix kexec/kdump in P9 guest kernels
The code that cleans up the IAMR/AMOR before kexec'ing failed to remember that when we're running as a guest AMOR is not writable, it's hypervisor privileged. They symptom is that the kexec stops before entering purgatory and nothing else is seen on the console. If you examine the state of the system all threads will be in the 0x700 program check handler. Fix it by making the write to AMOR dependent on HV mode. Fixes: 1e2a516 ("powerpc/kexec: Fix radix to hash kexec due to IAMR/AMOR") Cc: stable@vger.kernel.org # v4.10+ Reported-by: Yilin Zhang <yilzhang@redhat.com> Debugged-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Acked-by: Balbir Singh <bsingharora@gmail.com> Reviewed-by: David Gibson <david@gibson.dropbear.id.au> Tested-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent a3961f8 commit 2621e94

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/powerpc/kernel/misc_64.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,9 @@ BEGIN_FTR_SECTION
623623
* NOTE, we rely on r0 being 0 from above.
624624
*/
625625
mtspr SPRN_IAMR,r0
626+
BEGIN_FTR_SECTION_NESTED(42)
626627
mtspr SPRN_AMOR,r0
628+
END_FTR_SECTION_NESTED_IFSET(CPU_FTR_HVMODE, 42)
627629
END_FTR_SECTION_IFSET(CPU_FTR_ARCH_300)
628630

629631
/* save regs for local vars on new stack.

0 commit comments

Comments
 (0)