On Thu, Apr 30, 2015 at 3:24 AM, <guangrong.xiao@xxxxxxxxxxxxxxx> wrote:
From: Xiao Guangrong <guangrong.xiao@xxxxxxxxxxxxxxx>
There are some bugs in current get_mtrr_type();
1: bit 2 of mtrr_state->enabled is corresponding bit 11 of IA32_MTRR_DEF_TYPE
bit 1, not bit 2. (code is correct though)
MSR which completely control MTRR's enablement that means other bits are
ignored if it is cleared
2: the fixed MTRR ranges are controlled by bit 1 of mtrr_state->enabled (bit 10
bit 0, not bit 1. (code is correct though)
of IA32_MTRR_DEF_TYPE)
3: if MTRR is disabled, UC is applied to all of physical memory rather than
mtrr_state->def_type
kvm_get_guest_memory_type defaults to MTRR_TYPE_WRBACK, not
mtrr_state->def_type, when get_mtrr_type returns 0xFF.