From 3a80fe2b3b31f537127b5393af89a549c4d815d9 Mon Sep 17 00:00:00 2001 From: Sepherosa Ziehau Date: Sat, 28 Oct 2017 14:46:31 +0800 Subject: [PATCH] x86_64: Add pauses in the TSC mpsync testing loop. This fixes Intel N3450 deadlock in the tight rdtsc/IPI loop. Suggested-by: dillon@ Tested-by: mneumann@ Dragonfly-bug: http://bugs.dragonflybsd.org/issues/3087 --- sys/platform/pc64/isa/clock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/platform/pc64/isa/clock.c b/sys/platform/pc64/isa/clock.c index 3b9508ef1a..2368c4e58d 100644 --- a/sys/platform/pc64/isa/clock.c +++ b/sys/platform/pc64/isa/clock.c @@ -1277,10 +1277,12 @@ tsc_mpsync_test_loop(struct tsc_mpsync_arg *arg) lwkt_cpusync_init(&cs, gd->gd_other_cpus, tsc_mpsync_test_remote, arg); lwkt_cpusync_interlock(&cs); + cpu_pause(); arg->tsc_target = rdtsc_ordered(); cpu_mfence(); lwkt_cpusync_deinterlock(&cs); crit_exit(); + cpu_pause(); if (!arg->tsc_mpsync) { kprintf("cpu%d: TSC is not MP synchronized @%u\n", -- 2.41.0