lkml.org 
[lkml]   [2015]   [May]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/9] KVM: MMU: fix decoding cache type from MTRR


On 05/07/2015 05:42 AM, David Matlack wrote:
> On Thu, Apr 30, 2015 at 3:24 AM, <guangrong.xiao@linux.intel.com> wrote:
>> From: Xiao Guangrong <guangrong.xiao@linux.intel.com>
>>
>> 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)

Oh, i counted the bit from 1, my fault. :(

>
>> 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)

Ditto. Will update the changelog in v2. Thank you for pointing it out.

>
>> 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.
>

Yeah, that confused me. Based on the comment of vmx_get_mt_mask():
* a. VT-d without snooping control feature: can't guarantee the
* result, try to trust guest.
we need to completely follow guest's MTRR under this case.


\
 
 \ /
  Last update: 2015-05-07 04:21    [W:0.060 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site