mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 05:41:55 +00:00
113fe88eed
asm/machdep.h doesn't need asm/setup.h Remove it. Add it directly in files that needs it. Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/3b1dfb19a2c3265fb4abc2bfc7b6eae9261a998b.1654966508.git.christophe.leroy@csgroup.eu
72 lines
1.6 KiB
C
72 lines
1.6 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Copyright 2006 Michael Ellerman, IBM Corporation
|
|
*/
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/interrupt.h>
|
|
|
|
#include <asm/setup.h>
|
|
#include <asm/page.h>
|
|
#include <asm/firmware.h>
|
|
#include <asm/kexec.h>
|
|
#include <asm/xics.h>
|
|
#include <asm/xive.h>
|
|
#include <asm/smp.h>
|
|
#include <asm/plpar_wrappers.h>
|
|
|
|
#include "pseries.h"
|
|
|
|
void pseries_kexec_cpu_down(int crash_shutdown, int secondary)
|
|
{
|
|
/*
|
|
* Don't risk a hypervisor call if we're crashing
|
|
* XXX: Why? The hypervisor is not crashing. It might be better
|
|
* to at least attempt unregister to avoid the hypervisor stepping
|
|
* on our memory.
|
|
*/
|
|
if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {
|
|
int ret;
|
|
int cpu = smp_processor_id();
|
|
int hwcpu = hard_smp_processor_id();
|
|
|
|
if (get_lppaca()->dtl_enable_mask) {
|
|
ret = unregister_dtl(hwcpu);
|
|
if (ret) {
|
|
pr_err("WARNING: DTL deregistration for cpu "
|
|
"%d (hw %d) failed with %d\n",
|
|
cpu, hwcpu, ret);
|
|
}
|
|
}
|
|
|
|
ret = unregister_slb_shadow(hwcpu);
|
|
if (ret) {
|
|
pr_err("WARNING: SLB shadow buffer deregistration "
|
|
"for cpu %d (hw %d) failed with %d\n",
|
|
cpu, hwcpu, ret);
|
|
}
|
|
|
|
ret = unregister_vpa(hwcpu);
|
|
if (ret) {
|
|
pr_err("WARNING: VPA deregistration for cpu %d "
|
|
"(hw %d) failed with %d\n", cpu, hwcpu, ret);
|
|
}
|
|
}
|
|
|
|
if (xive_enabled()) {
|
|
xive_teardown_cpu();
|
|
|
|
if (!secondary)
|
|
xive_shutdown();
|
|
} else
|
|
xics_kexec_teardown_cpu(secondary);
|
|
}
|
|
|
|
void pseries_machine_kexec(struct kimage *image)
|
|
{
|
|
if (firmware_has_feature(FW_FEATURE_SET_MODE))
|
|
pseries_disable_reloc_on_exc();
|
|
|
|
default_machine_kexec(image);
|
|
}
|