linux/arch/loongarch
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
..
boot LoongArch: Adjust build infrastructure for 32BIT/64BIT 2026-04-22 15:44:26 +08:00
configs Networking changes for 7.1. 2026-04-14 18:36:10 -07:00
crypto loongarch/crc32: expose CRC32 functions through lib 2024-12-01 17:23:01 -08:00
include LoongArch: KVM: Compile switch.S directly into the kernel 2026-05-04 09:00:37 +08:00
kernel LoongArch changes for v7.1 2026-04-24 09:54:45 -07:00
kvm LoongArch: KVM: Move unconditional delay into timer clear scenery 2026-05-04 09:00:48 +08:00
lib LoongArch changes for v7.1 2026-04-24 09:54:45 -07:00
mm LoongArch changes for v7.1 2026-04-24 09:54:45 -07:00
net LoongArch changes for v7.1 2026-04-24 09:54:45 -07:00
pci LoongArch: Fix potential ADE in loongson_gpu_fixup_dma_hang() 2026-05-04 09:00:20 +08:00
power LoongArch: Adjust misc routines for 32BIT/64BIT 2025-12-08 18:09:17 +08:00
vdso LoongArch: Specify -m32/-m64 explicitly for 32BIT/64BIT 2026-05-04 09:00:01 +08:00
Kbuild LoongArch: KVM: Compile switch.S directly into the kernel 2026-05-04 09:00:37 +08:00
Kconfig LoongArch: Make CONFIG_64BIT as the default option 2026-05-04 09:00:00 +08:00
Kconfig.debug LoongArch: Only allow OBJTOOL & ORC unwinder if toolchain supports -mthin-add-sub 2024-06-21 10:18:40 +08:00
Makefile LoongArch: Specify -m32/-m64 explicitly for 32BIT/64BIT 2026-05-04 09:00:01 +08:00