summaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/kvm-s390.h
diff options
context:
space:
mode:
authorDavid Hildenbrand2014-04-10 17:35:00 +0200
committerChristian Borntraeger2014-07-10 14:11:17 +0200
commit6352e4d2dd9a349024a41356148eced553e1dce4 (patch)
tree2835b0ebeacb7dc0f13e4df266f38e441b08243a /arch/s390/kvm/kvm-s390.h
parentKVM: prepare for KVM_(S|G)ET_MP_STATE on other architectures (diff)
downloadkernel-qcow2-linux-6352e4d2dd9a349024a41356148eced553e1dce4.tar.gz
kernel-qcow2-linux-6352e4d2dd9a349024a41356148eced553e1dce4.tar.xz
kernel-qcow2-linux-6352e4d2dd9a349024a41356148eced553e1dce4.zip
KVM: s390: implement KVM_(S|G)ET_MP_STATE for user space state control
This patch - adds s390 specific MP states to linux headers and documents them - implements the KVM_{SET,GET}_MP_STATE ioctls - enables KVM_CAP_MP_STATE - allows user space to control the VCPU state on s390. If user space sets the VCPU state using the ioctl KVM_SET_MP_STATE, we can disable manual changing of the VCPU state and trust user space to do the right thing. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.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.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index 77ed846342d4..33a0e4bed2a5 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -129,6 +129,12 @@ static inline void kvm_s390_set_psw_cc(struct kvm_vcpu *vcpu, unsigned long cc)
vcpu->arch.sie_block->gpsw.mask |= cc << 44;
}
+/* are cpu states controlled by user space */
+static inline int kvm_s390_user_cpu_state_ctrl(struct kvm *kvm)
+{
+ return kvm->arch.user_cpu_state_ctrl != 0;
+}
+
int kvm_s390_handle_wait(struct kvm_vcpu *vcpu);
enum hrtimer_restart kvm_s390_idle_wakeup(struct hrtimer *timer);
void kvm_s390_tasklet(unsigned long parm);