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

Re: [Xen-devel] [PATCH] VT-d/ATS: correct and clean up dev_invalidate_iotlb()



On 25/06/14 11:49, Jan Beulich wrote:
>>>> On 24.06.14 at 18:09, <andrew.cooper3@xxxxxxxxxx> wrote:
>> On 24/06/14 15:25, Jan Beulich wrote:
>>> @@ -133,32 +135,37 @@ int dev_invalidate_iotlb(struct iommu *i
>>>              /* invalidate all translations: sbit=1,bit_63=0,bit[62:12]=1 */
>>>              sbit = 1;
>>>              addr = (~0 << PAGE_SHIFT_4K) & 0x7FFFFFFFFFFFFFFF;
>>> -            ret |= qinval_device_iotlb(iommu, pdev->ats_queue_depth,
>>> -                                       sid, sbit, addr);
>>> +            rc = qinval_device_iotlb(iommu, pdev->ats_queue_depth,
>>> +                                     sid, sbit, addr);
>>>              break;
>>>          case DMA_TLB_PSI_FLUSH:
>>>              if ( !device_in_domain(iommu, pdev, did) )
>>>                  break;
>>>  
>>> -            addr &= ~0 << (PAGE_SHIFT + size_order);
>>> -
>>>              /* if size <= 4K, set sbit = 0, else set sbit = 1 */
>>>              sbit = size_order ? 1 : 0;
>>>  
>>>              /* clear lower bits */
>>> -            addr &= (~0 << (PAGE_SHIFT + size_order));
>>> +            addr &= ~0 << PAGE_SHIFT_4K;
>> Doesn't this need to be ~0ULL as addr is u64?
> No (or else further up in the code shown as context the same
> would need to be done): Conversion here goes via sign-extension
> (effectively int -> int64_t -> uint64_t).
>
> Jan
>

Ok, in which case Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.