[Skiboot] [PATCH 2/2] cpu: Unconditionally re-initialise SPRs in opal_reinit_cpus()
Nicholas Piggin
npiggin at gmail.com
Tue Oct 24 22:41:00 AEDT 2017
opal_reinit_cpus should re-initialise SPRs to their boot state,
because it should things according to the boot state.
This solves the problem that the hypervisor may change SPRs before
kexecing to a new kernel.
Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
core/cpu.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/core/cpu.c b/core/cpu.c
index 27e0d6cf..02f6a613 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -1246,6 +1246,13 @@ void cpu_set_radix_mode(void)
static void cpu_cleanup_one(void *param __unused)
{
+ struct cpu_thread *cpu = this_cpu();
+
+ /* Bring SPRs back to boot state */
+ if (cpu_is_thread0(cpu))
+ init_shared_sprs();
+ init_replicated_sprs();
+
mtspr(SPR_AMR, 0);
mtspr(SPR_IAMR, 0);
}
--
2.13.3
More information about the Skiboot
mailing list