[Devel] [PATCH hci-8.1 v2] KVM: nVMX: Keep the emulated VMX-preemption timer on L1's TSC

no-reply at sashiko.virtuozzo.com no-reply at sashiko.virtuozzo.com
Fri Nov 6 18:22:28 MSK 2026


> KVM emulates L2's VMX-preemption timer with an hrtimer, but the hrtimer
> runs on CLOCK_MONOTONIC, which NTP slews against the TSC. The VM-exit
> then comes late or early in L1's TSC, and vmx_preemption_timer_test
> fails.
> 
> Arm the hrtimer an eighth early while more than 100us are left, and re-arm
> it from its callback until L1's TSC reaches the deadline kept since
> commit 850448f35aaf ("KVM: nVMX: Fix VMX preemption timer migration").
> Count the timer value left from that deadline too, and wait for a
> running callback when moving the timer to another CPU.
> 
> Fixes: f4124500c2c1 ("KVM: nVMX: Fully emulate preemption timer")
> https://virtuozzo.atlassian.net/browse/VSTOR-152991
> Feature: fix ms/kvm
> 
> Signed-off-by: Eva Kurchatova <eva.kurchatova at virtuozzo.com>

Sashiko has reviewed this patch and found no issues. It looks great!

-- 
Sashiko AI review · https://sashiko.vzint.dev/#/patchset/20261106151535.138563-1-eva.kurchatova@virtuozzo.com?part=1




More information about the Devel mailing list