diff options
author | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-05-17 10:39:50 +0000 |
---|---|---|
committer | kaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk> | 2005-05-17 10:39:50 +0000 |
commit | b55037f4070e5e5608ae6098997c99ec906bb902 (patch) | |
tree | 7e1ac88305c1dfebaf373ee0a2d998ebd37586b9 | |
parent | 253492576c7589dd8ff761d0b4383f6e42bb1ecb (diff) | |
download | xen-b55037f4070e5e5608ae6098997c99ec906bb902.tar.gz xen-b55037f4070e5e5608ae6098997c99ec906bb902.tar.bz2 xen-b55037f4070e5e5608ae6098997c99ec906bb902.zip |
bitkeeper revision 1.1428 (4289c9f6GdUyHEH-FCu9rRuWtOXnXQ)
Initialise 1:1 mapping of physical memory map early during x86/64 boot.
This mapping should include all ACPI tables, so simplify the mapping
check in the ACPI code.
Signed-off-by: Keir Fraser <keir@xensource.com>
-rw-r--r-- | xen/arch/x86/acpi/boot.c | 10 | ||||
-rw-r--r-- | xen/arch/x86/e820.c | 7 | ||||
-rw-r--r-- | xen/arch/x86/setup.c | 31 | ||||
-rw-r--r-- | xen/arch/x86/x86_64/mm.c | 8 | ||||
-rw-r--r-- | xen/common/grant_table.c | 1 | ||||
-rw-r--r-- | xen/include/asm-x86/e820.h | 2 |
6 files changed, 32 insertions, 27 deletions
diff --git a/xen/arch/x86/acpi/boot.c b/xen/arch/x86/acpi/boot.c index 99fc21b018..553a6631c9 100644 --- a/xen/arch/x86/acpi/boot.c +++ b/xen/arch/x86/acpi/boot.c @@ -40,7 +40,6 @@ #include <mach_mpparse.h> int sbf_port; -#define end_pfn_map max_page #define CONFIG_ACPI_PCI #define BAD_MADT_ENTRY(entry, end) ( \ @@ -96,12 +95,9 @@ enum acpi_irq_model_id acpi_irq_model = ACPI_IRQ_MODEL_PIC; char *__acpi_map_table(unsigned long phys_addr, unsigned long size) { if (!phys_addr || !size) - return NULL; - - if (phys_addr < (end_pfn_map << PAGE_SHIFT)) - return __va(phys_addr); - - return NULL; + return NULL; + /* XEN: We map all e820 areas which should include every ACPI table. */ + return __va(phys_addr); } #else diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c index 7c0050185f..9749a0eac9 100644 --- a/xen/arch/x86/e820.c +++ b/xen/arch/x86/e820.c @@ -372,16 +372,17 @@ static void __init clip_mem(void) } static void __init machine_specific_memory_setup( - struct e820entry *raw, int raw_nr) + struct e820entry *raw, int *raw_nr) { - char nr = (char)raw_nr; + char nr = (char)*raw_nr; sanitize_e820_map(raw, &nr); + *raw_nr = nr; (void)copy_e820_map(raw, nr); clip_4gb(); clip_mem(); } -unsigned long __init init_e820(struct e820entry *raw, int raw_nr) +unsigned long __init init_e820(struct e820entry *raw, int *raw_nr) { machine_specific_memory_setup(raw, raw_nr); printk(KERN_INFO "Physical RAM map:\n"); diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c index cb75477f03..49eb0d275b 100644 --- a/xen/arch/x86/setup.c +++ b/xen/arch/x86/setup.c @@ -25,7 +25,7 @@ * pfn_info table and allocation bitmap. */ static unsigned int opt_xenheap_megabytes = XENHEAP_DEFAULT_MB; -#if defined(__x86_64__) +#if defined(CONFIG_X86_64) integer_param("xenheap_megabytes", opt_xenheap_megabytes); #endif @@ -70,7 +70,7 @@ extern int do_timer_lists_from_pit; struct cpuinfo_x86 boot_cpu_data = { 0, 0, 0, 0, -1 }; -#if defined(__x86_64__) +#if defined(CONFIG_X86_64) unsigned long mmu_cr4_features = X86_CR4_PSE | X86_CR4_PGE | X86_CR4_PAE; #else unsigned long mmu_cr4_features = X86_CR4_PSE | X86_CR4_PGE; @@ -312,10 +312,10 @@ void __init cpu_init(void) /* Set up and load the per-CPU TSS and LDT. */ t->bitmap = IOBMP_INVALID_OFFSET; -#if defined(__i386__) +#if defined(CONFIG_X86_32) t->ss0 = __HYPERVISOR_DS; t->esp0 = get_stack_bottom(); -#elif defined(__x86_64__) +#elif defined(CONFIG_X86_64) t->rsp0 = get_stack_bottom(); #endif set_tss_desc(nr,t); @@ -452,7 +452,7 @@ static void __init start_of_day(void) watchdog_enable(); -#ifdef __x86_64__ /* x86_32 uses low mappings when building DOM0. */ +#ifdef CONFIG_X86_64 /* x86_32 uses low mappings when building DOM0. */ zap_low_mappings(); #endif } @@ -519,7 +519,7 @@ void __init __start_xen(multiboot_info_t *mbi) for ( ; ; ) ; } - max_page = init_e820(e820_raw, e820_raw_nr); + max_page = init_e820(e820_raw, &e820_raw_nr); /* Find the first high-memory RAM hole. */ for ( i = 0; i < e820.nr_map; i++ ) @@ -537,11 +537,11 @@ void __init __start_xen(multiboot_info_t *mbi) printk("Not enough memory to stash the DOM0 kernel image.\n"); for ( ; ; ) ; } -#if defined(__i386__) +#if defined(CONFIG_X86_32) memmove((void *)initial_images_start, /* use low mapping */ (void *)mod[0].mod_start, /* use low mapping */ mod[mbi->mods_count-1].mod_end - mod[0].mod_start); -#elif defined(__x86_64__) +#elif defined(CONFIG_X86_64) memmove(__va(initial_images_start), __va(mod[0].mod_start), mod[mbi->mods_count-1].mod_end - mod[0].mod_start); @@ -562,6 +562,21 @@ void __init __start_xen(multiboot_info_t *mbi) e820.map[i].addr + e820.map[i].size); } +#if defined (CONFIG_X86_64) + /* On x86/64 we can 1:1 map every registered memory area. */ + /* We use the raw_e820 map because we sometimes truncate the cooked map. */ + for ( i = 0; i < e820_raw_nr; i++ ) + { + unsigned long min, sz; + min = (unsigned long)e820_raw[i].addr & + ~(((unsigned long)L1_PAGETABLE_ENTRIES << PAGE_SHIFT) - 1); + sz = ((unsigned long)e820_raw[i].size + + ((unsigned long)L1_PAGETABLE_ENTRIES << PAGE_SHIFT) - 1) & + ~(((unsigned long)L1_PAGETABLE_ENTRIES << PAGE_SHIFT) - 1); + map_pages(idle_pg_table, PAGE_OFFSET + min, min, sz, PAGE_HYPERVISOR); + } +#endif + printk("System RAM: %luMB (%lukB)\n", nr_pages >> (20 - PAGE_SHIFT), nr_pages << (PAGE_SHIFT - 10)); diff --git a/xen/arch/x86/x86_64/mm.c b/xen/arch/x86/x86_64/mm.c index a1db5acd05..f3c686750f 100644 --- a/xen/arch/x86/x86_64/mm.c +++ b/xen/arch/x86/x86_64/mm.c @@ -128,18 +128,12 @@ void __set_fixmap( map_pages(idle_pg_table, fix_to_virt(idx), p, PAGE_SIZE, flags); } - void __init paging_init(void) { - unsigned long i, p, max; + unsigned long i, p; l3_pgentry_t *l3rw, *l3ro; struct pfn_info *pg; - /* Map all of physical memory. */ - max = ((max_page + L1_PAGETABLE_ENTRIES - 1) & - ~(L1_PAGETABLE_ENTRIES - 1)) << PAGE_SHIFT; - map_pages(idle_pg_table, PAGE_OFFSET, 0, max, PAGE_HYPERVISOR); - /* * Allocate and map the machine-to-phys table. * This also ensures L3 is present for ioremap(). diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c index 591ec609f3..4bf52e43ff 100644 --- a/xen/common/grant_table.c +++ b/xen/common/grant_table.c @@ -1227,7 +1227,6 @@ grant_table_init( void) { /* Nothing. */ - DPRINTK("Grant table init\n"); } /* diff --git a/xen/include/asm-x86/e820.h b/xen/include/asm-x86/e820.h index d774b9a321..f510c7c12b 100644 --- a/xen/include/asm-x86/e820.h +++ b/xen/include/asm-x86/e820.h @@ -24,7 +24,7 @@ struct e820map { struct e820entry map[E820MAX]; }; -extern unsigned long init_e820(struct e820entry *, int); +extern unsigned long init_e820(struct e820entry *, int *); extern struct e820map e820; #ifndef NDEBUG |