Re: [PATCH 12/15] KVM: MTRR: introduce mtrr_for_each_mem_type

2015-06-08 Thread David Matlack
On Sat, May 30, 2015 at 3:59 AM, Xiao Guangrong guangrong.x...@linux.intel.com wrote: It walks all MTRRs and gets all the memory cache type setting for the specified range also it checks if the range is fully covered by MTRRs Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com ---

Re: [PATCH 12/15] KVM: MTRR: introduce mtrr_for_each_mem_type

2015-06-08 Thread Xiao Guangrong
On 06/09/2015 08:36 AM, David Matlack wrote: On Sat, May 30, 2015 at 3:59 AM, Xiao Guangrong guangrong.x...@linux.intel.com wrote: It walks all MTRRs and gets all the memory cache type setting for the specified range also it checks if the range is fully covered by MTRRs Signed-off-by: Xiao

Re: [PATCH 12/15] KVM: MTRR: introduce mtrr_for_each_mem_type

2015-06-02 Thread Xiao Guangrong
On 06/01/2015 05:33 PM, Paolo Bonzini wrote: On 30/05/2015 12:59, Xiao Guangrong wrote: +struct mtrr_looker { + /* input fields. */ + struct kvm_mtrr *mtrr_state; + u64 start; + u64 end; s/looker/iter/ or s/looker/lookup/ Good to me. +static void

Re: [PATCH 12/15] KVM: MTRR: introduce mtrr_for_each_mem_type

2015-06-02 Thread Xiao Guangrong
On 06/01/2015 10:26 PM, Paolo Bonzini wrote: On 01/06/2015 11:33, Paolo Bonzini wrote: + looker-mem_type = looker-mtrr_state-fixed_ranges[index]; + looker-start = fixed_mtrr_range_end_addr(seg, index); + return true; in mtrr_lookup_fixed_start is the same as this: +

Re: [PATCH 12/15] KVM: MTRR: introduce mtrr_for_each_mem_type

2015-06-01 Thread Paolo Bonzini
On 30/05/2015 12:59, Xiao Guangrong wrote: +struct mtrr_looker { + /* input fields. */ + struct kvm_mtrr *mtrr_state; + u64 start; + u64 end; s/looker/iter/ or s/looker/lookup/ +static void mtrr_lookup_start(struct mtrr_looker *looker) +{ + looker-mem_type = -1; +

Re: [PATCH 12/15] KVM: MTRR: introduce mtrr_for_each_mem_type

2015-06-01 Thread Paolo Bonzini
On 01/06/2015 11:33, Paolo Bonzini wrote: +looker-mem_type = looker-mtrr_state-fixed_ranges[index]; + looker-start = fixed_mtrr_range_end_addr(seg, index); + return true; in mtrr_lookup_fixed_start is the same as this: + end = fixed_mtrr_range_end_addr(looker-seg,

[PATCH 12/15] KVM: MTRR: introduce mtrr_for_each_mem_type

2015-05-30 Thread Xiao Guangrong
It walks all MTRRs and gets all the memory cache type setting for the specified range also it checks if the range is fully covered by MTRRs Signed-off-by: Xiao Guangrong guangrong.x...@linux.intel.com --- arch/x86/kvm/mtrr.c | 183 1 file