[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] x86: Improve e820 scanning for all I/O regions.
# HG changeset patch # User kfraser@xxxxxxxxxxxxxxxxxxxxx # Date 1183460551 -3600 # Node ID 08bcc54aee8e3c24cab2f0df97179c6ccfa86642 # Parent eb2b7ce05f9769cb4761e4608cd990b4b8c9519c x86: Improve e820 scanning for all I/O regions. Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx> --- xen/arch/x86/mm.c | 30 ++++++++++++++++++++++-------- 1 files changed, 22 insertions(+), 8 deletions(-) diff -r eb2b7ce05f97 -r 08bcc54aee8e xen/arch/x86/mm.c --- a/xen/arch/x86/mm.c Tue Jul 03 11:47:08 2007 +0100 +++ b/xen/arch/x86/mm.c Tue Jul 03 12:02:31 2007 +0100 @@ -211,23 +211,37 @@ void __init arch_init_memory(void) share_xen_page_with_guest(mfn_to_page(i), dom_io, XENSHARE_writable); /* Any areas not specified as RAM by the e820 map are considered I/O. */ - for ( i = 0, pfn = 0; i < e820.nr_map; i++ ) - { - if ( e820.map[i].type != E820_RAM ) - continue; - /* Every page from cursor to start of next RAM region is I/O. */ - rstart_pfn = PFN_UP(e820.map[i].addr); - rend_pfn = PFN_DOWN(e820.map[i].addr + e820.map[i].size); + pfn = i = 0; + while ( pfn < max_page ) + { + while ( (i < e820.nr_map) && (e820.map[i].type != E820_RAM) ) + i++; + + if ( i == e820.nr_map ) + { + /* No more RAM regions: mark as I/O right to end of memory map. */ + rstart_pfn = rend_pfn = max_page; + } + else + { + /* Mark as I/O just up as far as next RAM region. */ + rstart_pfn = min_t(unsigned long, max_page, + PFN_UP(e820.map[i].addr)); + rend_pfn = max_t(unsigned long, rstart_pfn, + PFN_DOWN(e820.map[i].addr + e820.map[i].size)); + } + + /* Mark as I/O up to next RAM region. */ for ( ; pfn < rstart_pfn; pfn++ ) { BUG_ON(!mfn_valid(pfn)); share_xen_page_with_guest( mfn_to_page(pfn), dom_io, XENSHARE_writable); } + /* Skip the RAM region. */ pfn = rend_pfn; } - BUG_ON(pfn != max_page); subarch_init_memory(); } _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |