Path: blob/master/arch/powerpc/platforms/pseries/kexec.c
10818 views
/*1* Copyright 2006 Michael Ellerman, IBM Corporation2*3* This program is free software; you can redistribute it and/or4* modify it under the terms of the GNU General Public License5* as published by the Free Software Foundation; either version6* 2 of the License, or (at your option) any later version.7*/89#include <linux/kernel.h>10#include <linux/interrupt.h>1112#include <asm/machdep.h>13#include <asm/page.h>14#include <asm/firmware.h>15#include <asm/kexec.h>16#include <asm/mpic.h>17#include <asm/xics.h>18#include <asm/smp.h>1920#include "pseries.h"21#include "plpar_wrappers.h"2223static void pseries_kexec_cpu_down(int crash_shutdown, int secondary)24{25/* Don't risk a hypervisor call if we're crashing */26if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) {27unsigned long addr;2829addr = __pa(get_slb_shadow());30if (unregister_slb_shadow(hard_smp_processor_id(), addr))31printk("SLB shadow buffer deregistration of "32"cpu %u (hw_cpu_id %d) failed\n",33smp_processor_id(),34hard_smp_processor_id());3536addr = __pa(get_lppaca());37if (unregister_vpa(hard_smp_processor_id(), addr)) {38printk("VPA deregistration of cpu %u (hw_cpu_id %d) "39"failed\n", smp_processor_id(),40hard_smp_processor_id());41}42}43}4445static void pseries_kexec_cpu_down_mpic(int crash_shutdown, int secondary)46{47pseries_kexec_cpu_down(crash_shutdown, secondary);48mpic_teardown_this_cpu(secondary);49}5051void __init setup_kexec_cpu_down_mpic(void)52{53ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_mpic;54}5556static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary)57{58pseries_kexec_cpu_down(crash_shutdown, secondary);59xics_kexec_teardown_cpu(secondary);60}6162void __init setup_kexec_cpu_down_xics(void)63{64ppc_md.kexec_cpu_down = pseries_kexec_cpu_down_xics;65}666768