WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

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>
Subject: Re: [Xen-devel] [PATCH][VTD] bug fix for EPT/VT-d table sharing
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
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:user-agent:date :subject:from:to:cc:message-id:thread-topic:thread-index:in-reply-to :mime-version:content-type:content-transfer-encoding; bh=DKou0PU/3sARCIkCUzYu3nTSfNdx2HwJcTK7JlaIT3I=; b=Zv0e86lZt3ch2cP5c9IunqIXm099R4Lv2r8w8mK5/WtdXdB+xkh0tO3+ortcE3Gljb i4tZB18EiR3fFXtOjNx4tVgajehOAU0RMHd/exgO+ngrqQCobwZlAKWIGysCXIOoimta Wh5yC8ih1cLIzljUI7COFWsBZjGuK5G7vaoMU=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <987664A83D2D224EAE907B061CE93D53019401026E@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcuuRGZL3dWQ33n7QXyYSqKopMgRvAAVu1fgAIGejHQ=
Thread-topic: [Xen-devel] [PATCH][VTD] bug fix for EPT/VT-d table sharing
User-agent: Microsoft-Entourage/12.27.0.100910
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