All of lore.kernel.org
 help / color / mirror / Atom feed
* {PATCH] x86: print out initial max_pfn_mapped
@ 2009-03-17  2:22 Yinghai Lu
  2009-03-17  2:36 ` H. Peter Anvin
  2009-05-11  9:53 ` [tip:x86/mm] x86: clean up and and " tip-bot for Yinghai Lu
  0 siblings, 2 replies; 4+ messages in thread
From: Yinghai Lu @ 2009-03-17  2:22 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Peter Anvin, Jeremy Fitzhardinge
  Cc: linux-kernel


Impact: more debug info

check range that is mapped before init_memory_mapping().
also make 64bit have max_pfn_mapped assigned before that calling

Signed-off-by: Yinghai Lu <yinghai@kernel.org>

---
 arch/x86/kernel/setup.c |    3 +++
 arch/x86/mm/init.c      |    7 +++----
 2 files changed, 6 insertions(+), 4 deletions(-)

Index: linux-2.6/arch/x86/kernel/setup.c
===================================================================
--- linux-2.6.orig/arch/x86/kernel/setup.c
+++ linux-2.6/arch/x86/kernel/setup.c
@@ -836,12 +836,15 @@ void __init setup_arch(char **cmdline_p)
 		max_low_pfn = max_pfn;
 
 	high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
+	max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
 #endif
 
 #ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
 	setup_bios_corruption_check();
 #endif
 
+	printk(KERN_DEBUG "initial memory mapped %lx\n", max_pfn_mapped<<PAGE_SHIFT);
+
 	/* max_pfn_mapped is updated here */
 	max_low_pfn_mapped = init_memory_mapping(0, max_low_pfn<<PAGE_SHIFT);
 	max_pfn_mapped = max_low_pfn_mapped;
Index: linux-2.6/arch/x86/mm/init.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/init.c
+++ linux-2.6/arch/x86/mm/init.c
@@ -65,12 +65,11 @@ static void __init find_early_table_spac
 	 */
 #ifdef CONFIG_X86_32
 	start = 0x7000;
-	e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
-					tables, PAGE_SIZE);
-#else /* CONFIG_X86_64 */
+#else
 	start = 0x8000;
-	e820_table_start = find_e820_area(start, end, tables, PAGE_SIZE);
 #endif
+	e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
+					tables, PAGE_SIZE);
 	if (e820_table_start == -1UL)
 		panic("Cannot find space for the kernel page tables");
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: {PATCH] x86: print out initial max_pfn_mapped
  2009-03-17  2:22 {PATCH] x86: print out initial max_pfn_mapped Yinghai Lu
@ 2009-03-17  2:36 ` H. Peter Anvin
  2009-03-17  3:30   ` Yinghai Lu
  2009-05-11  9:53 ` [tip:x86/mm] x86: clean up and and " tip-bot for Yinghai Lu
  1 sibling, 1 reply; 4+ messages in thread
From: H. Peter Anvin @ 2009-03-17  2:36 UTC (permalink / raw)
  To: Yinghai Lu
  Cc: Ingo Molnar, Thomas Gleixner, Jeremy Fitzhardinge, linux-kernel

Yinghai Lu wrote:
> Impact: more debug info
> 
> check range that is mapped before init_memory_mapping().
> also make 64bit have max_pfn_mapped assigned before that calling
> 
> Index: linux-2.6/arch/x86/mm/init.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/mm/init.c
> +++ linux-2.6/arch/x86/mm/init.c
> @@ -65,12 +65,11 @@ static void __init find_early_table_spac
>  	 */
>  #ifdef CONFIG_X86_32
>  	start = 0x7000;
> -	e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
> -					tables, PAGE_SIZE);
> -#else /* CONFIG_X86_64 */
> +#else
>  	start = 0x8000;
> -	e820_table_start = find_e820_area(start, end, tables, PAGE_SIZE);
>  #endif
> +	e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
> +					tables, PAGE_SIZE);
>  	if (e820_table_start == -1UL)
>  		panic("Cannot find space for the kernel page tables");
>  

This doesn't seem to match anything anywhere in the description.
Furthermore, why do we even have a different starting address for
different architectures?  If anything, this starting address is way too
low (hogging ZONE_DMA and all that...)

	-hpa

-- 
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel.  I don't speak on their behalf.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: {PATCH] x86: print out initial max_pfn_mapped
  2009-03-17  2:36 ` H. Peter Anvin
