In some virtualization systems like KVM where MTRR registers are not accessible output looks like : MTRR registers: MTRRcap (0xfe): MTRRphysBase0 (0x200): MTRRphysMask0 (0x201): MTRRphysBase1 (0x202): MTRRphysMask1 (0x203): MTRRphysBase2 (0x204): MTRRphysMask2 (0x205): MTRRphysBase3 (0x206): MTRRphysMask3 (0x207): MTRRphysBase4 (0x208): MTRRphysMask4 (0x209): MTRRphysBase5 (0x20a): MTRRphysMask5 (0x20b): MTRRphysBase6 (0x20c): MTRRphysMask6 (0x20d): MTRRphysBase7 (0x20e): MTRRphysMask7 (0x20f): MTRRfix64K_00000 (0x250): MTRRfix16K_80000 (0x258): MTRRfix16K_A0000 (0x259): MTRRfix4K_C8000 (0x269): MTRRfix4K_D0000 0x26a: MTRRfix4K_D8000 0x26b: MTRRfix4K_E0000 0x26c: MTRRfix4K_E8000 0x26d: MTRRfix4K_F0000 0x26e: MTRRfix4K_F8000 0x26f: MTRRdefType (0x2ff): So better return for those cases. Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@xxxxxxxxx> --- mtrr.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/mtrr.c b/mtrr.c index 32b5959..b948f67 100644 --- a/mtrr.c +++ b/mtrr.c @@ -20,11 +20,19 @@ static void dump_mtrr(int cpu, int msr) void dump_mtrrs(struct cpudata *cpu) { + unsigned long long val = 0; unsigned int i; if (!(cpu->flags_edx & (X86_FEATURE_MTRR))) return; + /* + * If MTRR registers are not accessible like in some + * virtualization systems then return + */ + if (!read_msr(cpu->number, 0xfe, &val)) + return; + printf("MTRR registers:\n"); printf("MTRRcap (0xfe): "); -- 1.6.0.6 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html