提交 1e3dcf80 编写于 作者: O Oliver Upton 提交者: Zheng Zengkai

KVM: arm64: Record number of signal exits as a vCPU stat

mainline inclusion
from mainline-v5.14
commit fe5161d2
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I4VZJT
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=fe5161d2c39b8c2801f0e786631460c6e8a1cae4

--------------------------------

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: NJing Zhang <jingzhangos@google.com>
Signed-off-by: NOliver Upton <oupton@google.com>
Signed-off-by: NMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210802192809.1851010-2-oupton@google.comSigned-off-by: NZhang Qiao <zhangqiao22@huawei.com>
Reviewed-by: NKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 8419118f
......@@ -483,6 +483,7 @@ struct kvm_vcpu_stat {
u64 wfi_exit_stat;
u64 mmio_exit_user;
u64 mmio_exit_kernel;
u64 signal_exits;
u64 exits;
u64 fp_asimd_exit_stat;
u64 irq_exit_stat;
......
......@@ -794,6 +794,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;
}
/*
......
......@@ -39,6 +39,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = {
VCPU_STAT("wfi_exit_stat", wfi_exit_stat),
VCPU_STAT("mmio_exit_user", mmio_exit_user),
VCPU_STAT("mmio_exit_kernel", mmio_exit_kernel),
VCPU_STAT("signal_exits", signal_exits),
VCPU_STAT("exits", exits),
VCPU_STAT("halt_poll_success_ns", halt_poll_success_ns),
VCPU_STAT("halt_poll_fail_ns", halt_poll_fail_ns),
......@@ -54,6 +55,7 @@ struct dfx_kvm_stats_debugfs_item dfx_debugfs_entries[] = {
DFX_STAT("wfi_exit_stat", wfi_exit_stat),
DFX_STAT("mmio_exit_user", mmio_exit_user),
DFX_STAT("mmio_exit_kernel", mmio_exit_kernel),
DFX_STAT("signal_exits", signal_exits),
DFX_STAT("exits", exits),
DFX_STAT("fp_asimd_exit_stat", fp_asimd_exit_stat),
DFX_STAT("irq_exit_stat", irq_exit_stat),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册