Skip to contentSkip to conversation

KVM: add machine check counter kvm_stat

PATCH David Hildenbrand 1 participant 1 message Mar 5, 2018 1 message not in the archive s390

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

David Hildenbrand

author Reviewed-by
#1 lore raw
Quoted 44 lines · Christian Borntraeger

From: QingFeng Hao <[email protected]>

This counter can be used for administration, debug or test purpose.

---
 arch/s390/include/asm/kvm_host.h | 1 +
 arch/s390/kvm/interrupt.c        | 1 +
 arch/s390/kvm/kvm-s390.c         | 1 +
 3 files changed, 3 insertions(+)
arch/s390/include/asm/kvm_host.h +1 -0
index 22615af0b6e6..77a49de9c511 100644
@@ -320,6 +320,7 @@ struct kvm_vcpu_stat {
 	u64 deliver_restart_signal;
 	u64 deliver_program_int;
 	u64 deliver_io_int;
+	u64 deliver_machine_check;
 	u64 exit_wait_state;
 	u64 instruction_epsw;
 	u64 instruction_gs;
arch/s390/kvm/interrupt.c +1 -0
index b04616b57a94..bde04a6191ca 100644
@@ -595,6 +595,7 @@ static int __must_check __deliver_machine_check(struct kvm_vcpu *vcpu)
 		trace_kvm_s390_deliver_interrupt(vcpu->vcpu_id,
 						 KVM_S390_MCHK,
 						 mchk.cr14, mchk.mcic);
+		vcpu->stat.deliver_machine_check++;
 		rc = __write_machine_check(vcpu, &mchk);
 	}
 	return rc;
arch/s390/kvm/kvm-s390.c +0 -0
index 6ee1d13a72f9..432277ad2114 100644

arch/s390/kvm/kvm-s390.c struct kvm_stats_debugfs_item debugfs_entries[] = { · line 94

Quoted 7 lines
arch/s390/kvm/kvm-s390.c +1 -0
@@ -88,6 +88,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
 	{ "deliver_restart_signal", VCPU_STAT(deliver_restart_signal) },
 	{ "deliver_program_interruption", VCPU_STAT(deliver_program_int) },
 	{ "deliver_io_interrupt", VCPU_STAT(deliver_io_int) },
+	{ "deliver_machine_check", VCPU_STAT(deliver_machine_check) },
 	{ "exit_wait_state", VCPU_STAT(exit_wait_state) },
 	{ "instruction_epsw", VCPU_STAT(instruction_epsw) },
 	{ "instruction_gs", VCPU_STAT(instruction_gs) },
Signature · 3 lines
Thanks,

David / dhildenb