summaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/kvm-s390.h
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2018-01-23 18:05:31 +0100
committerChristian Borntraeger <borntraeger@de.ibm.com>2018-01-24 17:46:42 +0100
commit8d5fb0dc4ec069ea02395593e9b6b2b39a92457e (patch)
tree4ac7480336b33dfdb2475c28e176736e97000dc4 /arch/s390/kvm/kvm-s390.h
parentKVM: s390: introduce and use kvm_s390_clear_cpuflags() (diff)
downloadlinux-8d5fb0dc4ec069ea02395593e9b6b2b39a92457e.tar.xz
linux-8d5fb0dc4ec069ea02395593e9b6b2b39a92457e.zip
KVM: s390: introduce and use kvm_s390_test_cpuflags()
Use it just like kvm_s390_set_cpuflags() and kvm_s390_clear_cpuflags(). Signed-off-by: David Hildenbrand <david@redhat.com> Message-Id: <20180123170531.13687-5-david@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Cornelia Huck <cohuck@redhat.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.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index f727313a706f..f110fa96807e 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -57,9 +57,14 @@ static inline void kvm_s390_clear_cpuflags(struct kvm_vcpu *vcpu, u32 flags)
atomic_andnot(flags, &vcpu->arch.sie_block->cpuflags);
}
+static inline bool kvm_s390_test_cpuflags(struct kvm_vcpu *vcpu, u32 flags)
+{
+ return (atomic_read(&vcpu->arch.sie_block->cpuflags) & flags) == flags;
+}
+
static inline int is_vcpu_stopped(struct kvm_vcpu *vcpu)
{
- return atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_STOPPED;
+ return kvm_s390_test_cpuflags(vcpu, CPUSTAT_STOPPED);
}
static inline int is_vcpu_idle(struct kvm_vcpu *vcpu)