]> asedeno.scripts.mit.edu Git - linux.git/commit
KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support
authorWanpeng Li <wanpeng.li@hotmail.com>
Mon, 24 Oct 2016 10:23:13 +0000 (18:23 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 2 Nov 2016 20:32:17 +0000 (21:32 +0100)
commit8003c9ae204e21204e49816c5ea629357e283b06
tree4972d819077e3a2e7d172ed4c799d76a5275e4f2
parent7e810a38e6c7166b91968e83dee4cf7a4ef5dc80
KVM: LAPIC: add APIC Timer periodic/oneshot mode VMX preemption timer support

Most windows guests still utilize APIC Timer periodic/oneshot mode
instead of tsc-deadline mode, and the APIC Timer periodic/oneshot
mode are still emulated by high overhead hrtimer on host. This patch
converts the expected expire time of the periodic/oneshot mode to
guest deadline tsc in order to leverage VMX preemption timer logic
for APIC Timer tsc-deadline mode. After each preemption timer vmexit
preemption timer is restarted to emulate LVTT current-count register
is automatically reloaded from the initial-count register when the
count reaches 0. This patch reduces ~5600 cycles for each APIC Timer
periodic mode operation virtualization.

Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Wanpeng Li <wanpeng.li@hotmail.com>
[Squashed with my fixes that were reviewed-by Paolo.]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/lapic.c
arch/x86/kvm/lapic.h