[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] [LINUX] /proc/iomem should not be initialised from pseudophysical e820 map.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 11626efd003c5c080bf9622fee0f1c3da508086a
# Parent  50aea0ec406bd03dad9da31255857e4a41f7efcc
[LINUX] /proc/iomem should not be initialised from pseudophysical e820 map.
This is because it should only contain real I/O memory address ranges,
otherwise we can get false conflicts between a real I/O range and a
'pseudophysical' RAM range, causing drivers to fail to work in a domU.
Also prevent kernel code/data being requested as iomem resources --
they are not contiguous in 'io memory' space so this would not make
sense.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c   |    7 +++----
 linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c  |    2 ++
 linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c |    5 +++--
 3 files changed, 8 insertions(+), 6 deletions(-)

diff -r 50aea0ec406b -r 11626efd003c 
linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Wed Aug 30 22:36:18 
2006 +0100
+++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c Thu Aug 31 03:05:40 
2006 +0100
@@ -1380,8 +1380,10 @@ legacy_init_iomem_resources(struct e820e
                         *  so we try it repeatedly and let the resource manager
                         *  test it.
                         */
+#ifndef CONFIG_XEN
                        request_resource(res, code_resource);
                        request_resource(res, data_resource);
+#endif
 #ifdef CONFIG_KEXEC
                        request_resource(res, &crashk_res);
 #endif
@@ -1454,11 +1456,8 @@ static void __init register_memory(void)
        int           i;
 
        /* Nothing to do if not running in dom0. */
-       if (!is_initial_xendomain()) {
-               legacy_init_iomem_resources(e820.map, e820.nr_map,
-                                           &code_resource, &data_resource);
+       if (!is_initial_xendomain())
                return;
-       }
 
 #ifdef CONFIG_XEN
        machine_e820 = alloc_bootmem_low_pages(PAGE_SIZE);
diff -r 50aea0ec406b -r 11626efd003c 
linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c        Wed Aug 30 
22:36:18 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c        Thu Aug 31 
03:05:40 2006 +0100
@@ -255,8 +255,10 @@ void __init e820_reserve_resources(struc
                         *  so we try it repeatedly and let the resource manager
                         *  test it.
                         */
+#ifndef CONFIG_XEN
                        request_resource(res, &code_resource);
                        request_resource(res, &data_resource);
+#endif
 #ifdef CONFIG_KEXEC
                        request_resource(res, &crashk_res);
 #endif
diff -r 50aea0ec406b -r 11626efd003c 
linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
--- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Wed Aug 30 
22:36:18 2006 +0100
+++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c       Thu Aug 31 
03:05:40 2006 +0100
@@ -944,9 +944,10 @@ void __init setup_arch(char **cmdline_p)
                BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, 
&memmap));
 
                e820_reserve_resources(machine_e820, memmap.nr_entries);
-       } else
-#endif
+       }
+#else
        e820_reserve_resources(e820.map, e820.nr_map);
+#endif
 
        request_resource(&iomem_resource, &video_ram_resource);
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.