KVM: s390: log runtime instrumentation enablement

We handle runtime instrumentation enablement either lazy or via
sync_regs on migration. Make sure to add a debug log entry for that
per CPU on the first occurrence.

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
This commit is contained in:
Christian Borntraeger 2017-02-09 17:15:41 +01:00
parent 4495c08e84
commit 4d5f2c04c8
2 changed files with 9 additions and 6 deletions

View file

@ -2719,6 +2719,9 @@ static int __vcpu_run(struct kvm_vcpu *vcpu)
static void sync_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) static void sync_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
{ {
struct runtime_instr_cb *riccb;
riccb = (struct runtime_instr_cb *) &kvm_run->s.regs.riccb;
vcpu->arch.sie_block->gpsw.mask = kvm_run->psw_mask; vcpu->arch.sie_block->gpsw.mask = kvm_run->psw_mask;
vcpu->arch.sie_block->gpsw.addr = kvm_run->psw_addr; vcpu->arch.sie_block->gpsw.addr = kvm_run->psw_addr;
if (kvm_run->kvm_dirty_regs & KVM_SYNC_PREFIX) if (kvm_run->kvm_dirty_regs & KVM_SYNC_PREFIX)
@ -2747,12 +2750,11 @@ static void sync_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
* we should enable RI here instead of doing the lazy enablement. * we should enable RI here instead of doing the lazy enablement.
*/ */
if ((kvm_run->kvm_dirty_regs & KVM_SYNC_RICCB) && if ((kvm_run->kvm_dirty_regs & KVM_SYNC_RICCB) &&
test_kvm_facility(vcpu->kvm, 64)) { test_kvm_facility(vcpu->kvm, 64) &&
struct runtime_instr_cb *riccb = riccb->valid &&
(struct runtime_instr_cb *) &kvm_run->s.regs.riccb; !(vcpu->arch.sie_block->ecb3 & 0x01)) {
VCPU_EVENT(vcpu, 3, "%s", "ENABLE: RI (sync_regs)");
if (riccb->valid) vcpu->arch.sie_block->ecb3 |= 0x01;
vcpu->arch.sie_block->ecb3 |= 0x01;
} }
save_access_regs(vcpu->arch.host_acrs); save_access_regs(vcpu->arch.host_acrs);
restore_access_regs(vcpu->run->s.regs.acrs); restore_access_regs(vcpu->run->s.regs.acrs);

View file

@ -37,6 +37,7 @@
static int handle_ri(struct kvm_vcpu *vcpu) static int handle_ri(struct kvm_vcpu *vcpu)
{ {
if (test_kvm_facility(vcpu->kvm, 64)) { if (test_kvm_facility(vcpu->kvm, 64)) {
VCPU_EVENT(vcpu, 3, "%s", "ENABLE: RI (lazy)");
vcpu->arch.sie_block->ecb3 |= 0x01; vcpu->arch.sie_block->ecb3 |= 0x01;
kvm_s390_retry_instr(vcpu); kvm_s390_retry_instr(vcpu);
return 0; return 0;