lkml.org 
[lkml]   [2017]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v2] KVM: LAPIC: Fix lapic timer injection delay
From
Date


On 23/06/2017 13:59, Wanpeng Li wrote:
> From: Wanpeng Li <wanpeng.li@hotmail.com>
>
> Linux as a guest will prevent to program the next event to the clock event
> device when the event is in the past. However, it is not guaranteed by all
> the guests, the guest like kvm-unit-tests/apic.flat will write current tsc
> value visible in guest to MSR_IA32_TSCDEADLINE, lapic timer which is emulated
> by vmx preemption timer will program the absolute target tsc value to vmcs
> preemption timer field w/ delta == 0, then plays a vmentry and an upcoming
> vmx preemption timer fire vmexit dance, the lapic timer injection is delayed
> for this duration. Actually the lapic timer which is emulated by hrtimer can
> handle this correctly.
>
> This patch fixes it by firing the lapic timer and injecting a timer interrupt
> immediately during the next vmentry if guest programs an expired timer to
> the emulated timer device. This saves ~300 cycles on the tsc_deadline_timer
> test of apic.flat.

If it doesn't matter for actual guests, I'd rather not complicate the logic.

Paolo

\
 
 \ /
  Last update: 2017-06-27 18:10    [W:0.052 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site