diff -r fdf7025207e6 xen/arch/x86/e820.c --- a/xen/arch/x86/e820.c Tue Apr 28 13:51:20 2009 +0100 +++ b/xen/arch/x86/e820.c Tue Apr 28 15:13:13 2009 +0100 @@ -19,6 +19,10 @@ static int __initdata opt_no_mtrr_check = 0; boolean_param("nomtrr", opt_no_mtrr_check); +/* opt_e820_verbose: Be verbose about clipping, the original e820, &c */ +static int __initdata opt_e820_verbose = 0; +boolean_param("e820_verbose", opt_e820_verbose); + struct e820map e820; static void __init add_memory_region(unsigned long long start, @@ -328,6 +332,10 @@ { int i; char _warnmsg[160]; + int cur_limit; + + i = e820.nr_map-1; + cur_limit = e820.map[i].addr + e820.map[i].size; for ( i = 0; i < e820.nr_map; i++ ) { @@ -338,8 +346,8 @@ snprintf(_warnmsg, sizeof(_warnmsg), warnmsg, (long)(limit>>30)); printk("WARNING: %s\n", _warnmsg); } - printk("Truncating memory map to %lukB\n", - (unsigned long)(limit >> 10)); + printk("Truncating memory map from %lukB to %lukB\n", + (unsigned long)(cur_limit >> 10), (unsigned long)(limit >> 10)); if ( e820.map[i].addr >= limit ) { e820.nr_map = i; @@ -361,6 +369,8 @@ uint64_t mtrr_cap, mtrr_def, addr_mask, base, mask, top; unsigned int i, phys_bits = 36; + printk("Checking MTRR ranges...\n"); + /* Does the CPU support architectural MTRRs? */ cpuid(0x00000001, &eax, &ebx, &ecx, &edx); if ( !test_bit(X86_FEATURE_MTRR & 31, &edx) ) @@ -378,6 +388,9 @@ rdmsrl(MSR_MTRRcap, mtrr_cap); rdmsrl(MSR_MTRRdefType, mtrr_def); + if ( opt_e820_verbose ) + printk(" MTRR cap: %lx type: %lx\n", mtrr_cap, mtrr_def); + /* MTRRs enabled, and default memory type is not writeback? */ if ( !test_bit(11, &mtrr_def) || ((uint8_t)mtrr_def == MTRR_TYPE_WRBACK) ) return 0; @@ -391,6 +404,10 @@ { rdmsrl(MSR_MTRRphysBase(i), base); rdmsrl(MSR_MTRRphysMask(i), mask); + + if ( opt_e820_verbose ) + printk(" MTRR[%d]: base %lx mask %lx\n", i, base, mask); + if ( !test_bit(11, &mask) || ((uint8_t)base != MTRR_TYPE_WRBACK) ) continue; base &= addr_mask; @@ -550,6 +567,11 @@ unsigned long __init init_e820( const char *str, struct e820entry *raw, int *raw_nr) { + if ( opt_e820_verbose ) + { + printk("Initial %s RAM map:\n", str); + print_e820_memory_map(raw, *raw_nr); + } machine_specific_memory_setup(raw, raw_nr); printk("%s RAM map:\n", str); print_e820_memory_map(e820.map, e820.nr_map);