All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH] linux/x86: Initialize high_memory as early as possible
Date: Thu, 29 Jun 2006 15:42:19 +0200	[thread overview]
Message-ID: <44A3F4DB.76E4.0078.0@novell.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

Also all other variables dependent on the same input(s). This is a prerequisite patch for two ones to follow. I will
post a similar change for mainline Linux soon.

Signed-off-by: jbeulich@novell.com 


[-- Attachment #2: xenlinux-x86-high_memory-early.patch --]
[-- Type: text/plain, Size: 3294 bytes --]

Index: 2006-06-29/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
===================================================================
--- 2006-06-29.orig/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	2006-06-12 08:24:28.000000000 +0200
+++ 2006-06-29/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	2006-06-29 15:26:47.000000000 +0200
@@ -1210,6 +1210,14 @@ static unsigned long __init setup_memory
 	}
 	printk(KERN_NOTICE "%ldMB HIGHMEM available.\n",
 		pages_to_mb(highend_pfn - highstart_pfn));
+	num_physpages = highend_pfn;
+	high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
+#else
+	num_physpages = max_low_pfn;
+	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
+#endif
+#ifdef CONFIG_FLATMEM
+	max_mapnr = num_physpages;
 #endif
 	printk(KERN_NOTICE "%ldMB LOWMEM available.\n",
 			pages_to_mb(max_low_pfn));
Index: 2006-06-29/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c
===================================================================
--- 2006-06-29.orig/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c	2006-06-14 18:10:51.000000000 +0200
+++ 2006-06-29/linux-2.6-xen-sparse/arch/i386/mm/init-xen.c	2006-06-29 15:26:47.000000000 +0200
@@ -600,18 +600,6 @@ static void __init test_wp_bit(void)
 	}
 }
 
-static void __init set_max_mapnr_init(void)
-{
-#ifdef CONFIG_HIGHMEM
-	num_physpages = highend_pfn;
-#else
-	num_physpages = max_low_pfn;
-#endif
-#ifdef CONFIG_FLATMEM
-	max_mapnr = num_physpages;
-#endif
-}
-
 static struct kcore_list kcore_mem, kcore_vmalloc; 
 
 void __init mem_init(void)
@@ -648,13 +636,6 @@ void __init mem_init(void)
 	}
 #endif
  
-	set_max_mapnr_init();
-
-#ifdef CONFIG_HIGHMEM
-	high_memory = (void *) __va(highstart_pfn * PAGE_SIZE - 1) + 1;
-#else
-	high_memory = (void *) __va(max_low_pfn * PAGE_SIZE - 1) + 1;
-#endif
 	printk("vmalloc area: %lx-%lx, maxmem %lx\n",
 	       VMALLOC_START,VMALLOC_END,MAXMEM);
 	BUG_ON(VMALLOC_START > VMALLOC_END);
Index: 2006-06-29/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
===================================================================
--- 2006-06-29.orig/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	2006-06-12 08:24:28.000000000 +0200
+++ 2006-06-29/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	2006-06-29 15:26:47.000000000 +0200
@@ -706,6 +706,11 @@ void __init setup_arch(char **cmdline_p)
 	 * we are rounding upwards:
 	 */
 	end_pfn = e820_end_of_ram();
+	/* How many end-of-memory variables you have, grandma! */
+	max_low_pfn = end_pfn;
+	max_pfn = end_pfn;
+	num_physpages = end_pfn;
+	high_memory = (void *)__va(end_pfn * PAGE_SIZE - 1) + 1;
 
 	check_efer();
 
Index: 2006-06-29/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c
===================================================================
--- 2006-06-29.orig/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	2006-06-12 08:24:28.000000000 +0200
+++ 2006-06-29/linux-2.6-xen-sparse/arch/x86_64/mm/init-xen.c	2006-06-29 15:26:47.000000000 +0200
@@ -894,12 +894,6 @@ void __init mem_init(void)
 #endif
 	no_iommu_init();
 
-	/* How many end-of-memory variables you have, grandma! */
-	max_low_pfn = end_pfn;
-	max_pfn = end_pfn;
-	num_physpages = end_pfn;
-	high_memory = (void *) __va(end_pfn * PAGE_SIZE);
-
 	/* clear the zero-page */
 	memset(empty_zero_page, 0, PAGE_SIZE);
 

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

             reply	other threads:[~2006-06-29 13:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-29 13:42 Jan Beulich [this message]
2006-06-29 13:55 ` [PATCH] linux/x86: Initialize high_memory as early as possible Keir Fraser
2006-06-29 14:03   ` Jan Beulich
2006-06-29 14:47     ` Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44A3F4DB.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.