Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH 0/2] RISC-V: KVM: Optimize hfence request handling for SMP guests
@ 2026-07-07 11:37 Wang Yechao
  2026-07-07 11:37 ` [PATCH 1/2] RISC-V: KVM: Move hfence type check out of loop Wang Yechao
  2026-07-07 11:37 ` [PATCH 2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request Wang Yechao
  0 siblings, 2 replies; 5+ messages in thread
From: Wang Yechao @ 2026-07-07 11:37 UTC (permalink / raw)
  To: Anup Patel, kvm, kvm-riscv, linux-riscv, linux-kernel
  Cc: Paul Walmsley, Palmer Dabbelt, Albert Ou, Atish Patra,
	Alexandre Ghiti, Wang Yechao

This series improves the hfence request handling in RISC-V KVM,
targeting scenarios where multiple VCPUs are running an SMP guest.

The first patch moves the hfence data/type validation out of the
VCPU loop to avoid redundant checks on every iteration.

The second patch fixes a more subtle performance issue: when one
VCPU's hfence queue becomes full and triggers a fallback, the
current code applies the fallback to all VCPUs indiscriminately.
This unnecessarily degrades healthy VCPUs and can cause their
queues to fill up prematurely due to lack of processing it.

With these changes, fallback is applied only to the VCPUs that
actually need it, preserving the efficiency of the normal path
for others.

Wang Yechao (2):
  RISC-V: KVM: Move hfence type check out of loop
  RISC-V: KVM: Separate req and fallback_req masks in
    make_xfence_request

 arch/riscv/kvm/tlb.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

-- 
2.43.5


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-07 11:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-07 11:37 [PATCH 0/2] RISC-V: KVM: Optimize hfence request handling for SMP guests Wang Yechao
2026-07-07 11:37 ` [PATCH 1/2] RISC-V: KVM: Move hfence type check out of loop Wang Yechao
2026-07-07 11:45   ` sashiko-bot
2026-07-07 11:37 ` [PATCH 2/2] RISC-V: KVM: Separate req and fallback_req masks in make_xfence_request Wang Yechao
2026-07-07 11:47   ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox