summaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm
diff options
context:
space:
mode:
authorOliver Upton <oupton@google.com>2021-08-02 19:28:07 +0000
committerMarc Zyngier <maz@kernel.org>2021-08-19 11:19:41 +0100
commitfe5161d2c39b8c2801f0e786631460c6e8a1cae4 (patch)
treec119bf6993ab80db21ca5eb0172d1210ddd2f3d0 /arch/arm64/kvm
parentc500bee1c5b2f1d59b1081ac879d73268ab0ff17 (diff)
downloadlinux-stable-fe5161d2c39b8c2801f0e786631460c6e8a1cae4.tar.gz
linux-stable-fe5161d2c39b8c2801f0e786631460c6e8a1cae4.tar.bz2
linux-stable-fe5161d2c39b8c2801f0e786631460c6e8a1cae4.zip
KVM: arm64: Record number of signal exits as a vCPU stat
Most other architectures that implement KVM record a statistic indicating the number of times a vCPU has exited due to a pending signal. Add support for that stat to arm64. Reviewed-by: Jing Zhang <jingzhangos@google.com> Signed-off-by: Oliver Upton <oupton@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20210802192809.1851010-2-oupton@google.com
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r--arch/arm64/kvm/arm.c1
-rw-r--r--arch/arm64/kvm/guest.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
index e9a2b8f27792..60d0a546d7fd 100644
--- a/arch/arm64/kvm/arm.c
+++ b/arch/arm64/kvm/arm.c
@@ -783,6 +783,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
if (signal_pending(current)) {
ret = -EINTR;
run->exit_reason = KVM_EXIT_INTR;
+ ++vcpu->stat.signal_exits;
}
/*
diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c
index 1dfb83578277..853d1e8d2e73 100644
--- a/arch/arm64/kvm/guest.c
+++ b/arch/arm64/kvm/guest.c
@@ -50,6 +50,7 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
STATS_DESC_COUNTER(VCPU, wfi_exit_stat),
STATS_DESC_COUNTER(VCPU, mmio_exit_user),
STATS_DESC_COUNTER(VCPU, mmio_exit_kernel),
+ STATS_DESC_COUNTER(VCPU, signal_exits),
STATS_DESC_COUNTER(VCPU, exits)
};
static_assert(ARRAY_SIZE(kvm_vcpu_stats_desc) ==