diff options
Diffstat (limited to 'arch/s390/kvm/intercept.c')
-rw-r--r-- | arch/s390/kvm/intercept.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c index 9d19803111ba..98997ccba501 100644 --- a/arch/s390/kvm/intercept.c +++ b/arch/s390/kvm/intercept.c | |||
@@ -154,17 +154,25 @@ static int handle_stop(struct kvm_vcpu *vcpu) | |||
154 | static int handle_validity(struct kvm_vcpu *vcpu) | 154 | static int handle_validity(struct kvm_vcpu *vcpu) |
155 | { | 155 | { |
156 | int viwhy = vcpu->arch.sie_block->ipb >> 16; | 156 | int viwhy = vcpu->arch.sie_block->ipb >> 16; |
157 | int rc; | ||
158 | |||
157 | vcpu->stat.exit_validity++; | 159 | vcpu->stat.exit_validity++; |
158 | if (viwhy == 0x37) { | 160 | if ((viwhy == 0x37) && (vcpu->arch.sie_block->prefix |
159 | fault_in_pages_writeable((char __user *) | 161 | <= vcpu->kvm->arch.guest_memsize - 2*PAGE_SIZE)){ |
160 | vcpu->kvm->arch.guest_origin + | 162 | rc = fault_in_pages_writeable((char __user *) |
161 | vcpu->arch.sie_block->prefix, | 163 | vcpu->kvm->arch.guest_origin + |
162 | PAGE_SIZE); | 164 | vcpu->arch.sie_block->prefix, |
163 | return 0; | 165 | 2*PAGE_SIZE); |
164 | } | 166 | if (rc) |
165 | VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d", | 167 | /* user will receive sigsegv, exit to user */ |
166 | viwhy); | 168 | rc = -ENOTSUPP; |
167 | return -ENOTSUPP; | 169 | } else |
170 | rc = -ENOTSUPP; | ||
171 | |||
172 | if (rc) | ||
173 | VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d", | ||
174 | viwhy); | ||
175 | return rc; | ||
168 | } | 176 | } |
169 | 177 | ||
170 | static int handle_instruction(struct kvm_vcpu *vcpu) | 178 | static int handle_instruction(struct kvm_vcpu *vcpu) |