mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ze Huang" <ze.huang@oss.qualcomm.com>
To: "BillXiang" <xiangwencheng@lanxincomputing.com>,
	"guoyaxing" <guoyaxing@bosc.ac.cn>,
	"Anup Patel" <anup@brainfault.org>
Cc: "Atish Patra" <atish.patra@linux.dev>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>, <kvm@vger.kernel.org>,
	<kvm-riscv@lists.infradead.org>,
	<linux-riscv@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	<majiuyue@bosc.ac.cn>, <anzoso@outlook.com>,
	"linux-riscv" <linux-riscv-bounces@lists.infradead.org>
Subject: Re: [PATCH] RISC-V: KVM: Flush VS-stage TLB before reusing a host CPU
Date: Wed, 25 Nov 2026 00:05:28 +0800	[thread overview]
Message-ID: <DN3KIA4URDQ5.2MNEHHDE6WLAJ@oss.qualcomm.com> (raw)
In-Reply-To: <bddcd13b-b97d-4c24-8f08-e0a239065e68@lanxincomputing.com>

On Wed Oct 21, 2026 at 5:32 PM CST, BillXiang wrote:
> On 10/10/2026 5:06 PM, guoyaxing wrote:
>> 

[ ... ]

>> In other words, I am not sure this case is covered by a full guest TLB 
>> flush to all VCPUs on the mapping update. Guest shootdown looks 
>> mm_cpumask-based, and host pCPU migration of a vCPU does not by itself 
>> add other vCPUs that never ran the mm into that mask.
>> 
>> The earlier RFC note has a bit more detail on the flow we observed:
>> https://lore.kernel.org/kvm/0d15b098-b8f7-4080-9f33- 
>> e8c49c2331e1@bosc.ac.cn/
>> 
>> Please let me know if I misunderstood the intended invalidation path here.
>> 
>> Thanks,
>> Yaxing
>> 
>
> Hi Yaxing,
>
> Thanks for your work. To help review and validate this patch, I am 
> sharing the two programs below, which were generated with the help of an 
> AI assistant. I reviewed the code and ran it on my test system: without 
> this patch the reproducer triggers the stale VS-stage TLB entry, and 
> with the patch applied it no longer does.
>

[ ... ]

> --- 8< --- end --- 8< ---
>
> Tested-by: BillXiang <xiangwencheng@lanxincomputing.com>
>

Thanks Bill.

I reproduced the same failure on SpacemiT K3 and V100, adapted from your
reproducer: the guest side drives the same four phases over the console
instead of TCP, so it also runs from an initramfs on a bare board.

  Platform      | Host kernel                | Iters | Hits
  --------------+----------------------------+-------+----------
  SpacemiT K3   | v7.4-rc1, unpatched        |  19   | 15
  SpacemiT K3   | v7.4-rc1 + fix             |  20   |  0
  SpacemiT v100 | Ubuntu 7.0.0-30, untouched |  42   | 36 (86%)

Code and notes:
https://github.com/Sutter099/llscripts/tree/main/work/vstlb-repro

Tested-by: Ze Huang <ze.huang@oss.qualcomm.com>

  reply	other threads:[~2026-11-24 16:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-17 10:24 Yaxing Guo
2026-10-09 18:51 ` Anup Patel
2026-10-10  2:11   ` guoyaxing
2026-10-10  7:50     ` Anup Patel
2026-10-10  9:06       ` guoyaxing
2026-10-21  9:32         ` BillXiang
2026-11-24 16:05           ` Ze Huang [this message]
2026-10-24 15:49         ` Anup Patel
2026-10-26 10:18           ` guoyaxing
2026-10-28  6:14             ` Anup Patel
2026-10-28  7:15               ` BillXiang
2026-10-28 10:23                 ` Anup Patel
2026-10-29  4:05           ` BillXiang
2026-11-04 12:12             ` Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DN3KIA4URDQ5.2MNEHHDE6WLAJ@oss.qualcomm.com \
    --to=ze.huang@oss.qualcomm.com \
    --cc=alex@ghiti.fr \
    --cc=anup@brainfault.org \
    --cc=anzoso@outlook.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=atish.patra@linux.dev \
    --cc=guoyaxing@bosc.ac.cn \
    --cc=kvm-riscv@lists.infradead.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv-bounces@lists.infradead.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=majiuyue@bosc.ac.cn \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=xiangwencheng@lanxincomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®