diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-11-03 12:40:28 +0000 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-11-03 12:40:28 +0000 |
commit | b8a456caedf2424255b585032fc9eac51d2a895d (patch) | |
tree | ae48840b556556d30ad579ece5ea4de70ebd9818 /xen/arch/x86/e820.c | |
parent | b95beb185810484d5afe91b994d2c2d1670af74c (diff) | |
download | xen-b8a456caedf2424255b585032fc9eac51d2a895d.tar.gz xen-b8a456caedf2424255b585032fc9eac51d2a895d.tar.bz2 xen-b8a456caedf2424255b585032fc9eac51d2a895d.zip |
x86: improve reporting through XENMEM_machine_memory_map
Since Dom0 derives machine address ranges usable for assigning PCI
device resources from the output of this sub-hypercall, Xen should
make
sure it properly reports all ranges not suitable for this (as either
reserved or unusable):
- RAM regions excluded via command line option
- memory regions used by Xen itself (LAPIC, IOAPICs)
While the latter should generally already be excluded by the BIOS
provided E820 table, this apparently isn't always the case at least
for IOAPICs, and with Linux having got changed to account for this it
seems to make sense to also do so in Xen.
Generally the HPET range should also be excluded here, but since it
isn't being reflected in Dom0's iomem_caps (and can't be, as it's a
sub-page range) I wasn't sure whether adding explicit code for doing
so would be reasonable.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'xen/arch/x86/e820.c')
-rw-r--r-- | xen/arch/x86/e820.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c index bdc9748793..5dfb3f3c41 100644 --- a/xen/arch/x86/e820.c +++ b/xen/arch/x86/e820.c @@ -373,7 +373,13 @@ static void __init clip_to_limit(uint64_t limit, char *warnmsg) ((e820.map[i].addr + e820.map[i].size) <= limit) ) continue; old_limit = e820.map[i].addr + e820.map[i].size; - if ( e820.map[i].addr < limit ) + if ( e820_change_range_type(&e820, max(e820.map[i].addr, limit), + old_limit, E820_RAM, E820_UNUSABLE) ) + { + /* Start again now e820 map must have changed. */ + i = 0; + } + else if ( e820.map[i].addr < limit ) { e820.map[i].size = limit - e820.map[i].addr; } |