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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 allowed to be overlapped here otherwise is
> "undefined behavior". For example if the types are MTRR_TYPE_WRPROT
> and MTRR_TYPE_WRTHROUGH, min() will get MTRR_TYPE_WRTHROUGH rather than
> "undefined behavior".

Choosing MTRR_TYPE_WRTHROUGH is one example of achieve undefined
behavior.  Picking one type arbitrarily is just a different kind of
undefined behavior.

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




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux