From: Marcelo Tosatti Date: Fri, 11 Apr 2008 17:53:26 +0000 (-0300) Subject: KVM: hlt emulation should take in-kernel APIC/PIT timers into account X-Git-Tag: v2.6.26-rc1~1028^2~20 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d80840d96127401ba6aeadd813c3a15b84e70fe;p=pandora-kernel.git KVM: hlt emulation should take in-kernel APIC/PIT timers into account Timers that fire between guest hlt and vcpu_block's add_wait_queue() are ignored, possibly resulting in hangs. Also make sure that atomic_inc and waitqueue_active tests happen in the specified order, otherwise the following race is open: CPU0 CPU1 if (waitqueue_active(wq)) add_wait_queue() if (!atomic_read(pit_timer->pending)) schedule() atomic_inc(pit_timer->pending) Signed-off-by: Marcelo Tosatti Signed-off-by: Avi Kivity --- Reading git-diff-tree failed