linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
@ 2006-04-20 17:24 Geoff Levand
  2006-04-20 17:31 ` David Howells
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Geoff Levand @ 2006-04-20 17:24 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

The procps package needs PAGE_SIZE, defined in asm-powerpc/page.h,
but it is defined inside "#ifdef __KERNEL__".

This moves the PAGE_SIZE definition outside of "#ifdef __KERNEL__".

From: Hiroaki Fuse
Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
---

Index: powerpc.git/include/asm-powerpc/page.h
===================================================================
--- powerpc.git.orig/include/asm-powerpc/page.h	2006-03-19 21:53:29.000000000 -0800
+++ powerpc.git/include/asm-powerpc/page.h	2006-04-19 12:30:04.000000000 -0700
@@ -10,7 +10,6 @@
  * 2 of the License, or (at your option) any later version.
  */

-#ifdef __KERNEL__
 #include <linux/config.h>
 #include <asm/asm-compat.h>

@@ -37,6 +36,7 @@
  */
 #define PAGE_MASK      (~((1 << PAGE_SHIFT) - 1))

+#ifdef __KERNEL__
 /*
  * KERNELBASE is the virtual address of the start of the kernel, it's often
  * the same as PAGE_OFFSET, but _might not be_.

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

* Re: [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
  2006-04-20 17:24 [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__ Geoff Levand
@ 2006-04-20 17:31 ` David Howells
  2006-04-20 17:37 ` Arnd Bergmann
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: David Howells @ 2006-04-20 17:31 UTC (permalink / raw)
  To: Geoff Levand; +Cc: linuxppc-dev, Paul Mackerras

Geoff Levand <geoffrey.levand@am.sony.com> wrote:

> The procps package needs PAGE_SIZE, defined in asm-powerpc/page.h,
> but it is defined inside "#ifdef __KERNEL__".
> 
> This moves the PAGE_SIZE definition outside of "#ifdef __KERNEL__".

Why do you want to do that?  Userspace shouldn't be using PAGE_SIZE directly.

David

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

* Re: [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
  2006-04-20 17:24 [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__ Geoff Levand
  2006-04-20 17:31 ` David Howells
@ 2006-04-20 17:37 ` Arnd Bergmann
  2006-04-20 18:00   ` Geoff Levand
  2006-04-20 20:59 ` Benjamin Herrenschmidt
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2006-04-20 17:37 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras

On Thursday 20 April 2006 19:24, Geoff Levand wrote:
> The procps package needs PAGE_SIZE, defined in asm-powerpc/page.h,
> but it is defined inside "#ifdef __KERNEL__".
> 
> This moves the PAGE_SIZE definition outside of "#ifdef __KERNEL__".
> 
> From: Hiroaki Fuse
> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>

Nack.

It's a little harder unfortunately. First of all, the patch moves
more parts outside of __KERNEL__, like the  #include <linux/config.h>,
which does not get installed into /usr/include/linux/.

More importantly, the page size is no longer constant on powerpc
across kernel builds. User space relying on a fixed size is broken.

Please look into the sysconf(3) and getpagesize(2) man pages for
how to do it correctly.

Which version of procps are you referring to anyway? This bug seems
to have been fixed back in 2001, but maybe it got reintroduced now.

	Arnd <><

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

* Re: [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
  2006-04-20 17:37 ` Arnd Bergmann
@ 2006-04-20 18:00   ` Geoff Levand
  0 siblings, 0 replies; 8+ messages in thread
From: Geoff Levand @ 2006-04-20 18:00 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev, Paul Mackerras

Arnd Bergmann wrote:
> On Thursday 20 April 2006 19:24, Geoff Levand wrote:
>> The procps package needs PAGE_SIZE, defined in asm-powerpc/page.h,
>> but it is defined inside "#ifdef __KERNEL__".
>> 
>> This moves the PAGE_SIZE definition outside of "#ifdef __KERNEL__".
>> 
>> From: Hiroaki Fuse
>> Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com>
> 
> Nack.
> 
> It's a little harder unfortunately. First of all, the patch moves
> more parts outside of __KERNEL__, like the  #include <linux/config.h>,
> which does not get installed into /usr/include/linux/.
> 
> More importantly, the page size is no longer constant on powerpc
> across kernel builds. User space relying on a fixed size is broken.
> 
> Please look into the sysconf(3) and getpagesize(2) man pages for
> how to do it correctly.
> 
> Which version of procps are you referring to anyway? This bug seems
> to have been fixed back in 2001, but maybe it got reintroduced now.
> 

Sorry, procps-2.0.14.  Seems the latest is at procps-3.2.6.  I'll
check it.

-Geoff

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

* Re: [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
  2006-04-20 17:24 [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__ Geoff Levand
  2006-04-20 17:31 ` David Howells
  2006-04-20 17:37 ` Arnd Bergmann
@ 2006-04-20 20:59 ` Benjamin Herrenschmidt
  2006-04-20 23:07 ` Paul Mackerras
  2006-04-21 17:03 ` Christoph Hellwig
  4 siblings, 0 replies; 8+ messages in thread
From: Benjamin Herrenschmidt @ 2006-04-20 20:59 UTC (permalink / raw)
  To: Geoff Levand; +Cc: linuxppc-dev, Paul Mackerras

On Thu, 2006-04-20 at 10:24 -0700, Geoff Levand wrote:
> The procps package needs PAGE_SIZE, defined in asm-powerpc/page.h,
> but it is defined inside "#ifdef __KERNEL__".
> 
> This moves the PAGE_SIZE definition outside of "#ifdef __KERNEL__".

NAK. The procps package is bogus if it needs PAGE_SIZE since it can
change based on a config option...

Ben.

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

* Re: [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
  2006-04-20 17:24 [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__ Geoff Levand
                   ` (2 preceding siblings ...)
  2006-04-20 20:59 ` Benjamin Herrenschmidt
@ 2006-04-20 23:07 ` Paul Mackerras
  2006-04-21 15:23   ` Geoff Levand
  2006-04-21 17:03 ` Christoph Hellwig
  4 siblings, 1 reply; 8+ messages in thread
From: Paul Mackerras @ 2006-04-20 23:07 UTC (permalink / raw)
  To: Geoff Levand; +Cc: linuxppc-dev

Geoff Levand writes:

> The procps package needs PAGE_SIZE, defined in asm-powerpc/page.h,

Ummm... why?  If procps is assuming that the page size of the kernel
it's running on is the same as the page size of the kernel it was
compiled on, it's broken.  It should be using sysconf(PAGE_SIZE) at
runtime.

Paul.

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

* Re: [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
  2006-04-20 23:07 ` Paul Mackerras
@ 2006-04-21 15:23   ` Geoff Levand
  0 siblings, 0 replies; 8+ messages in thread
From: Geoff Levand @ 2006-04-21 15:23 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Paul Mackerras wrote:
> Geoff Levand writes:
> 
>> The procps package needs PAGE_SIZE, defined in asm-powerpc/page.h,
> 
> Ummm... why?  If procps is assuming that the page size of the kernel
> it's running on is the same as the page size of the kernel it was
> compiled on, it's broken.  It should be using sysconf(PAGE_SIZE) at
> runtime.


As it turned out, the procps was out of date, and getting the latest
solved the problem.  Sorry for the trouble.

-Geoff

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

* Re: [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
  2006-04-20 17:24 [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__ Geoff Levand
                   ` (3 preceding siblings ...)
  2006-04-20 23:07 ` Paul Mackerras
@ 2006-04-21 17:03 ` Christoph Hellwig
  4 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2006-04-21 17:03 UTC (permalink / raw)
  To: Geoff Levand; +Cc: linuxppc-dev, Paul Mackerras

On Thu, Apr 20, 2006 at 10:24:10AM -0700, Geoff Levand wrote:
> The procps package needs PAGE_SIZE, defined in asm-powerpc/page.h,
> but it is defined inside "#ifdef __KERNEL__".
> 
> This moves the PAGE_SIZE definition outside of "#ifdef __KERNEL__".

NACK. 

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

end of thread, other threads:[~2006-04-21 17:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-20 17:24 [patch] powerpc: move PAGE_SIZE outside #ifdef __KERNEL__ Geoff Levand
2006-04-20 17:31 ` David Howells
2006-04-20 17:37 ` Arnd Bergmann
2006-04-20 18:00   ` Geoff Levand
2006-04-20 20:59 ` Benjamin Herrenschmidt
2006-04-20 23:07 ` Paul Mackerras
2006-04-21 15:23   ` Geoff Levand
2006-04-21 17:03 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).