]> www.infradead.org Git - users/dwmw2/linux.git/commit
KVM: s390: Fix race condition in kvm_s390_handle_wait
authorCarsten Otte <cotte@de.ibm.com>
Wed, 21 May 2008 11:37:44 +0000 (13:37 +0200)
committerAvi Kivity <avi@qumranet.com>
Thu, 22 May 2008 09:17:44 +0000 (12:17 +0300)
commit3adebb96906d4d5d5b09cf16d75e87318f6a118c
tree3bf184cef856c0eab74e56d39482ef59ad44a814
parent11f5ba9ffd728a64598c9da3c9ee20bd7505d62c
KVM: s390: Fix race condition in kvm_s390_handle_wait

The call to add_timer was issued before local_int.lock was taken and before
timer_due was set to 0. If the timer expires before the lock is being taken,
the timer function will set timer_due to 1 and exit before the vcpu falls
asleep. Depending on other external events, the vcpu might sleep forever.
This fix pulls setting timer_due to the beginning of the function before
add_timer, which ensures correct behavior.

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Avi Kivity <avi@qumranet.com>
arch/s390/kvm/interrupt.c