aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2007-02-21 10:55:37 +0100
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2007-02-21 10:55:37 +0100
commit615b04b301fd4e1b7680a498b873c4ae9baad92f (patch)
tree8f6ad0f048507858cfbdfef3f2dee5c7cffe3bbe /arch/s390/kernel
parent[S390] bss section clearing. (diff)
downloadlinux-dev-615b04b301fd4e1b7680a498b873c4ae9baad92f.tar.xz
linux-dev-615b04b301fd4e1b7680a498b873c4ae9baad92f.zip
[S390] nss: Free unused memory in kernel image.
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>
Diffstat (limited to 'arch/s390/kernel')
-rw-r--r--arch/s390/kernel/head31.S15
-rw-r--r--arch/s390/kernel/head64.S16
-rw-r--r--arch/s390/kernel/ipl.c7
-rw-r--r--arch/s390/kernel/setup.c7
4 files changed, 17 insertions, 28 deletions
diff --git a/arch/s390/kernel/head31.S b/arch/s390/kernel/head31.S
index 453fd3b4edea..da7c8bb80982 100644
--- a/arch/s390/kernel/head31.S
+++ b/arch/s390/kernel/head31.S
@@ -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
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
index b8fec4e5c5d4..af09e18cc5d0 100644
--- a/arch/s390/kernel/head64.S
+++ b/arch/s390/kernel/head64.S
@@ -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
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
index ee6826a52d26..5a863a3bf10c 100644
--- a/arch/s390/kernel/ipl.c
+++ b/arch/s390/kernel/ipl.c
@@ -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) {
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index fced022dc58d..863c8d08c026 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -690,9 +690,14 @@ 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
* the (very unlikely) case of us accidentally initializing the