Re: [PATCH v2 00/36] KVM: VMX APIC timer virtualization support
From: Jim Mattson
Date: Wed Jul 29 2026 - 13:49:07 EST
On Wed, Jul 29, 2026 at 3:00 AM Chao Gao <chao.gao@xxxxxxxxx> wrote:
>
> On Tue, Jul 28, 2026 at 11:05:59PM -0700, Jim Mattson wrote:
> >On Tue, Jul 28, 2026 at 6:35 PM Chao Gao <chao.gao@xxxxxxxxx> wrote:
> >>
> >> Hi Sean, Jim,
> >>
> >> Any thoughts on the approach of reusing hv_timer for APIC timer
> >> virtualization?
> >
> >Last I heard, APIC timer virtualization was only available on E-cores,
> >with no P-core intercept on the roadmap.
>
> It will be available on Coral Rapids as well, so it is relevant for
> server.
That's welcome news!
I'm not a fan of the hv_timer approach. One major difference between
the VMX preemption timer and the virtual TSC deadline MSR is that the
VMX preemption timer has to be reprogrammed every time that KVM
switches from hrtimer to hv_timer. The virtual TSC deadline timer
never needs reprogramming during normal operation. Another difference
is that KVM should never inject a virtual local APIC timer interrupt
when the virtual TSC deadline timer is in use. Even if the vCPU was
blocked and the hrtimer fired to wake it up, KVM should just let the
hardware deliver the virtual interrupt on the next VM-entry.
I'd rather see TSC deadline timer virtualization implemented as a
standalone APIC virtualization feature.