[PATCH] x86/32: treat all pfns as low in dump_pagetable before max_low_pfn is set

From: Ian Campbell
Date: Fri Oct 29 2010 - 11:53:45 EST


If we end up calling dump_pagetable before max_low_pfn is set then
currently we always stop after pdpt since low_pfn(...) is always false.

If we are calling dump_pagetable this early then I think it is
reasonably safe to assume all PFNs are low.

In any case if things are going so badly wrong so early on then we
might as well struggle on and print as much of the page table as
possible.

Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: "H. Peter Anvin" <hpa@xxxxxxxxx>
---
arch/x86/mm/fault.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
index 7d90ceb..7a2afc7 100644
--- a/arch/x86/mm/fault.c
+++ b/arch/x86/mm/fault.c
@@ -306,7 +306,7 @@ check_v8086_mode(struct pt_regs *regs, unsigned long address,

static bool low_pfn(unsigned long pfn)
{
- return pfn < max_low_pfn;
+ return !max_low_pfn || pfn < max_low_pfn;
}

static void dump_pagetable(unsigned long address)
--
1.5.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/