diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2009-05-12 11:21:49 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:55 -0400 |
commit | ca8723023f25c9a70d76cbd6101f8fb4ffec2fa0 (patch) | |
tree | ef753d244a55271279b5b2cf29b28db5b35b454c /arch/s390/kvm/kvm-s390.h | |
parent | 2668dab794272f0898491acaf1e77e9a005abc0f (diff) |
KVM: s390: use hrtimer for clock wakeup from idle - v2
This patch reworks the s390 clock comparator wakeup to hrtimer. The clock
comparator is a per-cpu value that is compared against the TOD clock. If
ckc <= TOD an external interrupt 1004 is triggered. Since the clock comparator
and the TOD clock have a much higher resolution than jiffies we should use
hrtimers to trigger the wakeup. This speeds up guest nanosleep for small
values.
Since hrtimers callbacks run in hard-irq context, I added a tasklet to do
the actual work with enabled interrupts.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Signed-off-by: Christian Ehrhardt <ehrhardt@de.ibm.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/s390/kvm/kvm-s390.h')
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index 00bbe69b78da..748fee872323 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #ifndef ARCH_S390_KVM_S390_H | 14 | #ifndef ARCH_S390_KVM_S390_H |
15 | #define ARCH_S390_KVM_S390_H | 15 | #define ARCH_S390_KVM_S390_H |
16 | 16 | ||
17 | #include <linux/hrtimer.h> | ||
17 | #include <linux/kvm.h> | 18 | #include <linux/kvm.h> |
18 | #include <linux/kvm_host.h> | 19 | #include <linux/kvm_host.h> |
19 | 20 | ||
@@ -41,7 +42,8 @@ static inline int __cpu_is_stopped(struct kvm_vcpu *vcpu) | |||
41 | } | 42 | } |
42 | 43 | ||
43 | int kvm_s390_handle_wait(struct kvm_vcpu *vcpu); | 44 | int kvm_s390_handle_wait(struct kvm_vcpu *vcpu); |
44 | void kvm_s390_idle_wakeup(unsigned long data); | 45 | enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer); |
46 | void kvm_s390_tasklet(unsigned long parm); | ||
45 | void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu); | 47 | void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu); |
46 | int kvm_s390_inject_vm(struct kvm *kvm, | 48 | int kvm_s390_inject_vm(struct kvm *kvm, |
47 | struct kvm_s390_interrupt *s390int); | 49 | struct kvm_s390_interrupt *s390int); |