提交 3beedef8 编写于 作者: C chenjiajun 提交者: Zheng Zengkai

kvm: debugfs: add EXIT_REASON_PREEMPTION_TIMER to vcpu_stat

virt inclusion
category: feature
bugzilla: 46853
CVE: NA

Export EXIT_REASON_PREEMPTION_TIMER kvm exits to vcpu_stat debugfs.
Add a new column to vcpu_stat, and provide preemption_timer status to
virtualization detection tools.
Signed-off-by: Nchenjiajun <chenjiajun8@huawei.com>
Reviewed-by: NXiangyou Xie <xiexiangyou@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 aa35c00a
......@@ -1070,6 +1070,7 @@ struct kvm_vcpu_stat {
u64 utime;
u64 stime;
u64 gtime;
u64 preemption_timer_exits;
};
struct x86_instruction_info;
......
......@@ -5605,6 +5605,7 @@ static fastpath_t handle_fastpath_preemption_timer(struct kvm_vcpu *vcpu)
static int handle_preemption_timer(struct kvm_vcpu *vcpu)
{
++vcpu->stat.preemption_timer_exits;
handle_fastpath_preemption_timer(vcpu);
return 1;
}
......@@ -6598,6 +6599,7 @@ static fastpath_t vmx_exit_handlers_fastpath(struct kvm_vcpu *vcpu)
++vcpu->stat.msr_wr_exits;
return handle_fastpath_set_msr_irqoff(vcpu);
case EXIT_REASON_PREEMPTION_TIMER:
++vcpu->stat.preemption_timer_exits;
return handle_fastpath_preemption_timer(vcpu);
default:
return EXIT_FASTPATH_NONE;
......
......@@ -285,6 +285,7 @@ struct dfx_kvm_stats_debugfs_item dfx_debugfs_entries[] = {
DFX_STAT("utime", utime),
DFX_STAT("stime", stime),
DFX_STAT("gtime", gtime),
DFX_STAT("preemption_timer_exits", preemption_timer_exits),
{ NULL }
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册