diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-02-09 11:15:41 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2017-03-16 08:04:37 -0400 |
commit | 4d5f2c04c8a462a1c7ad3fdc138515c84fa65379 (patch) | |
tree | fe729f9b00a8d6e705a3c79775d33b7a9d9bfb63 | |
parent | 4495c08e84729385774601b5146d51d9e5849f81 (diff) |
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>
-rw-r--r-- | arch/s390/kvm/kvm-s390.c | 14 | ||||
-rw-r--r-- | arch/s390/kvm/priv.c | 1 |
2 files changed, 9 insertions, 6 deletions
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index fd6cd05bb6a7..5fda4686e817 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -2719,6 +2719,9 @@ static int __vcpu_run(struct kvm_vcpu *vcpu) | |||
2719 | 2719 | ||
2720 | static void sync_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | 2720 | static void sync_regs(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) |
2721 | { | 2721 | { |
2722 | struct runtime_instr_cb *riccb; | ||
2723 | |||
2724 | riccb = (struct runtime_instr_cb *) &kvm_run->s.regs.riccb; | ||
2722 | vcpu->arch.sie_block->gpsw.mask = kvm_run->psw_mask; | 2725 | vcpu->arch.sie_block->gpsw.mask = kvm_run->psw_mask; |
2723 | vcpu->arch.sie_block->gpsw.addr = kvm_run->psw_addr; | 2726 | vcpu->arch.sie_block->gpsw.addr = kvm_run->psw_addr; |
2724 | if (kvm_run->kvm_dirty_regs & KVM_SYNC_PREFIX) | 2727 | 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) | |||
2747 | * we should enable RI here instead of doing the lazy enablement. | 2750 | * we should enable RI here instead of doing the lazy enablement. |
2748 | */ | 2751 | */ |
2749 | if ((kvm_run->kvm_dirty_regs & KVM_SYNC_RICCB) && | 2752 | if ((kvm_run->kvm_dirty_regs & KVM_SYNC_RICCB) && |
2750 | test_kvm_facility(vcpu->kvm, 64)) { | 2753 | test_kvm_facility(vcpu->kvm, 64) && |
2751 | struct runtime_instr_cb *riccb = | 2754 | riccb->valid && |
2752 | (struct runtime_instr_cb *) &kvm_run->s.regs.riccb; | 2755 | !(vcpu->arch.sie_block->ecb3 & 0x01)) { |
2753 | 2756 | VCPU_EVENT(vcpu, 3, "%s", "ENABLE: RI (sync_regs)"); | |
2754 | if (riccb->valid) | 2757 | vcpu->arch.sie_block->ecb3 |= 0x01; |
2755 | vcpu->arch.sie_block->ecb3 |= 0x01; | ||
2756 | } | 2758 | } |
2757 | save_access_regs(vcpu->arch.host_acrs); | 2759 | save_access_regs(vcpu->arch.host_acrs); |
2758 | restore_access_regs(vcpu->run->s.regs.acrs); | 2760 | restore_access_regs(vcpu->run->s.regs.acrs); |
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 64b6a309f2c4..93d6cde8c3ea 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -37,6 +37,7 @@ | |||
37 | static int handle_ri(struct kvm_vcpu *vcpu) | 37 | static int handle_ri(struct kvm_vcpu *vcpu) |
38 | { | 38 | { |
39 | if (test_kvm_facility(vcpu->kvm, 64)) { | 39 | if (test_kvm_facility(vcpu->kvm, 64)) { |
40 | VCPU_EVENT(vcpu, 3, "%s", "ENABLE: RI (lazy)"); | ||
40 | vcpu->arch.sie_block->ecb3 |= 0x01; | 41 | vcpu->arch.sie_block->ecb3 |= 0x01; |
41 | kvm_s390_retry_instr(vcpu); | 42 | kvm_s390_retry_instr(vcpu); |
42 | return 0; | 43 | return 0; |