]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[S390] nss: Free unused memory in kernel image.
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 21 Feb 2007 09:55:37 +0000 (10:55 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Wed, 21 Feb 2007 09:55:37 +0000 (10:55 +0100)
With CONFIG_SHARED_KERNEL the kernel text segment that might be in a
read only memory sections starts at 1MB. Memory between 0x12000 and
0x100000 is unused then. Free this, so we have appr. an extra MB
of memory available.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/head31.S
arch/s390/kernel/head64.S
arch/s390/kernel/ipl.c
arch/s390/kernel/setup.c
drivers/s390/cio/cio.c
include/asm-s390/sections.h

index 453fd3b4edea6e59d8a2600f43d72af32c43b43f..da7c8bb80982cf66b0428697db07c23227d86d2e 100644 (file)
@@ -148,20 +148,9 @@ startup_continue:
 .Lstartup_init:
            .long startup_init
 
-       .globl ipl_schib
-ipl_schib:
-       .rept 13
-       .long 0
-       .endr
-
-       .globl ipl_flags
-ipl_flags:
-       .long 0
-       .globl ipl_devno
-ipl_devno:
-       .word 0
-
        .org    0x12000
+       .globl  _ehead
+_ehead:
 #ifdef CONFIG_SHARED_KERNEL
        .org    0x100000
 #endif
index b8fec4e5c5d4ac3bd5e8da5b527901445ee78542..af09e18cc5d0c0fb289d1fa75cabdce203c2a330 100644 (file)
@@ -154,21 +154,9 @@ startup_continue:
 .Lparmaddr:
        .quad   PARMAREA
 
-       .globl  ipl_schib
-ipl_schib:
-       .rept 13
-       .long 0
-       .endr
-
-       .globl  ipl_flags
-ipl_flags:
-       .long   0
-       .globl  ipl_devno
-ipl_devno:
-       .word 0
-
        .org    0x12000
-
+       .globl  _ehead
+_ehead:
 #ifdef CONFIG_SHARED_KERNEL
        .org    0x100000
 #endif
index ee6826a52d26faf25f0153abcf9409821b7fc196..5a863a3bf10c92279da2e80e525f3ae005536509 100644 (file)
@@ -43,6 +43,13 @@ enum ipl_type {
 #define IPL_FCP_STR     "fcp"
 #define IPL_NSS_STR     "nss"
 
+/*
+ * Must be in data section since the bss section
+ * is not cleared when these are accessed.
+ */
+u16 ipl_devno __attribute__((__section__(".data"))) = 0;
+u32 ipl_flags __attribute__((__section__(".data"))) = 0;
+
 static char *ipl_type_str(enum ipl_type type)
 {
        switch (type) {
index fced022dc58d0184aec74803eff22e7f70986e01..863c8d08c02694815ecb611d03292c7aba160262 100644 (file)
@@ -690,8 +690,13 @@ setup_memory(void)
        psw_set_key(PAGE_DEFAULT_KEY);
 
        free_bootmem_with_active_regions(0, max_pfn);
-       reserve_bootmem(0, PFN_PHYS(start_pfn));
 
+       /*
+        * Reserve memory used for lowcore/command line/kernel image.
+        */
+       reserve_bootmem(0, (unsigned long)_ehead);
+       reserve_bootmem((unsigned long)_stext,
+                       PFN_PHYS(start_pfn) - (unsigned long)_stext);
        /*
         * Reserve the bootmem bitmap itself as well. We do this in two
         * steps (first step was init_bootmem()) because this catches
index e4471e6ee5d9e2390b135620e23865ceabb144d4..9cb129ab5be5092ae421b7f104a39cbb48ff9ec9 100644 (file)
@@ -1048,7 +1048,7 @@ void reipl_ccw_dev(struct ccw_dev_id *devid)
        do_reipl_asm(*((__u32*)&schid));
 }
 
-extern struct schib ipl_schib;
+static struct schib __initdata ipl_schib;
 
 /*
  * ipl_save_parameters gets called very early. It is not allowed to access
index 1c5a2c4ccdad29af3ccb5c0ed4436b79522cf128..fbd9116eb17bf2c73d80952af2108eecdf4db1ed 100644 (file)
@@ -3,6 +3,6 @@
 
 #include <asm-generic/sections.h>
 
-extern char _eshared[];
+extern char _eshared[], _ehead[];
 
 #endif