[Cbe-oss-dev] CONFIG_DEBUG_PAGE_ALLOC on ps3
Geoff Levand
geoffrey.levand at am.sony.com
Thu Jul 3 02:54:38 EST 2008
Hi,
Sascha Sommer wrote:
> I wonder if CONFIG_DEBUG_PAGE_ALLOC is supposed to work on the playstation3?
>
> Last time I tryed it with some 2.6.26 git kernel from
> http://git.kernel.org/?p=linux/kernel/git/geoff/ps3-linux.git;a=summary
> the system crashed during boot.
CONFIG_DEBUG_PAGE_ALLOC does not work on PS3.
To date, the PS3's hypervisor allocates 128 MiB of boot mem starting at
lpar address zero for the other OS partition, and then makes additional
hotplug memory available at high lpar addresses, typically around
6000_0000_0000h and 7000_0000_0000h. You can see this output with the
patch below.
ps3_mm_region_create:254 requested 7800000h
ps3_mm_region_create:255 actual 7000000h
ps3_mm_region_create:258 difference 800000h (8MB)
ps3_mm_vas_create:213: map.total = f800000h
ps3_mm_vas_create:213: map.rm.size = 8000000h
ps3_mm_vas_create:213: map.vas_id = 11
ps3_mm_vas_create:213: map.htab_size = 100000h
ps3_mm_vas_create:213: map.r1.base = 6c0060000000h
ps3_mm_vas_create:213: map.r1.offset = 6c0058000000h
ps3_mm_vas_create:213: map.r1.size = 7000000h
Currently, the Linux kernel doesn't support this kind of memory layout,
with big gaps between memory regions, so the PS3 platform code does its
own translation to map the high mem (r1) to lower addresses. I arranged
it so r1.base is translated to the top of the boot mem:
unsigned long ps3_mm_phys_to_lpar(unsigned long phys_addr)
{
return (phys_addr < map.rm.size || phys_addr >= map.total)
? phys_addr : phys_addr + map.r1.offset;
}
The translation of addresses from the r1 region does not work with
CONFIG_DEBUG_PAGE_ALLOC, and that is what causes the kernel to hang.
I would like to re-work some of the ps3 memory management code, and
can look into supporting CONFIG_DEBUG_PAGE_ALLOC at that time, but
it is now a low priority item for me, so I don't know when I'll get to
it.
-Geoff
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c
index c16f3da..4f8cb47 100644
--- a/arch/powerpc/platforms/ps3/mm.c
+++ b/arch/powerpc/platforms/ps3/mm.c
@@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#define DEBUG
#include <linux/kernel.h>
#include <linux/module.h>
@@ -31,7 +32,7 @@
#include "platform.h"
#if defined(DEBUG)
-#define DBG udbg_printf
+#define DBG printf
#else
#define DBG pr_debug
#endif
More information about the cbe-oss-dev
mailing list