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=1796037577; b=TPxA+4ifD3KwEzGkzIeIThaldRurZYWZZnbCqURPd/gOPo1ajo6VQiGzrGS3fSWHbhiW NS421BQJ3RjeaMyCtzwMNqnaPMtAr7LnEw447fQQR4XSyvxAXp4VaowjM19niYBqZWtGD uCLfO3z+P750wBREjuIIOYzpB29PRewM2czcYB7YOxCDXn5/1hhlt/A5jwc2lG+BJ5Sch JvyNDzxHcGEV/JOHohiqbMbNW5PJAnP1oOI9rsvjARSmH6Jvea31pjjUNSI+RAZzJCkL5 aJqyJB2dBzqbPoIcWndtPC1AeGV1U8LSEDPCtqLyS85DB8as/cF5cuY3dkZjr9LVzGw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796037577; 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=UadtMaHVa6STkjm8nHYKxQxp+kYdor8UZmg9pr2AQHHHNBtZwQZhwuSVefPM+T85C9cW Cmg4ECg0LWWscbEaz2zPqVymq+s0YSpLWfg2w/WrBZExlS27FjnTexzskndTZEzgYtv6j FJZ0rM3aIL8LwHWUfZ0KXvsa0L+2/sJaHiEbE7SsBPXVpZSTngoAQs1KHMYLJbpG/INl1 wEPnBNKVmxNO/LNOaTJsnTkgkB36YSC7BZA4kZmJEM3TYZgLGZiA8e4NGjbgcKCOGP9qN 2ktYvH1EbxJVLJvNvKDiL148530I/FitqKMMJK27CQk41Fx1cp8JRyPxMFb/IRg+i/g== 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 2E0D5606A331; Mon, 30 Nov 2026 11:19:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2E0D5606A331 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 C858A1570; 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-mips@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