public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Janosch Frank <frankja@linux.ibm.com>
To: pbonzini@redhat.com
Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com,
	borntraeger@linux.ibm.com, cohuck@redhat.com,
	linux-s390@vger.kernel.org, imbrenda@linux.ibm.com,
	hca@linux.ibm.com, Andrew Donnellan <ajd@linux.ibm.com>
Subject: [GIT PULL 08/10] KVM: s390: Add signal_exits counter
Date: Mon,  1 Dec 2025 13:33:50 +0100	[thread overview]
Message-ID: <20251201124334.110483-9-frankja@linux.ibm.com> (raw)
In-Reply-To: <20251201124334.110483-1-frankja@linux.ibm.com>

From: Andrew Donnellan <ajd@linux.ibm.com>

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 | 1 +
 arch/s390/kvm/kvm-s390.c         | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index 1e4829c70216..ae1223264d3c 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -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
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 56d4730b7c41..8db37e508a71 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -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;
 	}
 
-- 
2.52.0


  parent reply	other threads:[~2025-12-01 12:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-01 12:33 [GIT PULL 00/10] KVM: s390: Changes for v6.19 Janosch Frank
2025-12-01 12:33 ` [GIT PULL 01/10] KVM: s390: Use ESCA instead of BSCA at VM init Janosch Frank
2025-12-01 12:33 ` [GIT PULL 02/10] KVM: S390: Remove sca_lock Janosch Frank
2025-12-01 12:33 ` [GIT PULL 03/10] KVM: s390: Remove unused return variable in kvm_arch_vcpu_ioctl_set_fpu Janosch Frank
2025-12-01 12:33 ` [GIT PULL 04/10] KVM: s390: Replace sprintf with snprintf for buffer safety Janosch Frank
2025-12-01 12:33 ` [GIT PULL 05/10] Documentation: kvm: Fix ordering Janosch Frank
2025-12-01 12:33 ` [GIT PULL 06/10] KVM: s390: Add capability that forwards operation exceptions Janosch Frank
2025-12-01 12:33 ` [GIT PULL 07/10] KVM: s390: vsie: Check alignment of BSCA header Janosch Frank
2025-12-01 12:33 ` Janosch Frank [this message]
2025-12-01 12:33 ` [GIT PULL 09/10] KVM: s390: Enable and disable interrupts in entry code Janosch Frank
2025-12-01 12:33 ` [GIT PULL 10/10] KVM: s390: Use generic VIRT_XFER_TO_GUEST_WORK functions Janosch Frank
2025-12-02 17:39 ` [GIT PULL 00/10] KVM: s390: Changes for v6.19 Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251201124334.110483-9-frankja@linux.ibm.com \
    --to=frankja@linux.ibm.com \
    --cc=ajd@linux.ibm.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=hca@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox