diff options
author | Michael Holzheu <holzheu@linux.vnet.ibm.com> | 2011-10-30 10:16:44 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2011-10-30 10:16:42 -0400 |
commit | dab7a7b1538fec48790a321a58180adae79a3f3c (patch) | |
tree | 145614bdf89a106508cec17bd6f13e6686ffed07 /arch/s390/kernel/machine_kexec.c | |
parent | 558df7209e7997275f6b8ad37737494cf2da1512 (diff) |
[S390] Add architecture code for unmapping crashkernel memory
This patch implements the crash_map_pages() function for s390.
KEXEC_CRASH_MEM_ALIGN is set to HPAGE_SIZE, in order to support
kernel mappings that use large pages. We also use HPAGE_SIZE alignment
for CONFIG_HUGETLB_PAGE=n in order to have the same 1 MiB alignment on
all s390 systems.
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/machine_kexec.c')
-rw-r--r-- | arch/s390/kernel/machine_kexec.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c index 0ceac06a029..13a0b528c70 100644 --- a/arch/s390/kernel/machine_kexec.c +++ b/arch/s390/kernel/machine_kexec.c | |||
@@ -133,6 +133,37 @@ static int kdump_csum_valid(struct kimage *image) | |||
133 | } | 133 | } |
134 | 134 | ||
135 | /* | 135 | /* |
136 | * Map or unmap crashkernel memory | ||
137 | */ | ||
138 | static void crash_map_pages(int enable) | ||
139 | { | ||
140 | unsigned long size = resource_size(&crashk_res); | ||
141 | |||
142 | BUG_ON(crashk_res.start % KEXEC_CRASH_MEM_ALIGN || | ||
143 | size % KEXEC_CRASH_MEM_ALIGN); | ||
144 | if (enable) | ||
145 | vmem_add_mapping(crashk_res.start, size); | ||
146 | else | ||
147 | vmem_remove_mapping(crashk_res.start, size); | ||
148 | } | ||
149 | |||
150 | /* | ||
151 | * Map crashkernel memory | ||
152 | */ | ||
153 | void crash_map_reserved_pages(void) | ||
154 | { | ||
155 | crash_map_pages(1); | ||
156 | } | ||
157 | |||
158 | /* | ||
159 | * Unmap crashkernel memory | ||
160 | */ | ||
161 | void crash_unmap_reserved_pages(void) | ||
162 | { | ||
163 | crash_map_pages(0); | ||
164 | } | ||
165 | |||
166 | /* | ||
136 | * Give back memory to hypervisor before new kdump is loaded | 167 | * Give back memory to hypervisor before new kdump is loaded |
137 | */ | 168 | */ |
138 | static int machine_kexec_prepare_kdump(void) | 169 | static int machine_kexec_prepare_kdump(void) |