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=1796289457; b=OwouEKZNAjgy9hGiLYRQg9l9L7X3OmzincX4WO/gL2CpogDCa9G7hKzOA48Mr7aVfpAw A7p8o7RULxEnkuLvAPJcbM/56rk8Aqdg7+tl6fexxrL4yedQ/Zg16l6dsvg+FcjOXrYYM 5LLZQ9zVhBeLbKLPA3F6lmwVchCZIl1dgr1/oP5YokcouP1nFytj23a48VRxwuAfz9p0O WtShOkeiXwntZuIngFAf4/2MCntuuRpriZ3W55X+GtvgubsxR9Vc77Bge82/HouZfUMRL H+9AiJOO1em7bUkSXiAtFfuAWQShmSmwabGCLi4Q5fjw5OwBlq7vXEZiAp/aQKh85LA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796289457; 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=w7A6fR7/nNIbq+UyjK+SX1/c7MhzJqQABQ4UkZtt4c4=; b=0XKMl09bU3UswZHtk05dcJs++Tcf41bDpOQtzuyoVrOQJliCe3s5kRaLVzXbkvk2dz1O tcS1v0QM0aqy3Ni4po52Qb5gbJDGvCfFyjtPm50iCWhrFFgQl4WNIbrRrrEuFqqbKuw0t BoEO6wfg6gJMjNXIQafnRk0p83YeSR+bX32t14aJFcaajyiOTp/A8i75jDpTF6ubuwEz3 6nG/JgaRvPx+ml9giAmsO3ETTAl8dXUM4WuPT6oyPwhw2H/BChErSCWbEfHsH+AEAiABd D3AV9Ru1tDnK/nvg6suFQHOltPO32bNCaYQM0ox/nSiIRYHV8CxMECYxWpCYqOQ02NA== 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="mggPK/J5"; 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 3A5F3606A698 for ; Thu, 3 Dec 2026 09:17:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3A5F3606A698 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=mggPK/J5 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 1F7BF1516; Thu, 3 Dec 2026 01:17: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 98D873F7D8; Thu, 3 Dec 2026 01:17:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796289454; bh=wn0QPp5e2FDfU+52FzAnqCdr1Evhp2Wrdv71ictr4KM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mggPK/J5V5JoMJrm+18aO25CDS880B0aFPLOrSwMUH3JTBK94PV4VgWftspaXEfjF 5e3ZJ4Smjqw088meeo5E9yCIRmqWV2V3rx/yjPlRuVIcM2PFcPE4gf+QeqZCJtO7Ox DEkm8JdX/bVtyLNKMxxu3IwHX9L3MvwH3gdP8GhQ= Date: Thu, 3 Dec 2026 09:17:22 +0000 From: Yeoreum Yun To: "David Hildenbrand (Arm)" Cc: Dave Hansen , Yeoreum Yun , sashiko-reviews@lists.linux.dev, 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-mm@kvack.org, kvm@vger.kernel.org, Sohil Mehta Subject: Re: [PATCH v4 12/20] x86/mm: Introduce helper for checking direct map 1G page support Message-ID: References: <36d2dc8f-0bba-40e3-9d69-d0d3feb9e77e@intel.com> <23c24c39-0fc9-4d56-a762-29fe3421552f@intel.com> <737e6641-12fa-41b8-a87a-e64032483ced@intel.com> <9854d654-b076-4627-81f0-1c594f140a4c@kernel.org> X-Mailing-List: kvm@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: On Wed, Dec 02, 2026 at 11:28:19PM +0100, David Hildenbrand (Arm) wrote: > On 12/2/26 23:27, David Hildenbrand (Arm) wrote: > > On 12/2/26 23:19, Dave Hansen wrote: > >> On 12/2/26 14:13, Yeoreum Yun wrote: > >>> Well, The problem is as we use direct_gbpages_enabled(), the > >>> nogbpages options can affect this situation where sashiko complains. > >> > >> Sashiko is a tool. It spews irrelevant noise. Just like checkpatch.pl. > >> > >> We humans need to be on the lookout for that noise, and filter it out. > >> > >> Given that, I'll ask my question again: Does anyone *need* a fix for > >> this? Can't it just be ignored for the purposes of this set? > > > > I thought the original patch we had in was to make the compiler happy. Levi, do > > I remember correctly? > > Ah, or are we only talking about Sashiko's finding and not the entire patch #12? We're talking about Sashiko's finding whether it's ignorable in this patchset. Also I think orignal patch for #12 [1] still has the same problem in case of boot_cpu doesn't have X86_FEATURE_GBPAGES. while I'm investigating commit d367cef0a7f0 ("x86/mm/apt: Fix boot crash when 1GB pages are not supported by the CPU"), I can find his efi memory map[2] which triggers above problem: ... [ 0.000000] efi: ACPI 2.0=0x7924c014 ESRT=0x787b4218 SMBIOS=0x78859000 ... [ 0.000000] efi: mem30: [Boot Data | | | | | | | |WB|WT|WC|UC] range=[0x000000007924d000-0x000000007a000000) (13MB) [ 0.000000] efi: mem31: [Conventional Memory| | | | | | | |WB|WT|WC|UC] range=[0x0000000100000000-0x0000000180000000) (2048MB) [ 0.000000] efi: mem32: [Memory Mapped I/O |RUN| | | | | | | | | |UC] range=[0x00000000e00f8000-0x00000000e00f9000) (0MB) [ 0.000000] efi: mem33: [Memory Mapped I/O |RUN| | | | | | | | | | ] range=[0x00000000fed01000-0x00000000fed02000) (0MB) ... Since one area of *Conventional Memory* is 2GB, I think this problem could be triggered when efi is mixed even in the latest one with the same platform (Scotts' Intel Celeron N2820). So for the Dave's question whether we *need* this fix. I think yes we need it since commit d367cef0a7f0, seems only handle for first 1GB not later 1GB area. IOW, in the latest kernel using efi_is_mixed, this problem could happen and the fix commit d367cef0a7f0 is not enough but I think it should include with: diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c index b1d5c5a0ffb41..0470fa4bc97c8 100644 --- a/arch/x86/mm/pat/set_memory.c +++ b/arch/x86/mm/pat/set_memory.c @@ -1692,7 +1692,7 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, p4d_t *p4d, pgprot_t pgprot) { pud_t *pud; - unsigned long end; + unsigned long end, nend; long cur_pages = 0; pgprot_t pud_pgprot; @@ -1748,7 +1748,7 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, p4d_t *p4d, } /* Map trailing leftover */ - if (start < end) { + for (; start < end; start = nend) { long tmp; pud = pud_offset(p4d, start); @@ -1756,7 +1756,8 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, p4d_t *p4d, if (alloc_pmd_page(pud)) return -1; - tmp = populate_pmd(cpa, start, end, cpa->numpages - cur_pages, + nend = pud_addr_end(start, end); + tmp = populate_pmd(cpa, start, nend, (nend - start) >> PAGE_SHIFT, pud, pgprot); if (tmp < 0) return cur_pages; Link: [1] https://lore.kernel.org/all/20260722-dummy_ptxp3-v2-14-d9e4bad31e0a@arm.com/ Link: [2] https://lore.kernel.org/all/1457888975.3884.9.camel@talk21.com/ -- Sincerely, Yeoreum Yun