From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A108E330B32 for ; Fri, 17 Jul 2026 17:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784308503; cv=none; b=ZBRCQD7El7/3dvk3LRcQ2C6wnPGGm5c2zdtYFs11wtPMfr4cGcqu3XthHaSvZ3t23bijte4hciLcHZs9MjkcIc5m3R/VLjzxc9pZEGD6umXALpAurxHztqHSDJi+D7gjoeY3eLHzrzDPtQSiEJOj1qcF2d5pkh2vptfOecEe/FU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784308503; c=relaxed/simple; bh=gEku/G4JWYylxpTk3ChqdMj2bF8wHngBKkzSzqFXc3c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=XYBsLSoZF9asacYoP5IN7fCO/6HwUAU2lrDppnkZ1bwBSQ35QlN+CqSDf6UMhysn7CED3ghG0v8bGsMo2fTxKlptIBGk7YXe2oqGryxSd1+2lVRczeh6hZPZiC9FOBSr6CQwAurQgdww3nO65Fg2saGeN5toLGuo4U4GzkpJsBE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=HHcpQjXE; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="HHcpQjXE" Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-39eb257e9fbso6348561fa.0 for ; Fri, 17 Jul 2026 10:15:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784308498; x=1784913298; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=R8FryPYFYCyHP2tVntQjof5QiNSW+WztEMic5mCIZYA=; b=HHcpQjXEZkyl5FaSZlyAwz/uWtAsUnmba7BcAtgN6oizOZqKR7NtN5fMb1OasCs+do bfaL2zhlk8DhHMsnGrl7e3lNCNYaU2h26uMiaMvviYNOn+mJAAkU09/X10x3Hz77Z1gp LYTcSyZOlmSMKAV3Do89SMvtHmrC8c0FDvAEqIXAoHt0wSAHgogSZ6DKp4m1TDGGFu61 I46KDwLEJ9wWoWeoRQId5H+a8Hr7khzZdPa73hlsqHHQI58D4rShBHsLZgDYDXfQoYo0 kQQwYbOzg0yBwmyoCa6qZhL2Xk+oQ1aFVPT5S6D4oPbi9JOT/N8hxNWkmTvYjgeKiOD+ cBGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784308498; x=1784913298; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=R8FryPYFYCyHP2tVntQjof5QiNSW+WztEMic5mCIZYA=; b=dAFC/u+irwGrRkQjSPtRoIHd3q0EtPyZcX8v3KieyXc4iyXkb/5ZCHiD6e3ZuSNNW5 3lylbsWqPCK+WcEnIY/wl+6PmiSysN1YOMWj4p8DMUzICfR5T+WQKoGUh0t2BW35j0ni G0zW7Na3JzJkRy5rxrbrggZamXQ+CKW1s7LKz5U83oAwM5wNTQsWAFcbcSZw1bULIQK2 6RS1BWFhrMoy5yEqGlM0Nx/uTzeRMgY2dKrdsIxQ21cGxWurtPsKMHtXusWB5NhUm71N nojjHMPFZBJoC4Bi9WH/oNn+E7JEtfmk1ouWy7WmZk3jHuSqBPyZm3nthbP9Ogn6+2kw s2SQ== X-Forwarded-Encrypted: i=1; AHgh+Rqf1Zh7VYvwIc7dC/mu5ERz606WFEHELVkkt3l6WQ9yVJTf4bi6Fox9FTjTyXGx5MHmDmpt3vV0GX8hI08=@vger.kernel.org X-Gm-Message-State: AOJu0YxUJRzZ3bapwzkZePcZYe1OqL5xGlevKfikvzoKEwhxKr7s9kvd Sk23zspdbJmuT+sk94IpsCgxthwcmfOe2LDgSeNrUT/FGaVi3t7oMOef X-Gm-Gg: AfdE7ck81lW1th9/JnHnCjjLpk4DvAeBUS8/i08gTSRF1l38k/L+IkI2zkuwWKSDhN3 BEOf1kljGtaosWep0H0hDCHnkq6qFNwI4aUHeonLDQZ40iVOEjvX9UygBMCkOioPQhC2oEJ+sy1 IALVv8BAIh2IFWc4/Qg7N92RadadyK0HYY5FRZ+H0FIuVj2Arx6N6l8fGR1ah4URV/RYU381pZH 3KcR0tMpdCmAzW+pVV6SsDSLmmey/qLHYrdt1ndDwwZrbSWqZlfqZ1tLxA4X4GD48kYQOO7m4gQ 6eSfvjYOILZMH9ZarS2LBH8/WSKYBcoGfp+2rhQWjRNaD6KWffkYWBKjrdYfLBIsq7INCsFKgEE cT5e06E6iXJJouLMRLSw44fqd7ohm5XvFxrOPbLHaBPiEWwCFPKOjorygv67wxgo6rCg32E4fKh 8F52u+M44PaU3XXKZB X-Received: by 2002:a05:6512:2250:b0:5b0:1708:afa6 with SMTP id 2adb3069b0e04-5b28f9a7933mr815354e87.43.1784308498311; Fri, 17 Jul 2026 10:14:58 -0700 (PDT) Received: from localhost (soda.int.kasm.eu. [2001:678:a5c:1202:7b92:9ac1:b9ef:5287]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5b291e26118sm485318e87.79.2026.07.17.10.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jul 2026 10:14:57 -0700 (PDT) Date: Fri, 17 Jul 2026 19:14:57 +0200 From: Klara Modin To: Xu Lu Cc: Paul Walmsley , Paul Walmsley , palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, apw@canonical.com, joe@perches.com Subject: Re: [External] Re: [PATCH v2 1/3] riscv: mm: Use ASID in update_mmu_cache() Message-ID: References: <20260715132009.10634-1-luxu.kernel@bytedance.com> <20260715132009.10634-2-luxu.kernel@bytedance.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On 2026-07-18 00:57:06 +0800, Xu Lu wrote: > Hi Paul, > > A gentle ping. > > I have no idea what I can do regarding linux-next. Could you please > help revert the patch from version 1 and cherry-pick all the patches > from version 2 instead? Or what can I do for this? Paul has updated the for-next branch at git.kernel.org/pub/scm/linux/kernel/git/riscv/linux.git so it should sort itself out to either today's or monday's next version (depending on if the tree has already been pulled or not). Even if it is not pulled until monday I think it will be fine, this is what linux-next is for after all. Regards, Klara Modin > > Best regards, > Xu Lu > > On Fri, Jul 17, 2026 at 10:11 AM Xu Lu wrote: > > > > Hi Paul, > > > > Klara found that linux-next cherry-picks the new version of patch 2 > > while picking the old version of patch 1, which leads to an > > uninitialized asid. Could you please help correct this? > > > > Best regards, > > Xu Lu > > > > On Fri, Jul 17, 2026 at 12:25 AM Klara Modin wrote: > > > > > > Hi, > > > > > > On 2026-07-15 21:20:07 +0800, Xu Lu wrote: > > > > Only flush TLB entries for the specified mm in update_mmu_cache_range(). > > > > > > > > Signed-off-by: Xu Lu > > > > --- > > > > arch/riscv/include/asm/pgtable.h | 4 +++- > > > > arch/riscv/include/asm/tlbflush.h | 5 +++++ > > > > arch/riscv/mm/tlbflush.c | 5 ----- > > > > 3 files changed, 8 insertions(+), 6 deletions(-) > > > > > > > > diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h > > > > index 5d5756bda82e..9926556099ae 100644 > > > > --- a/arch/riscv/include/asm/pgtable.h > > > > +++ b/arch/riscv/include/asm/pgtable.h > > > > @@ -568,6 +568,8 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf, > > > > struct vm_area_struct *vma, unsigned long address, > > > > pte_t *ptep, unsigned int nr) > > > > { > > > > + unsigned long asid = get_mm_asid(vma->vm_mm); > > > > + > > > > > > It seems the old version of this patch is still used (at least in > > > next-202650716, 15ce1d7c4ddfe0dff00fcaee4ccaeef3efbc62c6), which means > > > asid is not initialised here. We instead have: > > > > > > diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h > > > index 5d5756bda82e..755495a542cc 100644 > > > --- a/arch/riscv/include/asm/pgtable.h > > > +++ b/arch/riscv/include/asm/pgtable.h > > > @@ -568,6 +568,8 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf, > > > struct vm_area_struct *vma, unsigned long address, > > > pte_t *ptep, unsigned int nr) > > > { > > > + unsigned long asid; > > > + > > > /* > > > * Svvptc guarantees that the new valid pte will be visible within > > > * a bounded timeframe, so when the uarch does not cache invalid > > > @@ -583,10 +585,11 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf, > > > * Relying on flush_tlb_fix_spurious_fault would suffice, but > > > * the extra traps reduce performance. So, eagerly SFENCE.VMA. > > > */ > > > + asid = get_mm_asid(vma->vm_mm); > > > while (nr--) > > > - local_flush_tlb_page(address + nr * PAGE_SIZE); > > > - > > > + local_flush_tlb_page_asid(address + nr * PAGE_SIZE, asid); > > > } > > > + > > > #define update_mmu_cache(vma, addr, ptep) \ > > > update_mmu_cache_range(NULL, vma, addr, ptep, 1) > > > > > > > > > This means that patch 2 of this series will use the uninitialised asid > > > for local_svinval_vma() and I get the same behaviour as before (hang on > > > initramfs). If I revert the two patches of this series which are in next > > > and apply this again it's fine. > > > > > > Regards, > > > Klara Modin ...