]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: s390: Add signal_exits counter
authorAndrew Donnellan <ajd@linux.ibm.com>
Wed, 26 Nov 2025 05:33:10 +0000 (16:33 +1100)
committerJanosch Frank <frankja@linux.ibm.com>
Thu, 27 Nov 2025 14:39:46 +0000 (15:39 +0100)
Add a signal_exits counter for s390, as exists on arm64, loongarch, mips,
powerpc, riscv and x86.

This is used by kvm_handle_signal_exit(), which we will use when we
later enable CONFIG_VIRT_XFER_TO_GUEST_WORK.

Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
arch/s390/include/asm/kvm_host.h
arch/s390/kvm/kvm-s390.c

index 1e4829c70216c8a7f2ef97f854254e647f76d455..ae1223264d3cd34f2f1777d2bec739e2bbf6a6bf 100644 (file)
@@ -146,6 +146,7 @@ struct kvm_vcpu_stat {
        u64 instruction_diagnose_500;
        u64 instruction_diagnose_other;
        u64 pfault_sync;
+       u64 signal_exits;
 };
 
 #define PGM_OPERATION                  0x01
index 56d4730b7c41e2f87a572b36241bdabd2715fc18..8db37e508a71f31b5e822d7762b9d5422934f90d 100644 (file)
@@ -185,7 +185,8 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
        STATS_DESC_COUNTER(VCPU, instruction_diagnose_308),
        STATS_DESC_COUNTER(VCPU, instruction_diagnose_500),
        STATS_DESC_COUNTER(VCPU, instruction_diagnose_other),
-       STATS_DESC_COUNTER(VCPU, pfault_sync)
+       STATS_DESC_COUNTER(VCPU, pfault_sync),
+       STATS_DESC_COUNTER(VCPU, signal_exits)
 };
 
 const struct kvm_stats_header kvm_vcpu_stats_header = {
@@ -5251,6 +5252,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
 
        if (signal_pending(current) && !rc) {
                kvm_run->exit_reason = KVM_EXIT_INTR;
+               vcpu->stat.signal_exits++;
                rc = -EINTR;
        }