From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2128111CBA for ; Thu, 27 Nov 2025 14:35:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764254130; cv=none; b=mwgPPavBTw/hTAwVA9XTW9Q2y16WRhpoALT7aZDOUMQQ9E56Me8L4HiQt01JcRKfP5lBuqJGRpIrHVCFozQ8p6J6V6VJ9oPT6y4a/PCxpb+PZOjojlkPmmCvdxXJsEErzdN9UbMHoPfZYm1jAE7NhN7vTuOL/e0nvo+eVeluxEk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764254130; c=relaxed/simple; bh=UDLc1CqxZJcVKi43UgayKNr0J6774QHnLT+WGntUTNo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ipx8JwBZgCmIuQB4OGxpk4hAUb5t5wE/AA2bIgQb+VWDJNiXdxgXk9P1UObW7lHK1Z7DJu1qpvr1GEBFlltUJQMT7UU8GvxURBQtSIFGMNcMA/PCmiM/gcDWNQQslNWaKLGDsqKS3y+gdbdOqMDasxQflHwKQfnVSdXAYzVMq18= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=kZHQK9lu; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="kZHQK9lu" Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 55C7C40E0217; Thu, 27 Nov 2025 14:35:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id UBY2Y72gUepK; Thu, 27 Nov 2025 14:35:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1764254117; bh=+/t5IJbsjjORAe3BMYR07gzLKKaQl76j+/qslE/TvN8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=kZHQK9lu90rEvjngQhzGY6gWxwCBpYObtDTVGG0HSkUuLuhnJyxyDRTZ5GKqsvk+0 bDAC0uB0UegPBXaFq1du49eCwWRkf//Z2z1TlEShV/gBlGA7akbcP8VSPcRhkTqLcL nhtu/ZhhPHmQP4OXjuiaaT6Gnco9zO4n316XnZDL3zxK9zQCQ/bCa3XH4lgIB0vxIJ pfF7U9TSPiSHJ0lp2fq2kQdXiALuEDca+G2UiaA5zcaCX01wLUQ/C/GlmvcmjwYb8Q YGaIDjCNEcFfM7LXdQDb6g06oew4KemjS7tERrRZhhyWfIwad45jO52yHcgHM4ZAQM m/enf3EYrH4qcuzFzQlJN2FO8HUah7EhOBzLQWYlSqGQNaXre1PNE3TRQj2VUl9mm2 ZK8LXeHVu5Au9c+Fuy51C+HTy36+/X1N476Gm7l1xO24uK3V8z2XzpnHlVrYkuJUb3 UhqPECdpUgY97tk8G0kq7QbcA2D2KpOtMFNYspAPTyCSrtoE6Jt+vDoCkiYPLxOJVb g+HNEcW6NWMjGCf9TeVjLXLO4Zp2iLIdirqZlxURKWpoo9NmgEGoKwMDm5s0zWcof2 rZ53MlhM05uzDMteagBFuvmncemRE3LWq/wKEdcF/UiZBITqLKBKDkcgCb2u59SJ/0 nft5UhGWGWceGbzgtKB8R0Jk= Received: from zn.tnic (pd953063a.dip0.t-ipconnect.de [217.83.6.58]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with UTF8SMTPSA id 29B2340E01A5; Thu, 27 Nov 2025 14:35:08 +0000 (UTC) Date: Thu, 27 Nov 2025 15:35:01 +0100 From: Borislav Petkov To: Brendan Jackman Cc: Thomas Gleixner , Ingo Molnar , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/4] x86/mm: harmonize return value of phys_pte_init() Message-ID: <20251127143501.GAaShhlVTH5iQpCdPM@fat_crate.local> References: <20251003-x86-init-cleanup-v1-0-f2b7994c2ad6@google.com> <20251003-x86-init-cleanup-v1-2-f2b7994c2ad6@google.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 In-Reply-To: <20251003-x86-init-cleanup-v1-2-f2b7994c2ad6@google.com> On Fri, Oct 03, 2025 at 04:56:42PM +0000, Brendan Jackman wrote: > In the case that they encounter pre-existing mappings, all the other > phys_*_init()s include those pre-mapped PFNs in the returned value. > Excluding those PFNs only when they are mapped at 4K seems like an > error. So make it consistent. > > The other functions only include the existing mappings if the > page_size_mask would have allowed creating those mappings. > 4K pages can't be disabled by page_size_mask so that condition is not > needed here; paddr_last can be assigned unconditionally before checking > for existing mappings. > > Signed-off-by: Brendan Jackman > --- > arch/x86/mm/init_64.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c > index 9e45b371a6234b41bd7177b81b5d432341ae7214..968a5092dbd7ee3e7007fa0c769eff7d7ecb0ba3 100644 > --- a/arch/x86/mm/init_64.c > +++ b/arch/x86/mm/init_64.c > @@ -492,6 +492,8 @@ phys_pte_init(pte_t *pte_page, unsigned long paddr, unsigned long paddr_end, > continue; > } > > + paddr_last = paddr_next; > + > /* > * We will re-use the existing mapping. > * Xen for example has some special requirements, like mapping I don't understand: the other phys_*_init() things do: if (!XXX_none()) ... paddr_last = paddr_next; while you've raised the assignment above that test. Also "seems like an error" needs a lot more poking at because if it is an error, then its incarnation must be really nasty and subtle or it is not, and then we don't care. And it has been that way for a while now... But maybe I'm not seeing it from the right angle... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette