Path: blob/master/arch/powerpc/platforms/pseries/kexec.c
26481 views
// SPDX-License-Identifier: GPL-2.0-or-later1/*2* Copyright 2006 Michael Ellerman, IBM Corporation3*/45#include <linux/kernel.h>6#include <linux/interrupt.h>78#include <asm/setup.h>9#include <asm/page.h>10#include <asm/firmware.h>11#include <asm/kexec.h>12#include <asm/xics.h>13#include <asm/xive.h>14#include <asm/smp.h>15#include <asm/plpar_wrappers.h>1617#include "pseries.h"1819void pseries_kexec_cpu_down(int crash_shutdown, int secondary)20{21/*22* Don't risk a hypervisor call if we're crashing23* XXX: Why? The hypervisor is not crashing. It might be better24* to at least attempt unregister to avoid the hypervisor stepping25* on our memory.26*/27if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {28int ret;29int cpu = smp_processor_id();30int hwcpu = hard_smp_processor_id();3132if (get_lppaca()->dtl_enable_mask) {33ret = unregister_dtl(hwcpu);34if (ret) {35pr_err("WARNING: DTL deregistration for cpu "36"%d (hw %d) failed with %d\n",37cpu, hwcpu, ret);38}39}4041ret = unregister_slb_shadow(hwcpu);42if (ret) {43pr_err("WARNING: SLB shadow buffer deregistration "44"for cpu %d (hw %d) failed with %d\n",45cpu, hwcpu, ret);46}4748ret = unregister_vpa(hwcpu);49if (ret) {50pr_err("WARNING: VPA deregistration for cpu %d "51"(hw %d) failed with %d\n", cpu, hwcpu, ret);52}53}5455if (xive_enabled()) {56xive_teardown_cpu();5758if (!secondary)59xive_shutdown();60} else61xics_kexec_teardown_cpu(secondary);62}636465