pgd_none_or_clear_bad strangeness?

Previous thread: Point of gpl-only modules (flame) by Jimmy on Tuesday, October 2, 2007 - 5:49 pm. (6 messages)

Next thread: Announce: hardware4linux.info by Frederic Lepied on Tuesday, October 2, 2007 - 5:53 pm. (1 message)
To: Nick Piggin <npiggin@...>, Hugh Dickins <hugh@...>
Cc: linux-kernel <linux-kernel@...>
Date: Tuesday, October 2, 2007 - 6:20 pm

In lib/pagewalk.c, I've been using the various forms of
{pgd,pud,pmd}_none_or_clear_bad while walking page tables as that
seemed the canonical way to do things. Lately (eg with -rc7-mm1),
these have been triggering messages like "bad pgd 0x01e3" and causing
nasty double faults. It appears this is actually triggered at the pmd
level (mm/memory.c:116), though it appears to produce the wrong
message.

Has something changed here? I'm pretty sure this used to work! Is this
not a kosher thing to do? Does it make any sense I'd repeatedly run
into a bad pmd in the middle of bash's page table right after boot?
The simple _none variant seems to work, but I worry that it's papering
over a real problem.

--
Mathematics is the supreme nostalgia of our time.
-

To: Matt Mackall <mpm@...>
Cc: Hugh Dickins <hugh@...>, linux-kernel <linux-kernel@...>
Date: Wednesday, October 3, 2007 - 7:25 am

No, I think that should be the right thing to do for userspace pages.
You're not walking into a hugetlb area or a kernel mapping are you?
(the bad pgd: line could be important... 0x01e3 would be a linear kernel
mapping I think?).

-

To: Matt Mackall <mpm@...>
Cc: Nick Piggin <npiggin@...>, linux-kernel <linux-kernel@...>
Date: Wednesday, October 3, 2007 - 2:18 pm

I guess the "wrong message" is an artifact of pud/pmd folding;
but I get too confused by the different levels myself to want to

I should have spent more time reading Nick's reply and less time trying
to work it out for myself! Yes, that's the conclusion I came to, for
some reason you're now going beyond the user vmas and walking into the
linear kernel mapping, which has _PAGE_GLOBAL and _PAGE_PSE bits set.

Hugh
-

To: Hugh Dickins <hugh@...>
Cc: Nick Piggin <npiggin@...>, linux-kernel <linux-kernel@...>
Date: Wednesday, October 3, 2007 - 5:31 pm

Indeed, that's precisely what's happening. I'm walking one page past
the end of userspace.

And the reason is I changed my walker from using for loops to do/while
loops at Nick's insistance, so start==end no longer gets noticed
immediately. This also explains why the bug doesn't manifest in
lguest: no PSE mappings.

Thanks, guys!

--
Mathematics is the supreme nostalgia of our time.
-

Previous thread: Point of gpl-only modules (flame) by Jimmy on Tuesday, October 2, 2007 - 5:49 pm. (6 messages)

Next thread: Announce: hardware4linux.info by Frederic Lepied on Tuesday, October 2, 2007 - 5:53 pm. (1 message)