Commit b1301797 authored by Anton Blanchard's avatar Anton Blanchard Committed by Benjamin Herrenschmidt

powerpc/pseries: Fix kexec on recent firmware versions

Recent versions of firmware will fail to unmap the virtual processor
area if we have a dispatch trace log registered. This causes kexec
to fail.

If a trace log is registered this patch unregisters it before the
SLB shadow and virtual processor areas, fixing the problem.

The address argument is ignored by firmware on unregister so we
may as well remove it.
Signed-off-by: default avatarAnton Blanchard <anton@samba.org>
Cc: <stable@kernel.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent a149507b
...@@ -181,7 +181,7 @@ static void dtl_stop(struct dtl *dtl) ...@@ -181,7 +181,7 @@ static void dtl_stop(struct dtl *dtl)
lppaca_of(dtl->cpu).dtl_enable_mask = 0x0; lppaca_of(dtl->cpu).dtl_enable_mask = 0x0;
unregister_dtl(hwcpu, __pa(dtl->buf)); unregister_dtl(hwcpu);
} }
static u64 dtl_current_index(struct dtl *dtl) static u64 dtl_current_index(struct dtl *dtl)
......
...@@ -26,6 +26,17 @@ static void pseries_kexec_cpu_down(int crash_shutdown, int secondary) ...@@ -26,6 +26,17 @@ static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
/* Don't risk a hypervisor call if we're crashing */ /* Don't risk a hypervisor call if we're crashing */
if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
unsigned long addr; unsigned long addr;
int ret;
if (get_lppaca()->dtl_enable_mask) {
ret = unregister_dtl(hard_smp_processor_id());
if (ret) {
pr_err("WARNING: DTL deregistration for cpu "
"%d (hw %d) failed with %d\n",
smp_processor_id(),
hard_smp_processor_id(), ret);
}
}
addr = __pa(get_slb_shadow()); addr = __pa(get_slb_shadow());
if (unregister_slb_shadow(hard_smp_processor_id(), addr)) if (unregister_slb_shadow(hard_smp_processor_id(), addr))
......
...@@ -73,9 +73,9 @@ static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa) ...@@ -73,9 +73,9 @@ static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa)
return vpa_call(0x3, cpu, vpa); return vpa_call(0x3, cpu, vpa);
} }
static inline long unregister_dtl(unsigned long cpu, unsigned long vpa) static inline long unregister_dtl(unsigned long cpu)
{ {
return vpa_call(0x6, cpu, vpa); return vpa_call(0x6, cpu, 0);
} }
static inline long register_dtl(unsigned long cpu, unsigned long vpa) static inline long register_dtl(unsigned long cpu, unsigned long vpa)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment