From: "Jan Beulich" <jbeulich@novell.com>
To: xen-devel@lists.xensource.com
Subject: [PATCH 2/8] 2.6.17: E820 handling adjustments
Date: Wed, 14 Feb 2007 15:57:31 +0000 [thread overview]
Message-ID: <45D33F7B.76E4.0078.0@novell.com> (raw)
In certain places, machine_e820 should be used rather than e820.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Index: head-2007-02-08/arch/i386/kernel/setup-xen.c
===================================================================
--- head-2007-02-08.orig/arch/i386/kernel/setup-xen.c 2007-02-08 17:07:13.000000000 +0100
+++ head-2007-02-08/arch/i386/kernel/setup-xen.c 2007-02-08 17:09:47.000000000 +0100
@@ -1034,8 +1034,16 @@ e820_all_mapped(unsigned long s, unsigne
u64 start = s;
u64 end = e;
int i;
+
+#ifndef CONFIG_XEN
for (i = 0; i < e820.nr_map; i++) {
struct e820entry *ei = &e820.map[i];
+#else
+ if (!is_initial_xendomain())
+ return 0;
+ for (i = 0; i < machine_e820.nr_map; ++i) {
+ const struct e820entry *ei = &machine_e820.map[i];
+#endif
if (type && ei->type != type)
continue;
/* is the region (part) in overlap with the current region ?*/
@@ -1505,9 +1513,6 @@ e820_setup_gap(struct e820entry *e820, i
*/
static int __init request_standard_resources(void)
{
-#ifdef CONFIG_XEN
- struct xen_memory_map memmap;
-#endif
int i;
/* Nothing to do if not running in dom0. */
@@ -1516,13 +1521,6 @@ static int __init request_standard_resou
printk("Setting up standard PCI resources\n");
#ifdef CONFIG_XEN
- memmap.nr_entries = E820MAX;
- set_xen_guest_handle(memmap.buffer, machine_e820.map);
-
- if (HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap))
- BUG();
- machine_e820.nr_map = memmap.nr_entries;
-
legacy_init_iomem_resources(machine_e820.map, machine_e820.nr_map,
&code_resource, &data_resource);
#else
@@ -1548,10 +1546,20 @@ static void __init register_memory(void)
{
#ifdef CONFIG_XEN
- e820_setup_gap(machine_e820.map, machine_e820.nr_map);
-#else
- e820_setup_gap(e820.map, e820.nr_map);
+ if (is_initial_xendomain()) {
+ struct xen_memory_map memmap;
+
+ memmap.nr_entries = E820MAX;
+ set_xen_guest_handle(memmap.buffer, machine_e820.map);
+
+ BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap));
+
+ machine_e820.nr_map = memmap.nr_entries;
+ e820_setup_gap(machine_e820.map, machine_e820.nr_map);
+ }
+ else
#endif
+ e820_setup_gap(e820.map, e820.nr_map);
}
#ifdef CONFIG_MCA
Index: head-2007-02-08/arch/x86_64/kernel/e820-xen.c
===================================================================
--- head-2007-02-08.orig/arch/x86_64/kernel/e820-xen.c 2007-02-08 17:07:13.000000000 +0100
+++ head-2007-02-08/arch/x86_64/kernel/e820-xen.c 2007-02-08 17:09:47.000000000 +0100
@@ -127,8 +127,19 @@ e820_any_mapped(unsigned long start, uns
int __init e820_all_mapped(unsigned long start, unsigned long end, unsigned type)
{
int i;
+
+#ifndef CONFIG_XEN
for (i = 0; i < e820.nr_map; i++) {
struct e820entry *ei = &e820.map[i];
+#else
+ extern struct e820map machine_e820;
+
+ if (!is_initial_xendomain())
+ return 0;
+ for (i = 0; i < machine_e820.nr_map; i++) {
+ const struct e820entry *ei = &machine_e820.map[i];
+#endif
+
if (type && ei->type != type)
continue;
/* is the region (part) in overlap with the current region ?*/
Index: head-2007-02-08/arch/x86_64/kernel/setup-xen.c
===================================================================
--- head-2007-02-08.orig/arch/x86_64/kernel/setup-xen.c 2007-02-08 17:07:13.000000000 +0100
+++ head-2007-02-08/arch/x86_64/kernel/setup-xen.c 2007-02-08 17:09:47.000000000 +0100
@@ -585,8 +585,6 @@ static void discover_ebda(void)
void __init setup_arch(char **cmdline_p)
{
#ifdef CONFIG_XEN
- struct xen_memory_map memmap;
-
/* Register a call for panic conditions. */
atomic_notifier_chain_register(&panic_notifier_list, &xen_panic_block);
@@ -895,6 +893,8 @@ void __init setup_arch(char **cmdline_p)
probe_roms();
#ifdef CONFIG_XEN
if (is_initial_xendomain()) {
+ struct xen_memory_map memmap;
+
memmap.nr_entries = E820MAX;
set_xen_guest_handle(memmap.buffer, machine_e820.map);
reply other threads:[~2007-02-14 15:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=45D33F7B.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.