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

Re: [Xen-devel] [PATCH][VTD] bug fix for EPT/VT-d table sharing


  • To: "Kay, Allen M" <allen.m.kay@xxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
  • From: Keir Fraser <keir@xxxxxxx>
  • Date: Mon, 10 Jan 2011 08:38:50 +0000
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Tim Deegan <Tim.Deegan@xxxxxxxxxx>
  • Delivery-date: Mon, 10 Jan 2011 00:39:56 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:cc:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; b=qpb2iM8NZ7SnBIWZPI0EQe7Qn4M4FYijmFo4zZTZumNmYGt94XcczG6GfSiSb7Ql4Y CkWbqPgi9M2QmoErpfOfkbJ0C+gRgvYZl9kZk826uUZLIPCKCr+Vqjv8eY0ELmVx1s0E 5rDlQWpfk6XSYNu6CnKTrPEx69Xtx/BTTfXTA=
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: AcuuRGZL3dWQ33n7QXyYSqKopMgRvAAVu1fgAIGejHQ=
  • Thread-topic: [Xen-devel] [PATCH][VTD] bug fix for EPT/VT-d table sharing

I'll apply this when Jan Acks it.

 -- Keir

On 07/01/2011 18:55, "Kay, Allen M" <allen.m.kay@xxxxxxxxx> wrote:

> Thanks for catching this.  After I change the iommu_flush_iotlb_psi()
> parameter from page_shift to order, I forgot revisit the callers for non
> shared cases.
> 
> I have fixed them in attached patch.
> 
> Allen
> 
> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@xxxxxxxxxx]
> Sent: Friday, January 07, 2011 12:25 AM
> To: Kay, Allen M
> Cc: Tim Deegan; xen-devel@xxxxxxxxxxxxxxxxxxx; Keir Fraser
> Subject: RE: [Xen-devel] [PATCH][VTD] bug fix for EPT/VT-d table sharing
> 
>>>> On 07.01.11 at 03:49, "Kay, Allen M" <allen.m.kay@xxxxxxxxx> wrote:
> 
> With this
> 
>> @@ -548,17 +533,12 @@ static int inline iommu_flush_iotlb_psi(
>>     if ( !cap_pgsel_inv(iommu->cap) )
>>         return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry,
>> flush_dev_iotlb);
>> 
>> -    /*
>> -     * PSI requires page size is 2 ^ x, and the base address is naturally
>> -     * aligned to the size
>> -     */
>> -    align = get_alignment(addr >> PAGE_SHIFT_4K, pages);
>>     /* Fallback to domain selective flush if size is too big */
>> -    if ( align > cap_max_amask_val(iommu->cap) )
>> +    if ( order > cap_max_amask_val(iommu->cap) )
>>         return iommu_flush_iotlb_dsi(iommu, did, flush_non_present_entry,
>> flush_dev_iotlb);
>> 
>> -    addr >>= PAGE_SHIFT_4K + align;
>> -    addr <<= PAGE_SHIFT_4K + align;
>> +    addr >>= PAGE_SHIFT_4K + order;
>> +    addr <<= PAGE_SHIFT_4K + order;
>> 
>>     /* apply platform specific errata workarounds */
>>     vtd_ops_preamble_quirk(iommu);
> 
> I suppose that here
> 
>> @@ -635,7 +615,8 @@ static void dma_pte_clear_one(struct dom
>>             if ( iommu_domid == -1 )
>>                 continue;
>>             if ( iommu_flush_iotlb_psi(iommu, iommu_domid,
>> -                                       addr, 1, 0, flush_dev_iotlb) )
>> +                                       addr, 1, PAGE_SHIFT_4K,
>> +                                       0, flush_dev_iotlb) )
>>                 iommu_flush_write_buffer(iommu);
>>         }
>>     }
>> @@ -1711,6 +1692,7 @@ static int intel_iommu_map_page(
>>             continue;
>>         if ( iommu_flush_iotlb_psi(iommu, iommu_domid,
>>                                    (paddr_t)gfn << PAGE_SHIFT_4K, 1,
>> +                                   PAGE_SHIFT_4K,
>>                                    !dma_pte_present(old), flush_dev_iotlb) )
>>             iommu_flush_write_buffer(iommu);
>>     }
> 
> you need to pass 0 instead of PAGE_SHIFT_4K.
> 
> Jan
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

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