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

Re: [Xen-devel] [PATCH v3] IOMMU: Prevent VT-d device IOTLB operations on wrong IOMMU



On 17/06/14 16:06, Jan Beulich wrote:
>>>> On 17.06.14 at 16:37, <malcolm.crossley@xxxxxxxxxx> wrote:
>> --- a/xen/drivers/passthrough/vtd/x86/ats.c
>> +++ b/xen/drivers/passthrough/vtd/x86/ats.c
>> @@ -120,6 +120,10 @@ int dev_invalidate_iotlb(struct iommu *i
>>      {
>>          sid = (pdev->bus << 8) | pdev->devfn;
>>  
>> +        /* Only invalidate devices that belong to this IOMMU */
>> +        if ( !pdev->iommu || pdev->iommu != iommu )
>> +            continue;
> 
> I meant to ask before and then forgot: What is the first half of this
> condition good/needed for?
>
Defensive coding to prevent a NULL pointer deference if the Intel or
core ATS code goes wrong.

Malcolm

> Jan
> 


_______________________________________________
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®.