KVM: s390: epoch difference and TOD programmable field
This patch makes vcpu epoch difference and the TOD programmable field accessible from userspace. This is needed in order to implement a couple of instructions that deal with the time of day clock on s390, such as SET CLOCK and for migration. Signed-off-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:

committed by
Marcelo Tosatti

parent
14eebd917d
commit
29b7c71b5e
@@ -446,6 +446,14 @@ static int kvm_arch_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu,
|
||||
int r = -EINVAL;
|
||||
|
||||
switch (reg->id) {
|
||||
case KVM_REG_S390_TODPR:
|
||||
r = put_user(vcpu->arch.sie_block->todpr,
|
||||
(u32 __user *)reg->addr);
|
||||
break;
|
||||
case KVM_REG_S390_EPOCHDIFF:
|
||||
r = put_user(vcpu->arch.sie_block->epoch,
|
||||
(u64 __user *)reg->addr);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -459,6 +467,14 @@ static int kvm_arch_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu,
|
||||
int r = -EINVAL;
|
||||
|
||||
switch (reg->id) {
|
||||
case KVM_REG_S390_TODPR:
|
||||
r = get_user(vcpu->arch.sie_block->todpr,
|
||||
(u32 __user *)reg->addr);
|
||||
break;
|
||||
case KVM_REG_S390_EPOCHDIFF:
|
||||
r = get_user(vcpu->arch.sie_block->epoch,
|
||||
(u64 __user *)reg->addr);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Reference in New Issue
Block a user