static void pnv_kexec_cpu_down(int crash_shutdown, int secondary) { if (xive_enabled()) xive_kexec_teardown_cpu(secondary); else xics_kexec_teardown_cpu(secondary); /* On OPAL, we return all CPUs to firmware */ if (!firmware_has_feature(FW_FEATURE_OPAL)) return; if (secondary) { /* Return secondary CPUs to firmware on OPAL v3 */ mb(); get_paca()->kexec_state = KEXEC_STATE_REAL_MODE; mb(); /* Return the CPU to OPAL */ opal_return_cpu(); } else { /* Primary waits for the secondaries to have reached OPAL */ pnv_kexec_wait_secondaries_down(); /* Switch XIVE back to emulation mode */ if (xive_enabled()) xive_shutdown(); /* * We might be running as little-endian - now that interrupts * are disabled, reset the HILE bit to big-endian so we don't * take interrupts in the wrong endian later */ opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE); } }
static void pnv_kexec_cpu_down(int crash_shutdown, int secondary) { xics_kexec_teardown_cpu(secondary); /* On OPAL v3, we return all CPUs to firmware */ if (!firmware_has_feature(FW_FEATURE_OPALv3)) return; if (secondary) { /* Return secondary CPUs to firmware on OPAL v3 */ mb(); get_paca()->kexec_state = KEXEC_STATE_REAL_MODE; mb(); /* Return the CPU to OPAL */ opal_return_cpu(); } else if (crash_shutdown) { /* * On crash, we don't wait for secondaries to go * down as they might be unreachable or hung, so * instead we just wait a bit and move on. */ mdelay(1); } else { /* Primary waits for the secondaries to have reached OPAL */ pnv_kexec_wait_secondaries_down(); } }
static void pnv_kexec_cpu_down(int crash_shutdown, int secondary) { xics_kexec_teardown_cpu(secondary); /* Return secondary CPUs to firmware on OPAL v3 */ if (firmware_has_feature(FW_FEATURE_OPALv3) && secondary) { mb(); get_paca()->kexec_state = KEXEC_STATE_REAL_MODE; mb(); /* Return the CPU to OPAL */ opal_return_cpu(); } }
static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary) { /* Don't risk a hypervisor call if we're crashing */ if (firmware_has_feature(FW_FEATURE_SPLPAR) && !crash_shutdown) { unsigned long addr; addr = __pa(get_slb_shadow()); if (unregister_slb_shadow(hard_smp_processor_id(), addr)) printk("SLB shadow buffer deregistration of " "cpu %u (hw_cpu_id %d) failed\n", smp_processor_id(), hard_smp_processor_id()); addr = __pa(get_lppaca()); if (unregister_vpa(hard_smp_processor_id(), addr)) { printk("VPA deregistration of cpu %u (hw_cpu_id %d) " "failed\n", smp_processor_id(), hard_smp_processor_id()); } } xics_kexec_teardown_cpu(secondary); }
static void pseries_kexec_cpu_down_xics(int crash_shutdown, int secondary) { pseries_kexec_cpu_down(crash_shutdown, secondary); xics_kexec_teardown_cpu(secondary); }
static void pnv_kexec_cpu_down(int crash_shutdown, int secondary) { xics_kexec_teardown_cpu(secondary); }