[PATCH v2 0/3] LoongArch: KVM: Some small enhanments

From: Bibo Mao

Date: Tue Mar 17 2026 - 05:36:40 EST


There are some small enhancements about LoongArch KVM. There is
improvement about VM entry path in patch 1 and patch, add pending
request checking in advance and it is empty at most time.

Also change vcpu_is_preempted() from function to macro method, by actual
benchmark test such as unixbench. It is affected on physical machine
with function method. With the macro method, only one nop instruction
is added and there is no parameter parsing, there is no obvious
performance influence with physical machine.
---
v1 ... v2:
1. Add READ_ONCE() with src->preempted to avoid compiler optimization.
---
Bibo Mao (3):
LoongArch: KVM: Add kvm_request_pending checking in
kvm_late_check_requests()
LoongArch: KVM: Move host CSR_EENTRY save in context switch
LoongArch: KVM: Set vcpu_is_preempted() macro rather than function

arch/loongarch/include/asm/qspinlock.h | 27 +++++++++++++++++++++-----
arch/loongarch/kernel/paravirt.c | 15 ++------------
arch/loongarch/kvm/vcpu.c | 24 +++++++++++------------
3 files changed, 36 insertions(+), 30 deletions(-)


base-commit: f338e77383789c0cae23ca3d48adcc5e9e137e3c
--
2.39.3