aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2015-07-07 09:19:32 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-07-29 05:02:32 -0400
commit175a5c9e79b0eb822c158a6535f44a8460b40664 (patch)
tree321dc31cd2ea217f6e567f6e08872366a93d0cac /arch/s390/kvm
parentc348915585af12a7fc6453524d9835830dba574b (diff)
KVM: s390: add kvm stat counter for all diagnoses
Sometimes kvm stat counters are the only performance metric to check after something went wrong. Let's add additional counters for some diagnoses. In addition do the count for diag 10 all the time, even if we inject a program interrupt. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Reviewed-by: Jens Freimann <jfrei@linux.vnet.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/diag.c5
-rw-r--r--arch/s390/kvm/kvm-s390.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/arch/s390/kvm/diag.c b/arch/s390/kvm/diag.c
index fc7ec95848c3..98066167a2c8 100644
--- a/arch/s390/kvm/diag.c
+++ b/arch/s390/kvm/diag.c
@@ -27,13 +27,13 @@ static int diag_release_pages(struct kvm_vcpu *vcpu)
27 27
28 start = vcpu->run->s.regs.gprs[(vcpu->arch.sie_block->ipa & 0xf0) >> 4]; 28 start = vcpu->run->s.regs.gprs[(vcpu->arch.sie_block->ipa & 0xf0) >> 4];
29 end = vcpu->run->s.regs.gprs[vcpu->arch.sie_block->ipa & 0xf] + 4096; 29 end = vcpu->run->s.regs.gprs[vcpu->arch.sie_block->ipa & 0xf] + 4096;
30 vcpu->stat.diagnose_10++;
30 31
31 if (start & ~PAGE_MASK || end & ~PAGE_MASK || start >= end 32 if (start & ~PAGE_MASK || end & ~PAGE_MASK || start >= end
32 || start < 2 * PAGE_SIZE) 33 || start < 2 * PAGE_SIZE)
33 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); 34 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
34 35
35 VCPU_EVENT(vcpu, 5, "diag release pages %lX %lX", start, end); 36 VCPU_EVENT(vcpu, 5, "diag release pages %lX %lX", start, end);
36 vcpu->stat.diagnose_10++;
37 37
38 /* 38 /*
39 * We checked for start >= end above, so lets check for the 39 * We checked for start >= end above, so lets check for the
@@ -75,6 +75,7 @@ static int __diag_page_ref_service(struct kvm_vcpu *vcpu)
75 u16 rx = (vcpu->arch.sie_block->ipa & 0xf0) >> 4; 75 u16 rx = (vcpu->arch.sie_block->ipa & 0xf0) >> 4;
76 u16 ry = (vcpu->arch.sie_block->ipa & 0x0f); 76 u16 ry = (vcpu->arch.sie_block->ipa & 0x0f);
77 77
78 vcpu->stat.diagnose_258++;
78 if (vcpu->run->s.regs.gprs[rx] & 7) 79 if (vcpu->run->s.regs.gprs[rx] & 7)
79 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); 80 return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
80 rc = read_guest(vcpu, vcpu->run->s.regs.gprs[rx], rx, &parm, sizeof(parm)); 81 rc = read_guest(vcpu, vcpu->run->s.regs.gprs[rx], rx, &parm, sizeof(parm));
@@ -175,6 +176,7 @@ static int __diag_ipl_functions(struct kvm_vcpu *vcpu)
175 unsigned long subcode = vcpu->run->s.regs.gprs[reg] & 0xffff; 176 unsigned long subcode = vcpu->run->s.regs.gprs[reg] & 0xffff;
176 177
177 VCPU_EVENT(vcpu, 5, "diag ipl functions, subcode %lx", subcode); 178 VCPU_EVENT(vcpu, 5, "diag ipl functions, subcode %lx", subcode);
179 vcpu->stat.diagnose_308++;
178 switch (subcode) { 180 switch (subcode) {
179 case 3: 181 case 3:
180 vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR; 182 vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR;
@@ -202,6 +204,7 @@ static int __diag_virtio_hypercall(struct kvm_vcpu *vcpu)
202{ 204{
203 int ret; 205 int ret;
204 206
207 vcpu->stat.diagnose_500++;
205 /* No virtio-ccw notification? Get out quickly. */ 208 /* No virtio-ccw notification? Get out quickly. */
206 if (!vcpu->kvm->arch.css_support || 209 if (!vcpu->kvm->arch.css_support ||
207 (vcpu->run->s.regs.gprs[1] != KVM_S390_VIRTIO_CCW_NOTIFY)) 210 (vcpu->run->s.regs.gprs[1] != KVM_S390_VIRTIO_CCW_NOTIFY))
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 3772947ac194..b623267d60cc 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -108,6 +108,9 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
108 { "diagnose_10", VCPU_STAT(diagnose_10) }, 108 { "diagnose_10", VCPU_STAT(diagnose_10) },
109 { "diagnose_44", VCPU_STAT(diagnose_44) }, 109 { "diagnose_44", VCPU_STAT(diagnose_44) },
110 { "diagnose_9c", VCPU_STAT(diagnose_9c) }, 110 { "diagnose_9c", VCPU_STAT(diagnose_9c) },
111 { "diagnose_258", VCPU_STAT(diagnose_258) },
112 { "diagnose_308", VCPU_STAT(diagnose_308) },
113 { "diagnose_500", VCPU_STAT(diagnose_500) },
111 { NULL } 114 { NULL }
112}; 115};
113 116