aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/kvm-s390.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2012-01-11 05:20:32 -0500
committerAvi Kivity <avi@redhat.com>2012-03-05 07:52:22 -0500
commit5a32c1af56b3c74212b1de2a1d1658c303dd3516 (patch)
tree4eb6f52e1bdc4b2427fdea83c88a0c188ad54b4f /arch/s390/kvm/kvm-s390.c
parent60b413c9248495ea400e80e08e4d1e28ed7ee05e (diff)
KVM: s390: provide general purpose guest registers via kvm_run
This patch adds the general purpose registers to the kvm_run structure. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/s390/kvm/kvm-s390.c')
-rw-r--r--arch/s390/kvm/kvm-s390.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 6962c1b9eec..80b12bac6a5 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -289,7 +289,7 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
289 } 289 }
290 290
291 vcpu->arch.gmap = vcpu->kvm->arch.gmap; 291 vcpu->arch.gmap = vcpu->kvm->arch.gmap;
292 vcpu->run->kvm_valid_regs = KVM_SYNC_PREFIX; 292 vcpu->run->kvm_valid_regs = KVM_SYNC_PREFIX | KVM_SYNC_GPRS;
293 return 0; 293 return 0;
294} 294}
295 295
@@ -428,13 +428,13 @@ static int kvm_arch_vcpu_ioctl_initial_reset(struct kvm_vcpu *vcpu)
428 428
429int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) 429int kvm_arch_vcpu_ioctl_set_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
430{ 430{
431 memcpy(&vcpu->arch.guest_gprs, &regs->gprs, sizeof(regs->gprs)); 431 memcpy(&vcpu->run->s.regs.gprs, &regs->gprs, sizeof(regs->gprs));
432 return 0; 432 return 0;
433} 433}
434 434
435int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs) 435int kvm_arch_vcpu_ioctl_get_regs(struct kvm_vcpu *vcpu, struct kvm_regs *regs)
436{ 436{
437 memcpy(&regs->gprs, &vcpu->arch.guest_gprs, sizeof(regs->gprs)); 437 memcpy(&regs->gprs, &vcpu->run->s.regs.gprs, sizeof(regs->gprs));
438 return 0; 438 return 0;
439} 439}
440 440
@@ -511,7 +511,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
511{ 511{
512 int rc; 512 int rc;
513 513
514 memcpy(&vcpu->arch.sie_block->gg14, &vcpu->arch.guest_gprs[14], 16); 514 memcpy(&vcpu->arch.sie_block->gg14, &vcpu->run->s.regs.gprs[14], 16);
515 515
516 if (need_resched()) 516 if (need_resched())
517 schedule(); 517 schedule();
@@ -528,7 +528,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
528 local_irq_enable(); 528 local_irq_enable();
529 VCPU_EVENT(vcpu, 6, "entering sie flags %x", 529 VCPU_EVENT(vcpu, 6, "entering sie flags %x",
530 atomic_read(&vcpu->arch.sie_block->cpuflags)); 530 atomic_read(&vcpu->arch.sie_block->cpuflags));
531 rc = sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs); 531 rc = sie64a(vcpu->arch.sie_block, vcpu->run->s.regs.gprs);
532 if (rc) { 532 if (rc) {
533 if (kvm_is_ucontrol(vcpu->kvm)) { 533 if (kvm_is_ucontrol(vcpu->kvm)) {
534 rc = SIE_INTERCEPT_UCONTROL; 534 rc = SIE_INTERCEPT_UCONTROL;
@@ -544,7 +544,7 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
544 kvm_guest_exit(); 544 kvm_guest_exit();
545 local_irq_enable(); 545 local_irq_enable();
546 546
547 memcpy(&vcpu->arch.guest_gprs[14], &vcpu->arch.sie_block->gg14, 16); 547 memcpy(&vcpu->run->s.regs.gprs[14], &vcpu->arch.sie_block->gg14, 16);
548 return rc; 548 return rc;
549} 549}
550 550
@@ -673,7 +673,7 @@ int kvm_s390_vcpu_store_status(struct kvm_vcpu *vcpu, unsigned long addr)
673 return -EFAULT; 673 return -EFAULT;
674 674
675 if (__guestcopy(vcpu, addr + offsetof(struct save_area, gp_regs), 675 if (__guestcopy(vcpu, addr + offsetof(struct save_area, gp_regs),
676 vcpu->arch.guest_gprs, 128, prefix)) 676 vcpu->run->s.regs.gprs, 128, prefix))
677 return -EFAULT; 677 return -EFAULT;
678 678
679 if (__guestcopy(vcpu, addr + offsetof(struct save_area, psw), 679 if (__guestcopy(vcpu, addr + offsetof(struct save_area, psw),