@ 2009-03-17  3:30   ` Yinghai Lu
  0 siblings, 0 replies; 4+ messages in thread
From: Yinghai Lu @ 2009-03-17  3:30 UTC (permalink / raw)
  To: H. Peter Anvin
  Cc: Ingo Molnar, Thomas Gleixner, Jeremy Fitzhardinge, linux-kernel

H. Peter Anvin wrote:
> Yinghai Lu wrote:
>> Impact: more debug info
>>
>> check range that is mapped before init_memory_mapping().
>> also make 64bit have max_pfn_mapped assigned before that calling
>>
>> Index: linux-2.6/arch/x86/mm/init.c
>> ===================================================================
>> --- linux-2.6.orig/arch/x86/mm/init.c
>> +++ linux-2.6/arch/x86/mm/init.c
>> @@ -65,12 +65,11 @@ static void __init find_early_table_spac
>>  	 */
>>  #ifdef CONFIG_X86_32
>>  	start = 0x7000;
>> -	e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
>> -					tables, PAGE_SIZE);
>> -#else /* CONFIG_X86_64 */
>> +#else
>>  	start = 0x8000;
>> -	e820_table_start = find_e820_area(start, end, tables, PAGE_SIZE);
>>  #endif
>> +	e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
>> +					tables, PAGE_SIZE);
>>  	if (e820_table_start == -1UL)
>>  		panic("Cannot find space for the kernel page tables");
>>  
> 
> This doesn't seem to match anything anywhere in the description.
> Furthermore, why do we even have a different starting address for
> different architectures?  If anything, this starting address is way too
> low (hogging ZONE_DMA and all that...)
> 


>> also make 64bit have max_pfn_mapped assigned before that calling

so find_e820_area() could use max_pfn_mapped for 64 bit too.

for 64bit, you could use start from 16M for searching free range for left page table. right now
for 32bit, you may need to increase initial max_pfn_mapped to 32M (?) so could start searching from 16M.
need some code for head_32.S
anyway that will be another patch.

YH

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [tip:x86/mm] x86: clean up and and print out initial max_pfn_mapped
  2009-03-17  2:22 {PATCH] x86: print out initial max_pfn_mapped Yinghai Lu
  2009-03-17  2:36 ` H. Peter Anvin
@ 2009-05-11  9:53 ` tip-bot for Yinghai Lu
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot for Yinghai Lu @ 2009-05-11  9:53 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, yinghai, tglx, mingo

Commit-ID:  80989ce0643c1034822f3e339ed8d790b649abe1
Gitweb:     http://git.kernel.org/tip/80989ce0643c1034822f3e339ed8d790b649abe1
Author:     Yinghai Lu <yinghai@kernel.org>
AuthorDate: Sat, 9 May 2009 23:47:42 -0700
Committer:  Ingo Molnar <mingo@elte.hu>
CommitDate: Mon, 11 May 2009 11:11:12 +0200

x86: clean up and and print out initial max_pfn_mapped

Do this so we can check the range that is mapped before
init_memory_mapping().

To be able to print out meaningful info, we first have to fix
64-bit to have max_pfn_mapped assigned before that call. This
also unifies the code-path a bit.

[ Impact: print more debug info, cleanup ]

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
LKML-Reference: <49BF0978.40605@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>


---
 arch/x86/kernel/setup.c |    4 ++++
 arch/x86/mm/init.c      |    7 +++----
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c
index 0d77e56..4031d6c 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -862,12 +862,16 @@ void __init setup_arch(char **cmdline_p)
 		max_low_pfn = max_pfn;
 
 	high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
+	max_pfn_mapped = KERNEL_IMAGE_SIZE >> PAGE_SHIFT;
 #endif
 
 #ifdef CONFIG_X86_CHECK_BIOS_CORRUPTION
 	setup_bios_corruption_check();
 #endif
 
+	printk(KERN_DEBUG "initial memory mapped : 0 - %08lx\n",
+			max_pfn_mapped<<PAGE_SHIFT);
+
 	reserve_brk();
 
 	/* max_pfn_mapped is updated here */
diff --git a/arch/x86/mm/init.c b/arch/x86/mm/init.c
index 95f5ecf..92d2108 100644
--- a/arch/x86/mm/init.c
+++ b/arch/x86/mm/init.c
@@ -132,12 +132,11 @@ static void __init find_early_table_space(unsigned long end, int use_pse,
 	 */
 #ifdef CONFIG_X86_32
 	start = 0x7000;
-	e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
-					tables, PAGE_SIZE);
-#else /* CONFIG_X86_64 */
+#else
 	start = 0x8000;
-	e820_table_start = find_e820_area(start, end, tables, PAGE_SIZE);
 #endif
+	e820_table_start = find_e820_area(start, max_pfn_mapped<<PAGE_SHIFT,
+					tables, PAGE_SIZE);
 	if (e820_table_start == -1UL)
 		panic("Cannot find space for the kernel page tables");
 

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-11  9:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-17  2:22 {PATCH] x86: print out initial max_pfn_mapped Yinghai Lu
2009-03-17  2:36 ` H. Peter Anvin
2009-03-17  3:30   ` Yinghai Lu
2009-05-11  9:53 ` [tip:x86/mm] x86: clean up and and " tip-bot for Yinghai Lu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.