There were inputs from linuxppc dev mailing to my previous
posting [ kernel patch ] on this issue. It was suggested to create
a 64k buffer [ instead of current 32k ] for backup region
irrespective of page size.

Here is an updated patch [ kernel patch posted separately to
linuxppc-dev mailing list ] to add 64 k page size support to
kexec-tools on powerpc. It also replaces PAGE_SIZE with
getpagesize( )  call.


* kexec-tools for PPC64 only support 4k page size and does not work with kernels
  configured with 64k page size support. This patch adds support for 64k page
  size on PPC64 arch.
* Replace PAGE_SIZE by getpagesize()

Signed-off-by: Sachin Sant <[EMAIL PROTECTED]>
---


diff -Naurp a/kexec/arch/ppc64/crashdump-ppc64.c 
b/kexec/arch/ppc64/crashdump-ppc64.c
--- a/kexec/arch/ppc64/crashdump-ppc64.c        2006-09-08 06:54:56.000000000 
+0530
+++ b/kexec/arch/ppc64/crashdump-ppc64.c        2006-09-08 06:58:34.000000000 
+0530
@@ -20,6 +20,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <errno.h>
 #include <limits.h>
 #include <elf.h>
@@ -80,8 +81,8 @@ static int get_crash_memory_ranges(struc
        unsigned long long start, end, cstart, cend;
 
        /* create a separate program header for the backup region */
-       crash_memory_range[0].start = 0x0000000000000000;
-       crash_memory_range[0].end = 0x0000000000008000;
+       crash_memory_range[0].start = BACKUP_SRC_START;
+       crash_memory_range[0].end = BACKUP_SRC_END;
        crash_memory_range[0].type = RANGE_RAM;
        memory_ranges++;
 
@@ -126,8 +127,8 @@ static int get_crash_memory_ranges(struc
 
                        start = ((unsigned long long *)buf)[0];
                        end = start + ((unsigned long long *)buf)[1];
-                       if (start == 0 && end >= 0x8000)
-                               start = 0x8000;
+                       if (start == 0 && end >= BACKUP_SRC_END)
+                               start = BACKUP_SRC_END;
 
                        cstart = crash_base;
                        cend = crash_base + crash_size;
@@ -419,8 +420,8 @@ void add_usable_mem_rgns(unsigned long l
        unsigned long long end = base + size;
        unsigned long long ustart, uend;
 
-       base = _ALIGN_DOWN(base, PAGE_SIZE);
-       end = _ALIGN_UP(end, PAGE_SIZE);
+       base = _ALIGN_DOWN(base, getpagesize());
+       end = _ALIGN_UP(end, getpagesize());
 
        for (i=0; i < usablemem_rgns.size; i++) {
                ustart = usablemem_rgns.ranges[i].start;
diff -Naurp a/kexec/arch/ppc64/crashdump-ppc64.h 
b/kexec/arch/ppc64/crashdump-ppc64.h
--- a/kexec/arch/ppc64/crashdump-ppc64.h        2006-09-08 06:54:56.000000000 
+0530
+++ b/kexec/arch/ppc64/crashdump-ppc64.h        2006-09-08 22:49:12.000000000 
+0530
@@ -6,28 +6,24 @@ int load_crashdump_segments(struct kexec
                                unsigned long max_addr, unsigned long min_base);
 void add_usable_mem_rgns(unsigned long long base, unsigned long long size);
 
-#define PAGE_OFFSET      0xC000000000000000
+#define PAGE_OFFSET     0xC000000000000000
 #define KERNELBASE      PAGE_OFFSET
 #define VMALLOCBASE     0xD000000000000000
 
 #define __pa(x)         ((unsigned long)(x)-PAGE_OFFSET)
-
-#define MAXMEM                  (-KERNELBASE-VMALLOCBASE)
+#define MAXMEM          (-KERNELBASE-VMALLOCBASE)
 
 #define CRASH_MAX_MEMORY_RANGES (MAX_MEMORY_RANGES + 6)
 
 #define COMMAND_LINE_SIZE       512 /* from kernel */
-/* Backup Region, First 32K of System RAM. */
+/* Backup Region, First 64K of System RAM. */
 #define BACKUP_SRC_START    0x0000
-#define BACKUP_SRC_END      0x8000
+#define BACKUP_SRC_END      0x10000
 #define BACKUP_SRC_SIZE     (BACKUP_SRC_END - BACKUP_SRC_START + 1)
 
-#define KDUMP_BACKUP_LIMIT      0x8000
-#define _ALIGN_UP(addr,size)     (((addr)+((size)-1))&(~((size)-1)))
-#define _ALIGN_DOWN(addr,size)   ((addr)&(~((size)-1)))
-#ifndef PAGE_SIZE
-#define PAGE_SIZE      4096
-#endif
+#define KDUMP_BACKUP_LIMIT     BACKUP_SRC_END
+#define _ALIGN_UP(addr,size)   (((addr)+((size)-1))&(~((size)-1)))
+#define _ALIGN_DOWN(addr,size) ((addr)&(~((size)-1)))
 
 extern unsigned long long crash_base;
 extern unsigned long long crash_size;
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to