diff options
Diffstat (limited to 'arch/s390/kvm/priv.c')
-rw-r--r-- | arch/s390/kvm/priv.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 3605df45dd41..4b88834b8dd8 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -304,12 +304,24 @@ static intercept_handler_t priv_handlers[256] = { | |||
304 | [0xb1] = handle_stfl, | 304 | [0xb1] = handle_stfl, |
305 | }; | 305 | }; |
306 | 306 | ||
307 | int kvm_s390_handle_priv(struct kvm_vcpu *vcpu) | 307 | int kvm_s390_handle_b2(struct kvm_vcpu *vcpu) |
308 | { | 308 | { |
309 | intercept_handler_t handler; | 309 | intercept_handler_t handler; |
310 | 310 | ||
311 | /* | ||
312 | * a lot of B2 instructions are priviledged. We first check for | ||
313 | * the priviledges ones, that we can handle in the kernel. If the | ||
314 | * kernel can handle this instruction, we check for the problem | ||
315 | * state bit and (a) handle the instruction or (b) send a code 2 | ||
316 | * program check. | ||
317 | * Anything else goes to userspace.*/ | ||
311 | handler = priv_handlers[vcpu->arch.sie_block->ipa & 0x00ff]; | 318 | handler = priv_handlers[vcpu->arch.sie_block->ipa & 0x00ff]; |
312 | if (handler) | 319 | if (handler) { |
313 | return handler(vcpu); | 320 | if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) |
321 | return kvm_s390_inject_program_int(vcpu, | ||
322 | PGM_PRIVILEGED_OPERATION); | ||
323 | else | ||
324 | return handler(vcpu); | ||
325 | } | ||
314 | return -ENOTSUPP; | 326 | return -ENOTSUPP; |
315 | } | 327 | } |