From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: [PATCH] linux/x86: Initialize high_memory as early as possible Date: Thu, 29 Jun 2006 15:42:19 +0200 Message-ID: <44A3F4DB.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartFCD916AB.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartFCD916AB.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 --=__PartFCD916AB.0__= Content-Type: text/plain; name="xenlinux-x86-high_memory-early.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xenlinux-x86-high_memory-early.patch" 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); --=__PartFCD916AB.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__PartFCD916AB.0__=--