aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/intercept.c
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-05-24 06:10:27 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-07-05 06:02:56 -0400
commit5ffe466cd3a33543306c37a0789e2116286367f1 (patch)
tree57a5f6ae2a1d787d8d8bad3bfa3304915f8aacd6 /arch/s390/kvm/intercept.c
parent196f20ca52e8c7281932663c348fa54b82d03914 (diff)
KVM: s390: inject PER i-fetch events on applicable icpts
In case we have to emuluate an instruction or part of it (instruction, partial instruction, operation exception), we have to inject a PER instruction-fetching event for that instruction, if hardware told us to do so. In case we retry an instruction, we must not inject the PER event. Please note that we don't filter the events properly yet, so guest debugging will be visible for the guest. Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/intercept.c')
-rw-r--r--arch/s390/kvm/intercept.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index 9359f65c8634..850be47c4cc9 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -364,6 +364,8 @@ static int handle_operexc(struct kvm_vcpu *vcpu)
364 364
365int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu) 365int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu)
366{ 366{
367 int rc, per_rc = 0;
368
367 if (kvm_is_ucontrol(vcpu->kvm)) 369 if (kvm_is_ucontrol(vcpu->kvm))
368 return -EOPNOTSUPP; 370 return -EOPNOTSUPP;
369 371
@@ -372,7 +374,8 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu)
372 case 0x18: 374 case 0x18:
373 return handle_noop(vcpu); 375 return handle_noop(vcpu);
374 case 0x04: 376 case 0x04:
375 return handle_instruction(vcpu); 377 rc = handle_instruction(vcpu);
378 break;
376 case 0x08: 379 case 0x08:
377 return handle_prog(vcpu); 380 return handle_prog(vcpu);
378 case 0x14: 381 case 0x14:
@@ -384,10 +387,18 @@ int kvm_handle_sie_intercept(struct kvm_vcpu *vcpu)
384 case 0x28: 387 case 0x28:
385 return handle_stop(vcpu); 388 return handle_stop(vcpu);
386 case 0x2c: 389 case 0x2c:
387 return handle_operexc(vcpu); 390 rc = handle_operexc(vcpu);
391 break;
388 case 0x38: 392 case 0x38:
389 return handle_partial_execution(vcpu); 393 rc = handle_partial_execution(vcpu);
394 break;
390 default: 395 default:
391 return -EOPNOTSUPP; 396 return -EOPNOTSUPP;
392 } 397 }
398
399 /* process PER, also if the instrution is processed in user space */
400 if (vcpu->arch.sie_block->icptstatus & 0x02 &&
401 (!rc || rc == -EOPNOTSUPP))
402 per_rc = kvm_s390_handle_per_ifetch_icpt(vcpu);
403 return per_rc ? per_rc : rc;
393} 404}