public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] microblaze: Fix pfn_valid() for noMMU
@ 2009-11-13 22:08 steve
  2009-11-16 10:12 ` Michal Simek
  2009-11-16 22:14 ` Andrew Morton
  0 siblings, 2 replies; 5+ messages in thread
From: steve @ 2009-11-13 22:08 UTC (permalink / raw)
  To: microblaze-uclinux; +Cc: monstr, linux-kernel, Steven J. Magnani

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 <steve@digidescorp.com>
---
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)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] microblaze: Fix pfn_valid() for noMMU
  2009-11-13 22:08 [PATCH] microblaze: Fix pfn_valid() for noMMU steve
@ 2009-11-16 10:12 ` Michal Simek
  2009-11-16 22:14 ` Andrew Morton
  1 sibling, 0 replies; 5+ messages in thread
From: Michal Simek @ 2009-11-16 10:12 UTC (permalink / raw)
  To: steve; +Cc: microblaze-uclinux, linux-kernel

steve@digidescorp.com 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 <steve@digidescorp.com>

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: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] microblaze: Fix pfn_valid() for noMMU
  2009-11-13 22:08 [PATCH] microblaze: Fix pfn_valid() for noMMU steve
  2009-11-16 10:12 ` Michal Simek
@ 2009-11-16 22:14 ` Andrew Morton
  2009-11-17 14:27   ` Steven J. Magnani
  1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2009-11-16 22:14 UTC (permalink / raw)
  To: steve
  Cc: microblaze-uclinux, monstr, linux-kernel, Chen Liqin, Lennox Wu,
	David Howells, Greg Ungerer

On Fri, 13 Nov 2009 16:08:29 -0600
steve@digidescorp.com 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 <steve@digidescorp.com>
> ---
> 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?



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] microblaze: Fix pfn_valid() for noMMU
  2009-11-16 22:14 ` Andrew Morton
@ 2009-11-17 14:27   ` Steven J. Magnani
  2009-11-18  1:37     ` liqin.chen
  0 siblings, 1 reply; 5+ messages in thread
From: Steven J. Magnani @ 2009-11-17 14:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Chen Liqin, Lennox Wu, David Howells, Greg Ungerer

On Mon, 2009-11-16 at 14:14 -0800, Andrew Morton wrote:
> On Fri, 13 Nov 2009 16:08:29 -0600
> steve@digidescorp.com 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!
 www.digidescorp.com              Earthling, return my space modulator!"

 #include <standard.disclaimer>



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] microblaze: Fix pfn_valid() for noMMU
  2009-11-17 14:27   ` Steven J. Magnani
@ 2009-11-18  1:37     ` liqin.chen
  0 siblings, 0 replies; 5+ messages in thread
From: liqin.chen @ 2009-11-18  1:37 UTC (permalink / raw)
  To: steve; +Cc: Andrew Morton, David Howells, Greg Ungerer, Lennox Wu,
	linux-kernel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="GB2312", Size: 931 bytes --]

"Steven J. Magnani" <steve@digidescorp.com> дÓÚ 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
> > steve@digidescorp.com 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Ç+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-11-18  1:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-13 22:08 [PATCH] microblaze: Fix pfn_valid() for noMMU steve
2009-11-16 10:12 ` Michal Simek
2009-11-16 22:14 ` Andrew Morton
2009-11-17 14:27   ` Steven J. Magnani
2009-11-18  1:37     ` liqin.chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox