powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
PATCH 1/1 powerpc: move PAGE_SIZE outside #ifdef __KERNEL__
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
---
include/asm-powerpc/page.h +1 -1
@@ -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_.
Quoted 4 lines · Geoff Levand
The procps package needs
PAGE_SIZE, defined inasm-powerpc/page.h, but it is defined inside "#ifdef__KERNEL__".This moves the
PAGE_SIZEdefinition outside of "#ifdef__KERNEL__".
Why do you want to do that? Userspace shouldn't be using PAGE_SIZE directly.
David
Arnd Bergmann
NAKQuoted 7 lines · Geoff Levand
The procps package needs
PAGE_SIZE, defined inasm-powerpc/page.h, but it is defined inside "#ifdef__KERNEL__".This moves the
PAGE_SIZEdefinition outside of "#ifdef__KERNEL__".From: Hiroaki Fuse
Signed-off-by Geoff Levand <[email protected]>
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 <><
Quoted 15 lines · Arnd Bergmann
Quoted 7 lines · Geoff Levand
The procps package needs
PAGE_SIZE, defined inasm-powerpc/page.h, but it is defined inside "#ifdef__KERNEL__".This moves the
PAGE_SIZEdefinition outside of "#ifdef__KERNEL__".From: Hiroaki Fuse
Signed-off-by Geoff Levand <[email protected]>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/.
Quoted 9 lines
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
Quoted 4 lines · Geoff Levand
The procps package needs
PAGE_SIZE, defined inasm-powerpc/page.h, but it is defined inside "#ifdef__KERNEL__".This moves the
PAGE_SIZEdefinition 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.
Quoted 1 line · Geoff Levand
The procps package needs
PAGE_SIZE, defined inasm-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.
Quoted 8 lines · Paul Mackerras
Quoted 1 line · Geoff Levand
The procps package needs
PAGE_SIZE, defined inasm-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
Quoted 4 lines · Geoff Levand
The procps package needs
PAGE_SIZE, defined inasm-powerpc/page.h, but it is defined inside "#ifdef__KERNEL__".This moves the
PAGE_SIZEdefinition outside of "#ifdef__KERNEL__".
NACK.