diff mbox series

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

Message ID 20190107140428.16388-2-npiggin@gmail.com
State Accepted
Headers show
Series assorted MCE and SRESET handling and reporting | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master

Commit Message

Nicholas Piggin Jan. 7, 2019, 2:04 p.m. UTC
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@gmail.com>
---
 core/cpu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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)