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().
Signed-off-by: Steven J. Magnani <[email protected]>
---
diff -uprN a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
--- a/arch/microblaze/include/asm/page.h 2009-09-09 17:13:59.000000000 -0500
+++ b/arch/microblaze/include/asm/page.h 2009-11-13 15:20:26.000000000 -0600
@@ -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)
[email protected] wrote:
> 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().
>
> Signed-off-by: Steven J. Magnani <[email protected]>
Added to next branch.
Thanks,
Michal
> ---
> diff -uprN a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
> --- a/arch/microblaze/include/asm/page.h 2009-09-09 17:13:59.000000000 -0500
> +++ b/arch/microblaze/include/asm/page.h 2009-11-13 15:20:26.000000000 -0600
> @@ -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, Ing. (M.Eng)
w: http://www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
On Fri, 13 Nov 2009 16:08:29 -0600
[email protected] wrote:
> 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().
>
> Signed-off-by: Steven J. Magnani <[email protected]>
> ---
> diff -uprN a/arch/microblaze/include/asm/page.h b/arch/microblaze/include/asm/page.h
> --- a/arch/microblaze/include/asm/page.h 2009-09-09 17:13:59.000000000 -0500
> +++ b/arch/microblaze/include/asm/page.h 2009-11-13 15:20:26.000000000 -0600
> @@ -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?
On Mon, 2009-11-16 at 14:14 -0800, Andrew Morton wrote:
> On Fri, 13 Nov 2009 16:08:29 -0600
> [email protected] wrote:
>
> > 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().
> >
> > ...
> Is arch/score/include/asm/page.h buggy 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!
http://www.digidescorp.com Earthling, return my space modulator!"
#include <standard.disclaimer>
"Steven J. Magnani" <[email protected]> д?? 2009-11-17 22:27:54:
> On Mon, 2009-11-16 at 14:14 -0800, Andrew Morton wrote:
> > On Fri, 13 Nov 2009 16:08:29 -0600
> > [email protected] wrote:
> >
> > > 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().
> > >
> > > ...
> > Is arch/score/include/asm/page.h buggy also?
> >
>
> I don't believe so, but only because MEMORY_START is defined as zero for
> that arch, making min_low_pfn zero.
>
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?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m????????????I?