qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 3/3] vfio: Fix 128 bit handling


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v2 3/3] vfio: Fix 128 bit handling
Date: Thu, 22 Aug 2013 13:13:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130805 Thunderbird/17.0.8

Il 22/08/2013 12:41, Alexey Kardashevskiy ha scritto:
> 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.

Understood.  So the IOMMU patches take care of it because this code is
only used for non-IOMMU regions.  Thanks,

Paolo

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]