summaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorCarsten Otte <cotte@de.ibm.com>2008-05-21 13:37:40 +0200
committerAvi Kivity <avi@qumranet.com>2008-06-06 21:08:26 +0300
commit1f0d0f094df9a570dfc26d5eb825986b7e165e1d (patch)
tree4f598069f3a17c926deb70bbbd3d088d881efbfc /arch/s390
parent0ff318674503ce3787ef62d84f4d948db204b268 (diff)
downloadlinux-stable-1f0d0f094df9a570dfc26d5eb825986b7e165e1d.tar.gz
linux-stable-1f0d0f094df9a570dfc26d5eb825986b7e165e1d.tar.bz2
linux-stable-1f0d0f094df9a570dfc26d5eb825986b7e165e1d.zip
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')
-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)
local_irq_enable();
VCPU_EVENT(vcpu, 6, "entering sie flags %x",
atomic_read(&vcpu->arch.sie_block->cpuflags));
- sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs);
+ if (sie64a(vcpu->arch.sie_block, vcpu->arch.guest_gprs)) {
+ VCPU_EVENT(vcpu, 3, "%s", "fault in sie instruction");
+ kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
+ }
VCPU_EVENT(vcpu, 6, "exit sie icptcode %d",
vcpu->arch.sie_block->icptcode);
local_irq_disable();