static void opal_reinit_cores(void) { /* Do the actual re-init, This will clobber all FPRs, VRs, etc... * * It will preserve non volatile GPRs and HSPRG0/1. It will * also restore HIDs and other SPRs to their original value * but it might clobber a bunch. */ #ifdef __BIG_ENDIAN__ opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_BE); #else opal_reinit_cpus(OPAL_REINIT_CPUS_HILE_LE); #endif }
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); } }