* Re: [PATCH v2] x86: update comment about pgd_list [not found] <20260323-pgd_list-comment-v2-1-77ccf2dc77e8@google.com> @ 2026-05-11 11:35 ` Brendan Jackman 2026-05-11 19:49 ` H. Peter Anvin 2026-05-11 18:27 ` [tip: x86/mm] x86: Update " tip-bot2 for Brendan Jackman 1 sibling, 1 reply; 4+ messages in thread From: Brendan Jackman @ 2026-05-11 11:35 UTC (permalink / raw) To: Brendan Jackman, Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86, H. Peter Anvin Cc: linux-kernel On Mon Mar 23, 2026 at 2:25 PM UTC, Brendan Jackman wrote: > This venerable comment got detached from its context when the code moved > in commit 394158559d4c ("x86: move all the pgd_list handling to one > place"). Put it back next to its context. It was originally on > pgd_list_add() but it actually describes pgd_list so put it there. > > While moving it, update it to strip away stale and superfluous info. > pageattr.c doesn't exist any more. pgd_list is now required > for all x86 architectures. Also be slightly more precise about what PGDs > are in this list. > > Signed-off-by: Brendan Jackman <jackmanb@google.com> > --- > Changes in v2: > - Moved it next to pgd_list instead of back to old location > - Strip away stale bits from the comment > - Added note about PGDs that _aren't_ in this list > - Link to v1: https://lore.kernel.org/r/20260311-pgd_list-comment-v1-1-4ea51b41adee@google.com Hi Dave, I think this is ready? (I don't see it in tip/master, apologies if I'm looking in the wrong place). ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] x86: update comment about pgd_list 2026-05-11 11:35 ` [PATCH v2] x86: update comment about pgd_list Brendan Jackman @ 2026-05-11 19:49 ` H. Peter Anvin 2026-05-11 20:43 ` Dave Hansen 0 siblings, 1 reply; 4+ messages in thread From: H. Peter Anvin @ 2026-05-11 19:49 UTC (permalink / raw) To: Brendan Jackman, Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86 Cc: linux-kernel On 2026-05-11 04:35, Brendan Jackman wrote: > On Mon Mar 23, 2026 at 2:25 PM UTC, Brendan Jackman wrote: >> This venerable comment got detached from its context when the code moved >> in commit 394158559d4c ("x86: move all the pgd_list handling to one >> place"). Put it back next to its context. It was originally on >> pgd_list_add() but it actually describes pgd_list so put it there. >> >> While moving it, update it to strip away stale and superfluous info. >> pageattr.c doesn't exist any more. pgd_list is now required >> for all x86 architectures. Also be slightly more precise about what PGDs >> are in this list. >> >> Signed-off-by: Brendan Jackman <jackmanb@google.com> >> --- >> Changes in v2: >> - Moved it next to pgd_list instead of back to old location >> - Strip away stale bits from the comment >> - Added note about PGDs that _aren't_ in this list >> - Link to v1: https://lore.kernel.org/r/20260311-pgd_list-comment-v1-1-4ea51b41adee@google.com > > Hi Dave, > > I think this is ready? > > (I don't see it in tip/master, apologies if I'm looking in the wrong > place). The PAE code comment should still remain. I don't know if the 32-bit PAE code is still suffering from Xen-induced drain bramage (using a whole page to store 32 bytes), but it is nevertheless true in a fashion -- as there are a maximum of 3 kernel PDE pages, they are considered the de facto top level of the kernel page tables. -hpa ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] x86: update comment about pgd_list 2026-05-11 19:49 ` H. Peter Anvin @ 2026-05-11 20:43 ` Dave Hansen 0 siblings, 0 replies; 4+ messages in thread From: Dave Hansen @ 2026-05-11 20:43 UTC (permalink / raw) To: H. Peter Anvin, Brendan Jackman, Dave Hansen, Andy Lutomirski, Peter Zijlstra, Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86 Cc: linux-kernel On 5/11/26 12:49, H. Peter Anvin wrote: > The PAE code comment should still remain. > > I don't know if the 32-bit PAE code is still suffering from Xen-induced drain > bramage (using a whole page to store 32 bytes), Actually, I think I recently spread the brain damage even further. The kmalloc()'d PGDs are completely gone now. PGDs all directly out of the page allocator. It actually simplified the 32-bit code quite a bit. > but it is nevertheless true in a fashion -- as there are a maximum > of 3 kernel PDE pages, they are considered the de facto top level of > the kernel page tables. Here's what I ended up with: > +/* > + * List of all process' PGD pages (excluding init_mm and some other special > + * system-wide PGDs). Mainly used to keep the kernel portion of the address > + * space in sync across mms. > + */ I think what you're saying is that those (max) 3 kernel PDE pages are static and all PGDs always have the same value in there. So, there's no synchronizing necessary on PAE. That was definitely true for a long time. But we actually also moved away from that: > https://lore.kernel.org/all/20250414173232.32444FF6@davehans-spike.ostc.intel.com/ PTI forced some PMD unsharing. So I just moved 32-bit over to not share kernel PMDs at all. It made the 32-bit code quite a bit simpler, although it wastes memory when PTI is disabled. ^ permalink raw reply [flat|nested] 4+ messages in thread
* [tip: x86/mm] x86: Update comment about pgd_list [not found] <20260323-pgd_list-comment-v2-1-77ccf2dc77e8@google.com> 2026-05-11 11:35 ` [PATCH v2] x86: update comment about pgd_list Brendan Jackman @ 2026-05-11 18:27 ` tip-bot2 for Brendan Jackman 1 sibling, 0 replies; 4+ messages in thread From: tip-bot2 for Brendan Jackman @ 2026-05-11 18:27 UTC (permalink / raw) To: linux-tip-commits; +Cc: Brendan Jackman, Dave Hansen, x86, linux-kernel The following commit has been merged into the x86/mm branch of tip: Commit-ID: 952ac097ce98901c608cdced012f89a90367401e Gitweb: https://git.kernel.org/tip/952ac097ce98901c608cdced012f89a90367401e Author: Brendan Jackman <jackmanb@google.com> AuthorDate: Mon, 23 Mar 2026 14:25:07 Committer: Dave Hansen <dave.hansen@linux.intel.com> CommitterDate: Mon, 11 May 2026 11:26:33 -07:00 x86: Update comment about pgd_list This venerable comment got detached from its context when the code moved in commit 394158559d4c ("x86: move all the pgd_list handling to one place"). Put it back next to its context. It was originally on pgd_list_add() but it actually describes pgd_list so put it there. While moving it, update it to strip away stale and superfluous info. pageattr.c doesn't exist any more. pgd_list is now required for all x86 architectures. Also be slightly more precise about what PGDs are in this list. [ dhansen: tweak and trim the updated comment a bit ] Signed-off-by: Brendan Jackman <jackmanb@google.com> Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Link: https://patch.msgid.link/20260323-pgd_list-comment-v2-1-77ccf2dc77e8@google.com --- arch/x86/mm/fault.c | 5 +++++ arch/x86/mm/pgtable.c | 11 ----------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c index 63de8e8..250942e 100644 --- a/arch/x86/mm/fault.c +++ b/arch/x86/mm/fault.c @@ -169,6 +169,11 @@ is_prefetch(struct pt_regs *regs, unsigned long error_code, unsigned long addr) } DEFINE_SPINLOCK(pgd_lock); +/* + * List of all process' PGD pages (excluding init_mm and some other special + * system-wide PGDs). Mainly used to keep the kernel portion of the address + * space in sync across mms. + */ LIST_HEAD(pgd_list); #ifdef CONFIG_X86_32 diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c index da7f0a0..f32facd 100644 --- a/arch/x86/mm/pgtable.c +++ b/arch/x86/mm/pgtable.c @@ -99,17 +99,6 @@ static void pgd_dtor(pgd_t *pgd) spin_unlock(&pgd_lock); } -/* - * List of all pgd's needed for non-PAE so it can invalidate entries - * in both cached and uncached pgd's; not needed for PAE since the - * kernel pmd is shared. If PAE were not to share the pmd a similar - * tactic would be needed. This is essentially codepath-based locking - * against pageattr.c; it is the unique case in which a valid change - * of kernel pagetables can't be lazily synchronized by vmalloc faults. - * vmalloc faults work because attached pagetables are never freed. - * -- nyc - */ - #ifdef CONFIG_X86_PAE /* * In PAE mode, we need to do a cr3 reload (=tlb flush) when ^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-05-11 20:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20260323-pgd_list-comment-v2-1-77ccf2dc77e8@google.com>
2026-05-11 11:35 ` [PATCH v2] x86: update comment about pgd_list Brendan Jackman
2026-05-11 19:49 ` H. Peter Anvin
2026-05-11 20:43 ` Dave Hansen
2026-05-11 18:27 ` [tip: x86/mm] x86: Update " tip-bot2 for Brendan Jackman
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.