Thread (5 messages) 5 messages, 3 authors, 2021-06-28

Re: [PATCH v3] mm: pagewalk: Fix walk for hugepage tables

From: Christophe Leroy <hidden>
Date: 2021-06-28 05:56:33
Also in: linux-arch, linuxppc-dev, lkml


Le 28/06/2021 à 03:12, Andrew Morton a écrit :
On Fri, 25 Jun 2021 05:10:12 +0000 (UTC) Christophe Leroy [off-list ref] wrote:
quoted
Pagewalk ignores hugepd entries and walk down the tables
as if it was traditionnal entries, leading to crazy result.

Add walk_hugepd_range() and use it to walk hugepage tables.
More details, please?  I assume "crazy result" is userspace visible?
For how long has this bug existed?  Is a -stable backport needed?  Has
a Fixes: commit been identified?  etcetera!
I discovered the problem while porting powerpc to generic page table dump.
The generic page table dump uses walk_page_range_novma() .

Yes, "crazy result" is that when dumping /sys/kernel/debug/kernel_page_tables, you get random 
entries because at the time being the pagewalk code sees huge page directories as standard page tables.

The bug has always existed as far as I can see, but as no other architectures than powerpc use huge 
page directories, it only pops up now when powerpc is trying to use that generic page walking code.

So I don't think it is worth a backport to -stable, and about a Fixes: tag I don't know.

IIUC, hugepd was introduced for the first time in mm by commit cbd34da7dc9a ("mm: move the powerpc 
hugepd code to mm/gup.c")

Before that, hugepd was internal to powerpc.

I guess you are asking about Fixes: tag and backporting because of the patch subject.
Should I reword the page subject to something like "mm: enable the generic page walk code to walk 
huge page directories" ?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help