[Skiboot] [PATCH 01/16] core/cpu: HID update race

Nicholas Piggin npiggin at gmail.com
Tue Jan 8 01:04:13 AEDT 2019


If the per-core HID register is updated concurrently by multiple
threads, updates can get lost. This has been observed during fast
reboot where the HILE bit does not get cleared on all cores, which
can cause machine check exception interrupts to crash.

Fix this by only updating HID on thread0.

Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
---
 core/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/cpu.c b/core/cpu.c
index a83f8baf1..c27bff920 100644
--- a/core/cpu.c
+++ b/core/cpu.c
@@ -1250,8 +1250,8 @@ void cpu_callin(struct cpu_thread *cpu)
 	sync();
 
 	cpu->job_has_no_return = false;
-
-	init_hid();
+	if (cpu_is_thread0(cpu))
+		init_hid();
 }
 
 static void opal_start_thread_job(void *data)
-- 
2.18.0



More information about the Skiboot mailing list