diff options
author | Yinghai Lu <yinghai@kernel.org> | 2010-12-27 19:48:32 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-01-05 08:03:45 -0500 |
commit | f005fe12b90c5b9fe180a09209a893e09affa8aa (patch) | |
tree | f5544ae1780be20c0f6fdef51dd37eee4dc8c7af /arch/x86/kernel/setup.c | |
parent | 1411e0ec3123ae4c4ead6bfc9fe3ee5a3ae5c327 (diff) |
x86-64: Move out cleanup higmap [_brk_end, _end) out of init_memory_mapping()
It is not related to init_memory_mapping(), and init_memory_mapping() is
getting more bigger.
So make it as seperated function and call it from reserve_brk() and that is
point when _brk_end is concluded.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <4D1933E0.7090305@kernel.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/kernel/setup.c')
-rw-r--r-- | arch/x86/kernel/setup.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index fc0fe743f3a1..635185ba4435 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -293,10 +293,32 @@ static void __init init_gbpages(void) | |||
293 | else | 293 | else |
294 | direct_gbpages = 0; | 294 | direct_gbpages = 0; |
295 | } | 295 | } |
296 | |||
297 | static void __init cleanup_highmap_brk_end(void) | ||
298 | { | ||
299 | pud_t *pud; | ||
300 | pmd_t *pmd; | ||
301 | |||
302 | mmu_cr4_features = read_cr4(); | ||
303 | |||
304 | /* | ||
305 | * _brk_end cannot change anymore, but it and _end may be | ||
306 | * located on different 2M pages. cleanup_highmap(), however, | ||
307 | * can only consider _end when it runs, so destroy any | ||
308 | * mappings beyond _brk_end here. | ||
309 | */ | ||
310 | pud = pud_offset(pgd_offset_k(_brk_end), _brk_end); | ||
311 | pmd = pmd_offset(pud, _brk_end - 1); | ||
312 | while (++pmd <= pmd_offset(pud, (unsigned long)_end - 1)) | ||
313 | pmd_clear(pmd); | ||
314 | } | ||
296 | #else | 315 | #else |
297 | static inline void init_gbpages(void) | 316 | static inline void init_gbpages(void) |
298 | { | 317 | { |
299 | } | 318 | } |
319 | static inline void cleanup_highmap_brk_end(void) | ||
320 | { | ||
321 | } | ||
300 | #endif | 322 | #endif |
301 | 323 | ||
302 | static void __init reserve_brk(void) | 324 | static void __init reserve_brk(void) |
@@ -307,6 +329,8 @@ static void __init reserve_brk(void) | |||
307 | /* Mark brk area as locked down and no longer taking any | 329 | /* Mark brk area as locked down and no longer taking any |
308 | new allocations */ | 330 | new allocations */ |
309 | _brk_start = 0; | 331 | _brk_start = 0; |
332 | |||
333 | cleanup_highmap_brk_end(); | ||
310 | } | 334 | } |
311 | 335 | ||
312 | #ifdef CONFIG_BLK_DEV_INITRD | 336 | #ifdef CONFIG_BLK_DEV_INITRD |