All of lore.kernel.org
 help / color / mirror / Atom feed
From: Suresh Siddha <suresh.b.siddha@intel.com>
To: mingo@elte.hu, hpa@zytor.com, tglx@linutronix.de
Cc: linux-kernel@vger.kernel.org, yhlu.kernel@gmail.com
Subject: [patch] tip/x86_64: fix e820 merge issue which broke max_pfn_mapped
Date: Tue, 8 Jul 2008 16:08:37 -0700	[thread overview]
Message-ID: <20080708230837.GD1678@linux-os.sc.intel.com> (raw)

With out this 64bit tip/master doesn't boot using ACPI on my system.
---
 
max_pfn_mapped should include all e820 entries.
The direct mapping extends to max_pfn_mapped, so that we can directly access
apertures, ACPI and other tables without having to play with fixmaps.

With this, my system with 1GB memory boots fine with ACPI enabled.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
---

Index: tree-x86/arch/x86/kernel/e820.c
===================================================================
--- tree-x86.orig/arch/x86/kernel/e820.c	2008-07-08 15:31:24.000000000 -0700
+++ tree-x86/arch/x86/kernel/e820.c	2008-07-08 15:55:09.000000000 -0700
@@ -1040,6 +1040,10 @@
 
 	if (last_pfn > max_arch_pfn)
 		last_pfn = max_arch_pfn;
+#ifdef CONFIG_X86_64
+	if (last_pfn > max_pfn_mapped)
+		max_pfn_mapped = last_pfn;
+#endif
 	if (last_pfn > end_user_pfn)
 		last_pfn = end_user_pfn;
 
@@ -1067,6 +1071,12 @@
 	if (*ei_startpfn >= *ei_endpfn)
 		return 0;
 
+#ifdef CONFIG_X86_64
+	/* Check if max_pfn_mapped should be updated */
+	if (ei->type != E820_RAM && *ei_endpfn > max_pfn_mapped)
+		max_pfn_mapped = *ei_endpfn;
+#endif
+
 	/* Skip if map is outside the node */
 	if (ei->type != E820_RAM || *ei_endpfn <= start_pfn ||
 				    *ei_startpfn >= last_pfn)
Index: tree-x86/arch/x86/kernel/setup.c
===================================================================
--- tree-x86.orig/arch/x86/kernel/setup.c	2008-07-08 15:33:42.000000000 -0700
+++ tree-x86/arch/x86/kernel/setup.c	2008-07-08 15:33:49.000000000 -0700
@@ -722,8 +722,12 @@
 	high_memory = (void *)__va(max_pfn * PAGE_SIZE - 1) + 1;
 #endif
 
+#ifdef CONFIG_X86_32
 	/* max_pfn_mapped is updated here */
 	max_pfn_mapped = init_memory_mapping(0, (max_low_pfn << PAGE_SHIFT));
+#else
+	max_pfn_mapped = init_memory_mapping(0, (max_pfn_mapped << PAGE_SHIFT));
+#endif
 
 	/*
 	 * NOTE: On x86-32, only from this point on, fixmaps are ready for use.

             reply	other threads:[~2008-07-08 23:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-08 23:08 Suresh Siddha [this message]
2008-07-09  0:47 ` [patch] tip/x86_64: fix e820 merge issue which broke max_pfn_mapped Yinghai Lu
2008-07-09  0:59 ` Yinghai Lu
2008-07-09  1:56   ` Yinghai Lu
2008-07-09 17:56     ` Suresh Siddha
2008-07-09 18:05       ` Yinghai Lu
2008-07-09 18:11         ` Jeremy Fitzhardinge
2008-07-09 18:44           ` Suresh Siddha
2008-07-09 18:47             ` Yinghai Lu
2008-07-09 18:50               ` Suresh Siddha
2008-07-09 18:51                 ` Yinghai Lu
2008-07-09 19:03             ` Jeremy Fitzhardinge
2008-07-09 20:34               ` Ingo Molnar
2008-07-09 18:48         ` Suresh Siddha
2008-07-09 18:59           ` Yinghai Lu
2008-07-09 17:00   ` Suresh Siddha

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=20080708230837.GD1678@linux-os.sc.intel.com \
    --to=suresh.b.siddha@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=yhlu.kernel@gmail.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.