[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aS4eWZ-d4tyjVzul@gourry-fedora-PF4VCD3F>
Date: Mon, 1 Dec 2025 18:01:45 -0500
From: Gregory Price <gourry@...rry.net>
To: balbirs@...dia.com
Cc: linux-kernel@...r.kernel.org, dan.j.williams@...el.com, x86@...nel.org,
Christian König <christian.koenig@....com>,
Ingo Molnar <mingo@...nel.org>, Kees Cook <kees@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Andy Lutomirski <luto@...nel.org>,
Alex Deucher <alexander.deucher@....com>,
Bert Karwatzki <spasswolf@....de>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Nicholas Piggin <npiggin@...il.com>, linux-mm@...ck.org,
linuxppc-dev@...ts.ozlabs.org
Subject: Re: [PATCH] arch/x86: memory_hotplug, do not bump up max_pfn for
device private pages
On Mon, Dec 01, 2025 at 02:11:35PM -0800, dan.j.williams@...el.com wrote:
> [ add Gregory and linux-mm ]
>
> [ full context for new Cc: ]
> Balbir Singh wrote:
> > Commit 7ffb791423c7 ("x86/kaslr: Reduce KASLR entropy on most x86 systems")
> > exposed a bug with nokaslr and zone device
> > interaction, as seen on a system with an AMD iGPU and dGPU (see [1]).
> > The root cause of the issue is that, the gpu driver registers a zone
^^^^^^^^^^^^^^ which one, iGPU
or dGPU? or they managed by the
same driver?
(sorry, stickler for vagueness)
> > Fix this by not bumping up max_pfn on x86 systems, when pgmap is passed
> > into add_pages(). The presence of pgmap is used to determine if device
> > private memory is being added via add_pages().
> >
Concur with Dan's take below here, please check for DEVICE_PRIVATE so as
not to affect DEVICE_COHERENT. Or if there's a reason to affect
DEVICE_COHERENT, please explain here.
> > arch/powerpc is also impacted by this bug, this patch does not fix
> > the issue for powerpc.
> >
> > I've left powerpc out of this regression change due to the time required
> > to setup and test via qemu. I wanted to address the regression quickly
> >
At least +Cc ppc folks to take a look?
+Cc: linux-ppc-dev
> diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
> index 0e4270e20fad..4cc8175f9ffd 100644
> --- a/arch/x86/mm/init_64.c
> +++ b/arch/x86/mm/init_64.c
> @@ -989,7 +989,7 @@ int add_pages(int nid, unsigned long start_pfn, unsigned long nr_pages,
> * addressable memory can force device drivers to use bounce buffers
> * and impact their performance negatively:
> */
> - if (!params->pgmap)
> + if (!params->pgmap || params->pgmap->type != MEMORY_DEVICE_PRIVATE)
> /* update max_pfn, max_low_pfn and high_memory */
> update_end_of_memory_vars(start_pfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT);
>
This looks better to me.
~Gregory
Powered by blists - more mailing lists