direct-io.hg

changeset 11389:11626efd003c

[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@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Thu Aug 31 03:05:40 2006 +0100 (2006-08-31)
parents 50aea0ec406b
children 1c3455182cee
files linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Wed Aug 30 22:36:18 2006 +0100
     1.2 +++ b/linux-2.6-xen-sparse/arch/i386/kernel/setup-xen.c	Thu Aug 31 03:05:40 2006 +0100
     1.3 @@ -1380,8 +1380,10 @@ legacy_init_iomem_resources(struct e820e
     1.4  			 *  so we try it repeatedly and let the resource manager
     1.5  			 *  test it.
     1.6  			 */
     1.7 +#ifndef CONFIG_XEN
     1.8  			request_resource(res, code_resource);
     1.9  			request_resource(res, data_resource);
    1.10 +#endif
    1.11  #ifdef CONFIG_KEXEC
    1.12  			request_resource(res, &crashk_res);
    1.13  #endif
    1.14 @@ -1454,11 +1456,8 @@ static void __init register_memory(void)
    1.15  	int	      i;
    1.16  
    1.17  	/* Nothing to do if not running in dom0. */
    1.18 -	if (!is_initial_xendomain()) {
    1.19 -		legacy_init_iomem_resources(e820.map, e820.nr_map,
    1.20 -					    &code_resource, &data_resource);
    1.21 +	if (!is_initial_xendomain())
    1.22  		return;
    1.23 -	}
    1.24  
    1.25  #ifdef CONFIG_XEN
    1.26  	machine_e820 = alloc_bootmem_low_pages(PAGE_SIZE);
     2.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c	Wed Aug 30 22:36:18 2006 +0100
     2.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/e820-xen.c	Thu Aug 31 03:05:40 2006 +0100
     2.3 @@ -255,8 +255,10 @@ void __init e820_reserve_resources(struc
     2.4  			 *  so we try it repeatedly and let the resource manager
     2.5  			 *  test it.
     2.6  			 */
     2.7 +#ifndef CONFIG_XEN
     2.8  			request_resource(res, &code_resource);
     2.9  			request_resource(res, &data_resource);
    2.10 +#endif
    2.11  #ifdef CONFIG_KEXEC
    2.12  			request_resource(res, &crashk_res);
    2.13  #endif
     3.1 --- a/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Wed Aug 30 22:36:18 2006 +0100
     3.2 +++ b/linux-2.6-xen-sparse/arch/x86_64/kernel/setup-xen.c	Thu Aug 31 03:05:40 2006 +0100
     3.3 @@ -944,9 +944,10 @@ void __init setup_arch(char **cmdline_p)
     3.4  		BUG_ON(HYPERVISOR_memory_op(XENMEM_machine_memory_map, &memmap));
     3.5  
     3.6  		e820_reserve_resources(machine_e820, memmap.nr_entries);
     3.7 -	} else
     3.8 +	}
     3.9 +#else
    3.10 +	e820_reserve_resources(e820.map, e820.nr_map);
    3.11  #endif
    3.12 -	e820_reserve_resources(e820.map, e820.nr_map);
    3.13  
    3.14  	request_resource(&iomem_resource, &video_ram_resource);
    3.15