Skip to content

Commit fe5161d

Browse files
ouptonMarc Zyngier
authored andcommitted
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 <[email protected]> Signed-off-by: Oliver Upton <[email protected]> Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c500bee commit fe5161d

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

arch/arm64/include/asm/kvm_host.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ struct kvm_vcpu_stat {
576576
u64 wfi_exit_stat;
577577
u64 mmio_exit_user;
578578
u64 mmio_exit_kernel;
579+
u64 signal_exits;
579580
u64 exits;
580581
};
581582

arch/arm64/kvm/arm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
783783
if (signal_pending(current)) {
784784
ret = -EINTR;
785785
run->exit_reason = KVM_EXIT_INTR;
786+
++vcpu->stat.signal_exits;
786787
}
787788

788789
/*

arch/arm64/kvm/guest.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ const struct _kvm_stats_desc kvm_vcpu_stats_desc[] = {
5050
STATS_DESC_COUNTER(VCPU, wfi_exit_stat),
5151
STATS_DESC_COUNTER(VCPU, mmio_exit_user),
5252
STATS_DESC_COUNTER(VCPU, mmio_exit_kernel),
53+
STATS_DESC_COUNTER(VCPU, signal_exits),
5354
STATS_DESC_COUNTER(VCPU, exits)
5455
};
5556
static_assert(ARRAY_SIZE(kvm_vcpu_stats_desc) ==

0 commit comments

Comments
 (0)