]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: Explicitly set new periodic hrtimer expiration in apic_timer_fn()
authorfuqiang wang <fuqiang.wng@gmail.com>
Thu, 13 Nov 2025 20:51:12 +0000 (12:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jan 2026 12:11:51 +0000 (13:11 +0100)
commitdcf4bb8599a503074670fff1c767ae7786960664
treef385d222cb1d4d978eeafac12eb1aa64429d32ec
parente35aaf3e8f921134659a4b94ce6e3fa1c4f3510d
KVM: x86: Explicitly set new periodic hrtimer expiration in apic_timer_fn()

commit 9633f180ce994ab293ce4924a9b7aaf4673aa114 upstream.

When restarting an hrtimer to emulate a the guest's APIC timer in periodic
mode, explicitly set the expiration using the target expiration computed
by advance_periodic_target_expiration() instead of adding the period to
the existing timer.  This will allow making adjustments to the expiration,
e.g. to deal with expirations far in the past, without having to implement
the same logic in both advance_periodic_target_expiration() and
apic_timer_fn().

Cc: stable@vger.kernel.org
Signed-off-by: fuqiang wang <fuqiang.wng@gmail.com>
[sean: split to separate patch, write changelog]
Link: https://patch.msgid.link/20251113205114.1647493-3-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/lapic.c