Re: [PATCH 07/15] KVM: MTRR: improve kvm_mtrr_get_guest_memory_type

2015-06-03 Thread Paolo Bonzini
On 03/06/2015 04:12, Xiao Guangrong wrote: >> >> Perhaps just use type = MIN(type, curr_type), which also happens to get >> WT vs. WB right? You can also add a >> >> BUILD_BUG_ON(MTRR_TYPE_WRTHROUGH > MTRR_TYPE_WRBACK); >> >> to ensure that the WT vs. WB precedence is correct. > > Only WT

Re: [PATCH 07/15] KVM: MTRR: improve kvm_mtrr_get_guest_memory_type

2015-06-03 Thread Paolo Bonzini
On 03/06/2015 04:12, Xiao Guangrong wrote: Perhaps just use type = MIN(type, curr_type), which also happens to get WT vs. WB right? You can also add a BUILD_BUG_ON(MTRR_TYPE_WRTHROUGH MTRR_TYPE_WRBACK); to ensure that the WT vs. WB precedence is correct. Only WT and WB are

Re: [PATCH 07/15] KVM: MTRR: improve kvm_mtrr_get_guest_memory_type

2015-06-02 Thread Xiao Guangrong
On 06/01/2015 05:16 PM, Paolo Bonzini wrote: On 30/05/2015 12:59, Xiao Guangrong wrote: - kvm_mtrr_get_guest_memory_type() only checks one page in MTRRs so that it's unnecessary to check to see if the range is partially covered in MTRR - optimize the check of overlap memory

Re: [PATCH 07/15] KVM: MTRR: improve kvm_mtrr_get_guest_memory_type

2015-06-02 Thread Xiao Guangrong
On 06/01/2015 05:16 PM, Paolo Bonzini wrote: On 30/05/2015 12:59, Xiao Guangrong wrote: - kvm_mtrr_get_guest_memory_type() only checks one page in MTRRs so that it's unnecessary to check to see if the range is partially covered in MTRR - optimize the check of overlap memory

Re: [PATCH 07/15] KVM: MTRR: improve kvm_mtrr_get_guest_memory_type

2015-06-01 Thread Paolo Bonzini
On 30/05/2015 12:59, Xiao Guangrong wrote: > - kvm_mtrr_get_guest_memory_type() only checks one page in MTRRs so that >it's unnecessary to check to see if the range is partially covered in >MTRR > > - optimize the check of overlap memory type and add some comments to explain >the

Re: [PATCH 07/15] KVM: MTRR: improve kvm_mtrr_get_guest_memory_type

2015-06-01 Thread Paolo Bonzini
On 30/05/2015 12:59, Xiao Guangrong wrote: - kvm_mtrr_get_guest_memory_type() only checks one page in MTRRs so that it's unnecessary to check to see if the range is partially covered in MTRR - optimize the check of overlap memory type and add some comments to explain the

[PATCH 07/15] KVM: MTRR: improve kvm_mtrr_get_guest_memory_type

2015-05-30 Thread Xiao Guangrong
- kvm_mtrr_get_guest_memory_type() only checks one page in MTRRs so that it's unnecessary to check to see if the range is partially covered in MTRR - optimize the check of overlap memory type and add some comments to explain the precedence Signed-off-by: Xiao Guangrong ---

[PATCH 07/15] KVM: MTRR: improve kvm_mtrr_get_guest_memory_type

2015-05-30 Thread Xiao Guangrong
- kvm_mtrr_get_guest_memory_type() only checks one page in MTRRs so that it's unnecessary to check to see if the range is partially covered in MTRR - optimize the check of overlap memory type and add some comments to explain the precedence Signed-off-by: Xiao Guangrong