ia64/xen-unstable

changeset 12341:ddc4bc24f07c

[HVM] Clarify the HVM e820 map. Also make it rather more
conservative wrt the ACPI region. hvmloader should fix up
by freeing unused memory in the range 0xE0000-0x100000.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Thu Nov 09 15:38:15 2006 +0000 (2006-11-09)
parents 14dc20d98ee1
children de7c20b6eaae a5153d9c8c9f
files tools/libxc/xc_hvm_build.c
line diff
     1.1 --- a/tools/libxc/xc_hvm_build.c	Thu Nov 09 14:23:24 2006 +0000
     1.2 +++ b/tools/libxc/xc_hvm_build.c	Thu Nov 09 15:38:15 2006 +0000
     1.3 @@ -66,23 +66,46 @@ static void build_e820map(void *e820_pag
     1.4          mem_size = HVM_BELOW_4G_RAM_END;
     1.5      }
     1.6  
     1.7 +    /* 0x0-0x9F000: Ordinary RAM. */
     1.8      e820entry[nr_map].addr = 0x0;
     1.9      e820entry[nr_map].size = 0x9F000;
    1.10      e820entry[nr_map].type = E820_RAM;
    1.11      nr_map++;
    1.12  
    1.13 +    /*
    1.14 +     * 0x9F000-0x9F800: SMBIOS tables.
    1.15 +     * 0x9FC00-0xA0000: Extended BIOS Data Area (EBDA).
    1.16 +     * TODO: SMBIOS tables should be moved higher (>=0xE0000).
    1.17 +     *       They are unusually low in our memory map: could cause problems?
    1.18 +     */
    1.19      e820entry[nr_map].addr = 0x9F000;
    1.20      e820entry[nr_map].size = 0x1000;
    1.21      e820entry[nr_map].type = E820_RESERVED;
    1.22      nr_map++;
    1.23  
    1.24 -    e820entry[nr_map].addr = 0xEA000;
    1.25 -    e820entry[nr_map].size = 0x02000;
    1.26 -    e820entry[nr_map].type = E820_ACPI;
    1.27 -    nr_map++;
    1.28 +    /*
    1.29 +     * Following regions are standard regions of the PC memory map.
    1.30 +     * They are not covered by e820 regions. OSes will not use as RAM.
    1.31 +     * 0xA0000-0xC0000: VGA memory-mapped I/O. Not covered by E820.
    1.32 +     * 0xC0000-0xE0000: 16-bit devices, expansion ROMs (inc. vgabios).
    1.33 +     * TODO: hvmloader should free pages which turn out to be unused.
    1.34 +     */
    1.35  
    1.36 -    e820entry[nr_map].addr = 0xF0000;
    1.37 -    e820entry[nr_map].size = 0x10000;
    1.38 +    /*
    1.39 +     * 0xE0000-0x0F0000: PC-specific area. We place ACPI tables here.
    1.40 +     *                   We *cannot* mark as E820_ACPI, for two reasons:
    1.41 +     *                    1. ACPI spec. says that E820_ACPI regions below
    1.42 +     *                       16MB must clip INT15h 0x88 and 0xe801 queries.
    1.43 +     *                       Our rombios doesn't do this.
    1.44 +     *                    2. The OS is allowed to reclaim ACPI memory after
    1.45 +     *                       parsing the tables. But our FACS is in this
    1.46 +     *                       region and it must not be reclaimed (it contains
    1.47 +     *                       the ACPI global lock!).
    1.48 +     * 0xF0000-0x100000: System BIOS.
    1.49 +     * TODO: hvmloader should free pages which turn out to be unused.
    1.50 +     */
    1.51 +    e820entry[nr_map].addr = 0xE0000;
    1.52 +    e820entry[nr_map].size = 0x20000;
    1.53      e820entry[nr_map].type = E820_RESERVED;
    1.54      nr_map++;
    1.55