linux/arch/loongarch/kvm
Bibo Mao 5a873d77ba LoongArch: KVM: Move unconditional delay into timer clear scenery
When timer interrupt arrives in guest kernel, guest kernel clears the
timer interrupt and program timer with the next incoming event.

During this stage, timer tick is -1 and timer interrupt status is
disabled in ESTAT register. KVM hypervisor need write zero with timer
tick register and wait timer interrupt injection from HW side, and
then clear timer interrupt.

So there is 2 cycle delay in KVM hypervisor to emulate such scenery,
and the delay is unnecessary if there is no need to clear the timer
interrupt.

Here move 2 cycle delay into timer clear scenery and add timer ESTAT
checking after delay, and set max timer expire value if timer interrupt
does not arrive still.

Cc: stable@vger.kernel.org
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
2026-05-04 09:00:48 +08:00
..
intc Arm: 2026-04-17 07:18:03 -07:00
exit.c LoongArch: KVM: Fix missing EMULATE_FAIL in kvm_emu_mmio_read() 2026-05-04 09:00:38 +08:00
interrupt.c LoongArch: KVM: Fix HW timer interrupt lost when inject interrupt by software 2026-05-04 09:00:48 +08:00
irqfd.c LoongArch: KVM: Add DMSINTC inject msi to vCPU 2026-04-09 18:56:37 +08:00
Kconfig LoongArch: Adjust build infrastructure for 32BIT/64BIT 2026-04-22 15:44:26 +08:00
main.c LoongArch: KVM: Compile switch.S directly into the kernel 2026-05-04 09:00:37 +08:00
Makefile LoongArch: KVM: Compile switch.S directly into the kernel 2026-05-04 09:00:37 +08:00
mmu.c LoongArch: KVM: Use kvm_set_pte() in kvm_flush_pte() 2026-05-04 09:00:38 +08:00
switch.S LoongArch: KVM: Fix "unreliable stack" for kvm_exc_entry 2026-05-04 09:00:37 +08:00
timer.c LoongArch: KVM: Move unconditional delay into timer clear scenery 2026-05-04 09:00:48 +08:00
tlb.c LoongArch: KVM: Delay secondary mmu tlb flush until guest entry 2024-07-09 16:25:50 +08:00
trace.h LoongArch: KVM: Move kvm_iocsr tracepoint out of generic code 2025-09-23 23:37:26 +08:00
vcpu.c LoongArch: KVM: Move host CSR_GSTAT save and restore in context switch 2026-04-09 18:56:36 +08:00
vm.c LoongArch: KVM: Cap KVM_CAP_NR_VCPUS by KVM_CAP_MAX_VCPUS 2026-05-04 09:00:37 +08:00