[PATCH 0/3] LoongArch: KVM: Small enhancement about timer

From: Bibo Mao

Date: Tue Apr 14 2026 - 03:29:38 EST


By running LTP stress test cases on VM, there is an RCU timeout issue on
some vCPUs recently. The problem is that there is HW timer interrupt lost
issue when injecting SIP0/IPI interrupt from KVM hypervisor, this problem
is hidden because the KVM hypervisor will inject spurious timer interrupt
if emulated timer is expired. In late the spurious timer interrupt is
clear if old TI bit of ESTAT register is not set, so there will be RCU
timeout issue with LTP stress test.

This patch set fixes the HW timer interrupt lost issue, also this patch
moves unconditional delay in timer interrupt clear scenery, which happens
seldomly; mostly the timer interrupt bit is set when it expires.

Bibo Mao (3):
LoongArch: KVM: Move AVEC interrupt injection in switch loop
LoongArch: KVM: Fix HW timer interrupt lost when inject interrupt from
software
LoongArch: KVM: Move unconditional delay in timer clear scenery

arch/loongarch/kvm/interrupt.c | 37 +++++++++++++++++++++++++---------
arch/loongarch/kvm/timer.c | 16 +++++++++++++--
2 files changed, 41 insertions(+), 12 deletions(-)


base-commit: d568788baab24875604c231f723dbb72387fb081
--
2.39.3