ia64/xen-unstable

changeset 15740:db21f714d37f

Ensure multiboot modules are mapped when we copy them.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Aug 09 15:16:51 2007 +0100 (2007-08-09)
parents b55fe44438bc
children 3876b4e7cc0a
files xen/arch/x86/setup.c
line diff
     1.1 --- a/xen/arch/x86/setup.c	Thu Aug 09 10:14:38 2007 +0100
     1.2 +++ b/xen/arch/x86/setup.c	Thu Aug 09 15:16:51 2007 +0100
     1.3 @@ -282,9 +282,28 @@ static void __init srat_detect_node(int 
     1.4          printk(KERN_INFO "CPU %d APIC %d -> Node %d\n", cpu, apicid, node);
     1.5  }
     1.6  
     1.7 +/*
     1.8 + * Ensure a given physical memory range is present in the bootstrap mappings.
     1.9 + * Use superpage mappings to ensure that pagetable memory needn't be allocated.
    1.10 + */
    1.11 +static void __init bootstrap_map(unsigned long start, unsigned long end)
    1.12 +{
    1.13 +    unsigned long mask = (1UL << L2_PAGETABLE_SHIFT) - 1;
    1.14 +    start = start & ~mask;
    1.15 +    end   = (end + mask) & ~mask;
    1.16 +    if ( end > BOOTSTRAP_DIRECTMAP_END )
    1.17 +        panic("Cannot access memory beyond end of "
    1.18 +              "bootstrap direct-map area\n");
    1.19 +    map_pages_to_xen(
    1.20 +        (unsigned long)maddr_to_bootstrap_virt(start),
    1.21 +        start >> PAGE_SHIFT, (end-start) >> PAGE_SHIFT, PAGE_HYPERVISOR);
    1.22 +}
    1.23 +
    1.24  static void __init move_memory(
    1.25      unsigned long dst, unsigned long src_start, unsigned long src_end)
    1.26  {
    1.27 +    bootstrap_map(src_start, src_end);
    1.28 +    bootstrap_map(dst, dst + src_end - src_start);
    1.29      memmove(maddr_to_bootstrap_virt(dst),
    1.30              maddr_to_bootstrap_virt(src_start),
    1.31              src_end - src_start);