Re: [PATCH v2 0/2] RISC-V: KVM: Optimize hfence request handling for SMP guests

<[email protected]> Fri, 31 Jul 2026 14:18:01 +0800 (CST)
Newsgroups org.infradead.lists.kvm-riscv,org.infradead.lists.linux-riscv,org.kernel.vger.kvm,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
> >
> > This series improves the hfence request handling in RISC-V KVM,
> > targeting scenarios where multiple VCPUs are running an SMP guest.
> >
> > The first patch Introduce make_xfence_request_nodata for FENCE.I
> > requests and 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.
> >
> > Changes in v2:
> >  - Fix the patch01 broken the KVM_REQ_FENCE_I request(Sashiko AI review).
> >
> >  - Link to v1:
> >  https://lore.kernel.org/linux-riscv/[email protected]/
> >
> > Wang Yechao (2):
> >   RISC-V: KVM: Introduce make_xfence_request_nodata for FENCE.I requests
> >   RISC-V: KVM: Separate req and fallback_req masks in
> >     make_xfence_request
> >
> >  arch/riscv/kvm/tlb.c | 46 +++++++++++++++++++++++++++++++++-----------
> >  1 file changed, 35 insertions(+), 11 deletions(-)
> >
> > --
> > 2.43.5
> >
>
> The PATCH2 is a fix independent of PATCH1 so re-order
> and make PATCH2 as first patch which can be applied
> independent of PATCH1
>
> Regards,
> Anup

Thanks for the review.  I will reorder the patches in v3 so that PATCH2 comes first.

Regards,
Yechao

-- 
kvm-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kvm-riscv