]> git.karo-electronics.de Git - linux-beck.git/commit
KVM: s390: wake up when the VCPU cpu timer expires
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Mon, 22 Feb 2016 13:14:50 +0000 (14:14 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 8 Mar 2016 12:57:53 +0000 (13:57 +0100)
commitb3c17f10fa2cfc29cf35e4821275e046e725213e
treef9b80110e242ab7f1c044970d7e31f71a7234d37
parent5ebda31686af6bb70affdcc5777ebc7ed81c0eac
KVM: s390: wake up when the VCPU cpu timer expires

When the VCPU cpu timer expires, we have to wake up just like when the ckc
triggers. For now, setting up a cpu timer in the guest and going into
enabled wait will never lead to a wakeup. This patch fixes this problem.
Just as for the ckc, we have to take care of waking up too early. We
have to recalculate the sleep time and go back to sleep.

Please note that the timer callback calls kvm_s390_get_cpu_timer() from
interrupt context. As the timer is canceled when leaving handle_wait(),
and we don't do any VCPU cpu timer writes/updates in that function, we can
be sure that we will never try to read the VCPU cpu timer from the same cpu
that is currentyl updating the timer (deadlock).

Reported-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Tested-by: Sascha Silbe <silbe@linux.vnet.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/interrupt.c