microblaze: Fix pfn_valid() for noMMU
PATCH 1/1 microblaze: Fix pfn_valid() for noMMU
Configuring DEBUG_SLAB causes a noMMU kernel to die during initialization with an invalid virtual address panic in kfree_debugcheck(). The panic is due to an improper definition of pfn_valid().
---
arch/microblaze/include/asm/page.h +2 -1
@@ -161,7 +161,8 @@ extern int page_is_ram(unsigned long pfn# endif /* CONFIG_MMU */ # ifndef CONFIG_MMU -# define pfn_valid (pfn) ((pfn) >= min_low_pfn && (pfn) <= max_mapnr) +# define pfn_valid (pfn) (((pfn) >= min_low_pfn) && \ + ((pfn) <= (min_low_pfn + max_mapnr)))# define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)# else /* CONFIG_MMU */ # define ARCH_PFN_OFFSET (memory_start >> PAGE_SHIFT)
Michal Simek
maintainerQuoted 5 lines · [email protected] wrote:
Configuring
DEBUG_SLABcauses a noMMU kernel to die during initialization with an invalid virtual address panic inkfree_debugcheck(). The panic is due to an improper definition ofpfn_valid().Signed-off-by Steven J. Magnani <[email protected]>
Added to next branch.
Thanks,
Michal
Quoted 15 lines
---
diff -uprNa/arch/microblaze/include/asm/page.hb/arch/microblaze/include/asm/page.harch/microblaze/include/asm/page.h +2
-1@@ -161,7 +161,8 @@ extern int page_is_ram(unsigned long pfn# endif /* CONFIG_MMU */ # ifndef CONFIG_MMU -# define pfn_valid (pfn) ((pfn) >= min_low_pfn && (pfn) <= max_mapnr) +# define pfn_valid (pfn) (((pfn) >= min_low_pfn) && \ + ((pfn) <= (min_low_pfn + max_mapnr)))# define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)# else /* CONFIG_MMU */ # define ARCH_PFN_OFFSET (memory_start >> PAGE_SHIFT)
Signature · 4 lines
Michal Simek, Ing. (M.Eng) w: www.monstr.eu p: +42-0-721842854 Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/ Microblaze U-BOOT custodian
Quoted 10 lines · On Fri, 13 Nov 2009 16:08:29 -0600 [email protected] wrote:
Configuring
DEBUG_SLABcauses a noMMU kernel to die during initialization with an invalid virtual address panic inkfree_debugcheck(). The panic is due to an improper definition ofpfn_valid().Signed-off-by Steven J. Magnani <[email protected]>---
diff -uprNa/arch/microblaze/include/asm/page.hb/arch/microblaze/include/asm/page.h
arch/microblaze/include/asm/page.h extern int page_is_ram(unsigned long pfn · line 168
Quoted 9 lines
arch/microblaze/include/asm/page.h +2
-1@@ -161,7 +161,8 @@ extern int page_is_ram(unsigned long pfn# endif /* CONFIG_MMU */ # ifndef CONFIG_MMU -# define pfn_valid (pfn) ((pfn) >= min_low_pfn && (pfn) <= max_mapnr) +# define pfn_valid (pfn) (((pfn) >= min_low_pfn) && \ + ((pfn) <= (min_low_pfn + max_mapnr)))# define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)# else /* CONFIG_MMU */ # define ARCH_PFN_OFFSET (memory_start >> PAGE_SHIFT)
Is arch/score/include/asm/page.h buggy also?
Quoted 10 lines · Andrew Morton
Quoted 5 lines · On Fri, 13 Nov 2009 16:08:29 -0600 [email protected] wrote:
Configuring
DEBUG_SLABcauses a noMMU kernel to die during initialization with an invalid virtual address panic inkfree_debugcheck(). The panic is due to an improper definition ofpfn_valid()....
Is
arch/score/include/asm/page.hbuggy also?
I don't believe so, but only because MEMORY_START is defined as zero for that arch, making min_low_pfn zero.
------------------------------------------------------------------------
Steven J. Magnani "I claim this network for MARS!
www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
"Steven J. Magnani" <[email protected]> 写于 2009-11-17 22:27:54:
Quoted 5 lines · Andrew Morton
Quoted 4 lines
Quoted 1 line · On Fri, 13 Nov 2009 16:08:29 -0600 [email protected] wrote:
Configuring
DEBUG_SLABcauses a noMMU kernel to die during
initialization
Quoted 10 lines
Quoted 6 lines
Quoted 4 lines
with an invalid virtual address panic in
kfree_debugcheck(). The panic is due to an improper definition ofpfn_valid()....
Is
arch/score/include/asm/page.hbuggy also?I don't believe so, but only because
MEMORY_STARTis defined as zero for that arch, makingmin_low_pfnzero.
Yes, it's right because MEMORY_START is defined as 0, make min_low_pfn to zero and max_mapnr equal max_low_pfn.
We will fix it to make code more clear.
liqin
�翳簕.n�+壏煯壄�+%娝�遍荻w�簕.n�+壏{炳G珴�妠ay�蕠跈�,jf"穐殢飦�戧鐉_璁(殠娸"濟�m���G珴�⒏?櫒璀�&x忈秈O曟瑉窔v豝�m����鹅�⒏?朓