]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
KVM: x86: WARN if hrtimer callback for periodic APIC timer fires with period=0
authorSean Christopherson <seanjc@google.com>
Thu, 13 Nov 2025 20:51:11 +0000 (12:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Jan 2026 11:57:20 +0000 (12:57 +0100)
commit16fa73b11a9472444f855b386e478d6ebfb2348a
treecd5612edabf9d831961554db2e2863fd8ee21d2d
parentb3b320a900a54c48ff134131dfff962f48e7264f
KVM: x86: WARN if hrtimer callback for periodic APIC timer fires with period=0

commit 0ea9494be9c931ddbc084ad5e11fda91b554cf47 upstream.

WARN and don't restart the hrtimer if KVM's callback runs with the guest's
APIC timer in periodic mode but with a period of '0', as not advancing the
hrtimer's deadline would put the CPU into an infinite loop of hrtimer
events.  Observing a period of '0' should be impossible, even when the
hrtimer is running on a different CPU than the vCPU, as KVM is supposed to
cancel the hrtimer before changing (or zeroing) the period, e.g. when
switching from periodic to one-shot.

Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20251113205114.1647493-2-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