On 08/22/2013 07:11 PM, Paolo Bonzini wrote:
> Il 22/08/2013 10:20, Alexey Kardashevskiy ha scritto:
>>      iova = TARGET_PAGE_ALIGN(section->offset_within_address_space);
>> -    end = (section->offset_within_address_space + 
>> int128_get64(section->size)) &
>> -          TARGET_PAGE_MASK;
>> +    llend = int128_make64(section->offset_within_address_space);
>> +    llend = int128_add(llend, section->size);
>> +    llend = int128_and(llend, int128_exts64(TARGET_PAGE_MASK));
>>  
>> -    if (iova >= end) {
>> +    if (int128_ge(int128_make64(iova), llend)) {
>>          return;
>>      }
>>  
>> +    end = (section->offset_within_address_space + 
>> int128_get64(section->size)) &
>> +          TARGET_PAGE_MASK;
>> +
> 
> This can still fail for section->size = 2^64.  Do your IOMMU patches
> take care of it?

Nope. That part works for IOMMU mapped to RAM which is smaller than 2^64
bytes and therefore I do not see why we would need 2^64 bits sizes there.
Either way, I cannot test it quick (yes, I know, I should have some x86
VFIO setup by hand as everyone has a lot of x86, etc...) so I decided to
leave to the moment when x86 folks hit the problem :)


-- 
Alexey

Reply via email to