[PATCH] x86: extend e820 early_res support 32bit -fix #5

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Ingo Molnar <mingo@...>, Thomas Gleixner <tglx@...>, H. Peter Anvin <hpa@...>, Andrew Morton <akpm@...>, Jeremy Fitzhardinge <jeremy@...>
Cc: linux-kernel@vger.kernel.org <linux-kernel@...>
Date: Thursday, May 29, 2008 - 3:58 pm

reserve early numa kva, so it will not clash with new RAMDISK

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

Index: linux-2.6/arch/x86/kernel/setup_32.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup_32.c
+++ linux-2.6/arch/x86/kernel/setup_32.c
@@ -615,7 +615,6 @@ void __init setup_bootmem_allocator(void
 	 */
 	find_smp_config();
 #endif
-	numa_kva_reserve();
 	reserve_crashkernel();
 
 	reserve_ibft_region();
Index: linux-2.6/arch/x86/mm/discontig_32.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/discontig_32.c
+++ linux-2.6/arch/x86/mm/discontig_32.c
@@ -334,6 +334,11 @@ unsigned long __init setup_memory(void)
 	printk("kva_start_pfn ~ %ld find_max_low_pfn() ~ %ld\n",
 		kva_start_pfn, max_low_pfn);
 	printk("max_pfn = %ld\n", max_pfn);
+
+	/* avoid clash with initrd */
+	reserve_early(kva_start_pfn<<PAGE_SHIFT,
+		      (kva_start_pfn + kva_pages)<<PAGE_SHIFT,
+		     "KVA PG");
 #ifdef CONFIG_HIGHMEM
 	highstart_pfn = highend_pfn = max_pfn;
 	if (max_pfn > system_max_low_pfn)
@@ -369,13 +374,6 @@ unsigned long __init setup_memory(void)
 	return max_low_pfn;
 }
 
-void __init numa_kva_reserve(void)
-{
-	if (kva_pages)
-		reserve_bootmem(PFN_PHYS(kva_start_pfn), PFN_PHYS(kva_pages),
-				BOOTMEM_DEFAULT);
-}
-
 void __init zone_sizes_init(void)
 {
 	int nid;
Index: linux-2.6/include/asm-x86/mmzone_32.h
===================================================================
--- linux-2.6.orig/include/asm-x86/mmzone_32.h
+++ linux-2.6/include/asm-x86/mmzone_32.h
@@ -38,16 +38,12 @@ static inline void get_memcfg_numa(void)
 }
 
 extern int early_pfn_to_nid(unsigned long pfn);
-extern void numa_kva_reserve(void);
 
 #else /* !CONFIG_NUMA */
 
 #define get_memcfg_numa get_memcfg_numa_flat
 #define get_zholes_size(n) (0)
 
-static inline void numa_kva_reserve(void)
-{
-}
 #endif /* CONFIG_NUMA */
 
 #ifdef CONFIG_DISCONTIGMEM
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] x86: make e820.c to have common functions, Yinghai Lu, (Sun May 11, 3:30 am)
[PATCH] x86: extend e820 ealy_res support 32bit, Yinghai Lu, (Sun May 18, 4:18 am)
[PATCH] x86: 32bit numa srat fix early_ioremap leak, Yinghai Lu, (Thu May 29, 7:25 pm)
[PATCH] x86: cleanup max_pfn_mapped usage - 64bit, Yinghai Lu, (Mon Jun 2, 2:55 am)
[PATCH] x86: cleanup max_pfn_mapped usage - 32bit, Yinghai Lu, (Mon Jun 2, 2:53 am)
[PATCH] x86: numa_32 print out debug info all kva, Yinghai Lu, (Sun Jun 1, 1:56 am)
[PATCH] x86: extend e820 early_res support 32bit -fix #5, Yinghai Lu, (Thu May 29, 3:58 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Thomas Gleixner, (Tue May 27, 11:44 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Tue May 27, 4:37 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Tue May 27, 5:22 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Tue May 27, 5:47 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Wed May 28, 6:01 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Thu May 29, 9:37 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Fri May 30, 11:50 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Wed May 28, 5:24 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Thomas Gleixner, (Tue May 27, 4:58 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix #2, Jeremy Fitzhardinge, (Tue May 27, 5:06 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix v2, Jeremy Fitzhardinge, (Sat May 24, 4:54 am)
[PATCH] xen: boot via i386_start_kernel to get early reserva..., Jeremy Fitzhardinge, (Sat May 24, 5:49 am)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix v2, Jeremy Fitzhardinge, (Fri May 23, 7:38 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix v2, Jeremy Fitzhardinge, (Fri May 23, 7:32 pm)
Re: [PATCH] x86: extend e820 ealy_res support 32bit - fix, Jeremy Fitzhardinge, (Thu May 22, 6:12 am)
[PATCH] x86: move e820_mark_nosave_regions to e820.c, Yinghai Lu, (Tue May 20, 11:10 pm)
Re: [PATCH] x86: make e820.c to have common functions, Ingo Molnar, (Tue May 13, 9:05 am)