From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796037578; b=h66H0m97rM4cUACT2CFT7cwf0r0LMezepFisIf3xvSprtIbd2nQwdbGjeALZV3rcMMHh Kes3VBz7A61DLsW63sdqXmZgk+mGR5wbw3+QvwU7dMqZeOfEoXBy/NSRHhq0mdkZ1sWVK Rr2T29Oi1+HIGf6cP5MZnheJpNn1n58ppCQ//DLhDfrV8tr5OXSGkRcduzq56l/jszQFO 98HQSuBToUw0TbcDgTREAQy+i2rB1LbHNbhFY2QA5gydQzqzKWadpmOpWZBlWDQvaD91O tl54LjKpyDWLDiC9JG6CuI/r1/z9fSJy1fIBkJT77mshR7Zeo3Lo51pi3TGZUWGBTZQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796037578; h=DMARC-Filter:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To; bh=p7Y1DyV/kqbUizIYGmYMaLKFuXDHQS8eT4F2KcCSr2Q=; b=v/sNJ7C/mcncxWryCaf/e2GoSaGse4N7eIKgdUjkZGayejl7fBuCOrEeSYeyViR/FPsh sp/rX1xQXf3MWgKAgJaezjRx3yA5wUt3gRaIg8r5Gda/gk/4nB4YbEVdafCMa9dWbkMwP KAbRZBW7BB+K5yn/pEfrKCDPjSX414q/tZGWYDz9miq+i3waYzqWpv6wwdy+J1by92WlI 9IE7gnTR8GPB/Q9txe68Z/DS1m5yEzqQRxnNsKuUSx6zc3KNbFO+0zyK9XFoAV+nu0AiG QcXov1nTEs9EXeo3273lBMIgZGIODfqaAKNqyOakhJzc1EGKtkO8ZaK2sytTUWNGNuw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=VomwTzKO; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D1FA606A335; Mon, 30 Nov 2026 11:19:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3D1FA606A335 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=VomwTzKO Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id CA2711691; Mon, 30 Nov 2026 03:19:32 -0800 (PST) Received: from e129823.arm.com (e129823.arm.com [10.2.213.3]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3766A3F86F; Mon, 30 Nov 2026 03:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796037575; bh=FHz9TzexS7b1JesroGotDL2fwEiG/DgFhwJzUINF25o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VomwTzKOlLNr87M+zHTd2j8tR780i09lFu6fZDR9+QSiS3NiBwOSUyxZuZly4udBM iN2HnPVUFaRWZxFAEsi3THSIbwdx/nIF4PqM7vOeTdAdF8+AKQNGX6GsNOxkHd15Er hRW516ochssZeju7Ill66Da8jZ6J6IY9YjTZZJWY= Date: Mon, 30 Nov 2026 11:19:25 +0000 From: Yeoreum Yun To: "David Hildenbrand (Arm)" Cc: Yeoreum Yun , Russell King , Huacai Chen , WANG Xuerui , Thomas Bogendoerfer , Catalin Marinas , Will Deacon , Arnd Bergmann , Andrew Morton , Kairui Song , Qi Zheng , Shakeel Butt , Barry Song , Axel Rasmussen , Yuanchu Xie , Wei Xu , Johannes Weiner , Michal Hocko , Lorenzo Stoakes , Tianrui Zhao , Bibo Mao , Anup Patel , Atish Patra , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jonas Bonn , Stefan Kristiansson , Stafford Horne , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, linux-mips@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-openrisc@vger.kernel.org Subject: Re: [PATCH RESEND v2 07/21] mm/pgtable: define (pgd|p4d|pud)_offset_lockless() for folded page tables Message-ID: References: <20261102-dummy_ptxp3-v2-0-78840b2ec73c@arm.com> <20261102-dummy_ptxp3-v2-7-78840b2ec73c@arm.com> <02ddd9ae-a391-4dea-8cee-a66118bbb0a8@kernel.org> <5941e418-db7a-4dc8-b154-a7b33a2a0fc6@kernel.org> X-Mailing-List: linux-arch@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5941e418-db7a-4dc8-b154-a7b33a2a0fc6@kernel.org> On Mon, Nov 30, 2026 at 12:07:17PM +0100, David Hildenbrand (Arm) wrote: > On 11/30/26 11:53, Yeoreum Yun wrote: > > On Mon, Nov 30, 2026 at 11:40:18AM +0100, David Hildenbrand (Arm) wrote: > >> On 11/30/26 10:24, Yeoreum Yun wrote: > >>> Hi David, > >>> > >>> > >>> Thanks. I'll add with > >>> > >>> Fixes: d3f7b1bb2049 ("mm/gup: fix gup_fast with dynamic page table folding") > >>> > >>> where applied pXd_offset_lockless() with stack value in the generic implemenation. > >> > >> Is this something we want to CC stable and merge early? > > > > Agree. But I'm testing build on the latest mm-unstable again. > > Please send against mm-core/for-next :) > > > After above. I'd like to send the v3 series with below commit message > > for this patch: > > > > mm/pgtable: define (pgd|p4d|pud)_offset_lockless() for folded page tables > > > > The default helpers fallback to pud_offset(), passing a pointer to the > > stack value. > > > > Let's provide variants that do exactly what (pgd|p4d|pud)_offset() do, > > but ignore the passed pgd_t/p4d_t/pud_t, consequently not working on a > > pointer to the stack value like the default handlers would. > > > > With this patch, Drop the arm64 custom variant that did that. As it documents: > > > > Note: reusing the original pointer means that it may be > > dereferenced the same (live) page-table entry multiple times. > > This is safe because it is still only loaded once in the > > context of each level and the CPU guarantees same-address > > read-after-read ordering. > > > > Do not document this, as the double read will be removed in the next patch. > > > > Also, this patch fixes the pXd leaf recheck in fast GUP to read the live > > entry rather than a stack copy, ensuring that concurrent mapping changes > > are detected when the pXd level is folded. > > > > Fixes: Fixes: d3f7b1bb2049 ("mm/gup: fix gup_fast with dynamic page table folding") > > Cc: > > Signed-off-by: David Hildenbrand (Arm) > > > > Or, do you want to post this patch separately first? > > Is it possible to move this fix to #1 in the series? then we can easily decide > what to do. Okay. once checked based on mm-core/for-next, I'll post v3 with above. Thanks ;) -- Sincerely, Yeoreum Yun