aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorCarsten Otte <cotte@de.ibm.com>2008-05-21 07:37:40 -0400
committerAvi Kivity <avi@qumranet.com>2008-06-06 14:08:26 -0400
commit1f0d0f094df9a570dfc26d5eb825986b7e165e1d (patch)
tree4f598069f3a17c926deb70bbbd3d088d881efbfc /arch/s390/kvm
parent0ff318674503ce3787ef62d84f4d948db204b268 (diff)
KVM: s390: Send program check on access error
If the guest accesses non-existing memory, the sie64a function returns -EFAULT. We must check the return value and send a program check to the guest if the sie instruction faulted, otherwise the guest will loop at the faulting code. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/kvm-s390.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index ded27c7777cc..6558b09ff579 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -443,7 +443,10 @@ static void __vcpu_run(struct kvm_vcpu *vcpu)
443 local_irq_enable(); 443 local_irq_enable();
444 VCPU_EVENT(vcpu, 6, "entering sie flags %x", 444 VCPU_EVENT(vcpu, 6, "entering sie flags %x",
445 atomic_read(&vcpu->arch.sie_block->cpuflags)); 445 atomic_read(&vcpu->arch.sie_block->cpuflags));
446 sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs); 446 if (sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs)) {
447 VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction");
448 kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
449 }
447 VCPU_EVENT(vcpu, 6, "exit sie icptcode %d", 450 VCPU_EVENT(vcpu, 6, "exit sie icptcode %d",
448 vcpu->arch.sie_block->icptcode); 451 vcpu->arch.sie_block->icptcode);
449 local_irq_disable(); 452 local_irq_disable();