aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorCarsten Otte <cotte@de.ibm.com>2012-05-15 08:15:27 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2012-05-17 20:06:02 -0400
commit29b7c71b5ecf2caaa4c2105ecc0094826db8a8a8 (patch)
tree1dac9e51e30b008aaf53422f5d2e5aa67259a6bd /arch/s390/kvm
parent14eebd917d154f3181d2cb219e40b18eec314db7 (diff)
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>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/kvm-s390.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 894b3e47b8c1..cc4c01322ce4 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -446,6 +446,14 @@ static int kvm_arch_vcpu_ioctl_get_one_reg(struct kvm_vcpu *vcpu,
446 int r = -EINVAL; 446 int r = -EINVAL;
447 447
448 switch (reg->id) { 448 switch (reg->id) {
449 case KVM_REG_S390_TODPR:
450 r = put_user(vcpu->arch.sie_block->todpr,
451 (u32 __user *)reg->addr);
452 break;
453 case KVM_REG_S390_EPOCHDIFF:
454 r = put_user(vcpu->arch.sie_block->epoch,
455 (u64 __user *)reg->addr);
456 break;
449 default: 457 default:
450 break; 458 break;
451 } 459 }
@@ -459,6 +467,14 @@ static int kvm_arch_vcpu_ioctl_set_one_reg(struct kvm_vcpu *vcpu,
459 int r = -EINVAL; 467 int r = -EINVAL;
460 468
461 switch (reg->id) { 469 switch (reg->id) {
470 case KVM_REG_S390_TODPR:
471 r = get_user(vcpu->arch.sie_block->todpr,
472 (u32 __user *)reg->addr);
473 break;
474 case KVM_REG_S390_EPOCHDIFF:
475 r = get_user(vcpu->arch.sie_block->epoch,
476 (u64 __user *)reg->addr);
477 break;
462 default: 478 default:
463 break; 479 break;
464 } 480 }