diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2016-02-22 13:52:27 +0100 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2016-03-08 13:57:53 +0100 |
commit | 5ebda31686af6bb70affdcc5777ebc7ed81c0eac (patch) | |
tree | a7adb2bfe6e9ac7581969c37d512064dd3616d61 /arch/s390/kvm/kvm-s390.h | |
parent | KVM: s390: protect VCPU cpu timer with a seqcount (diff) | |
download | linux-5ebda31686af6bb70affdcc5777ebc7ed81c0eac.tar.xz linux-5ebda31686af6bb70affdcc5777ebc7ed81c0eac.zip |
KVM: s390: step the VCPU timer while in enabled wait
The cpu timer is a mean to measure task execution time. We want
to account everything for a VCPU for which it is responsible. Therefore,
if the VCPU wants to sleep, it shall be accounted for it.
We can easily get this done by not disabling cpu timer accounting when
scheduled out while sleeping because of enabled wait.
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/kvm-s390.h')
-rw-r--r-- | arch/s390/kvm/kvm-s390.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h index 9787299d9a29..b1f7ee3bd72d 100644 --- a/arch/s390/kvm/kvm-s390.h +++ b/arch/s390/kvm/kvm-s390.h @@ -54,6 +54,11 @@ static inline int is_vcpu_stopped(struct kvm_vcpu *vcpu) return atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_STOPPED; } +static inline int is_vcpu_idle(struct kvm_vcpu *vcpu) +{ + return atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_WAIT; +} + static inline int kvm_is_ucontrol(struct kvm *kvm) { #ifdef CONFIG_KVM_S390_UCONTROL |