linux/arch/mips/mm
Kevin Cernekee b6da0ffb09 MIPS: pfn_valid() is broken on low memory HIGHMEM systems
pfn_valid() compares the PFN to max_mapnr:

        __pfn >= min_low_pfn && __pfn < max_mapnr;

On HIGHMEM kernels, highend_pfn is used to set the value of max_mapnr.
Unfortunately, highend_pfn is left at zero if the system does not
actually have enough RAM to reach into the HIGHMEM range.  This causes
pfn_valid() to always return false, and when debug checks are enabled
the kernel will fail catastrophically:

Memory: 22432k/32768k available (2249k kernel code, 10336k reserved, 653k data, 1352k init, 0k highmem)
NR_IRQS:128
kfree_debugcheck: out of range ptr 81c02900h.
Kernel bug detected[#1]:
Cpu 0
$ 0   : 00000000 10008400 00000034 00000000
$ 4   : 8003e160 802a0000 8003e160 00000000
$ 8   : 00000000 0000003e 00000747 00000747
...

On such a configuration, max_low_pfn should be used to set max_mapnr.

This was seen on 2.6.34.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
To: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/1992/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
2011-07-25 17:26:52 +01:00
..
c-octeon.c MIPS: Octeon: Handle Octeon II caches. 2010-10-29 19:08:36 +01:00
c-r3k.c update David Miller's old email address 2011-04-06 06:19:38 -07:00
c-r4k.c Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2011-05-23 09:12:26 -07:00
c-tx39.c update David Miller's old email address 2011-04-06 06:19:38 -07:00
cache.c MIPS: Fix __vmalloc() etc. on MIPS for non-GPL modules 2010-04-12 17:26:21 +01:00
cerr-sb1.c MIPS: Sibyte: Use hweight8 instead of counting bits 2009-12-17 01:57:16 +00:00
cex-gen.S
cex-oct.S MIPS: Add Cavium OCTEON processor support files to arch/mips/cavium-octeon. 2009-01-11 09:57:21 +00:00
cex-sb1.S Fix common misspellings 2011-03-31 11:26:23 -03:00
dma-default.c MIPS: HIGHMEM DMA on noncoherent MIPS32 processors 2011-07-25 17:26:52 +01:00
extable.c MIPS: Eleminate filenames from comments 2009-08-03 17:52:40 +01:00
fault.c MIPS: add support for software performance events 2010-10-29 19:08:48 +01:00
highmem.c mm: fix race in kunmap_atomic() 2010-10-27 18:03:05 -07:00
hugetlbpage.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
init.c MIPS: pfn_valid() is broken on low memory HIGHMEM systems 2011-07-25 17:26:52 +01:00
ioremap.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00
Makefile MIPS: Move arch_get_unmapped_area and gang to new file. 2011-05-19 09:55:49 +01:00
mmap.c MIPS: topdown mmap support 2011-07-25 17:26:51 +01:00
page.c MIPS: Move arch/mips/mm/uasm.h to arch/mips/include/asm/uasm.h 2010-02-27 12:53:19 +01:00
pgtable-32.c [MIPS] Add external declaration of pagetable_init() to pgalloc.h 2007-02-18 21:31:36 +00:00
pgtable-64.c MIPS: Two-level pagetables for 64-bit kernels with 64KB pages. 2010-02-27 12:53:03 +01:00
sc-ip22.c update David Miller's old email address 2011-04-06 06:19:38 -07:00
sc-mips.c MIPS: Fix build errors in sc-mips.c 2010-12-17 19:44:35 +00:00
sc-r5k.c update David Miller's old email address 2011-04-06 06:19:38 -07:00
sc-rm7k.c MIPS: RM7000: Symbol should be static 2010-10-04 18:33:54 +01:00
tlb-r3k.c update David Miller's old email address 2011-04-06 06:19:38 -07:00
tlb-r4k.c update David Miller's old email address 2011-04-06 06:19:38 -07:00
tlb-r8k.c update David Miller's old email address 2011-04-06 06:19:38 -07:00
tlbex-fault.S [MIPS] Stacktrace build-fix and improvement 2006-10-01 23:16:58 +01:00
tlbex.c MIPS: Netlogic: Cache, TLB support and feature overrides for XLR 2011-05-19 09:55:40 +01:00
uasm.c MIPS: Use WARN() in uasm for better diagnostics. 2011-01-18 19:30:24 +01:00