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

[Xen-devel] RE: [PATCH 1/6] vtd: Refactor iotlb flush code

To: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
Subject: [Xen-devel] RE: [PATCH 1/6] vtd: Refactor iotlb flush code
From: "Kay, Allen M" <allen.m.kay@xxxxxxxxx>
Date: Tue, 8 Nov 2011 18:41:43 -0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Tim \(Xen.org\)" <tim@xxxxxxx>, Jean Guyader <Jean.Guyader@xxxxxxxxxx>
Delivery-date: Tue, 08 Nov 2011 18:42:58 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20111108074225.GA7257@xxxxxxxxxxxxxxxxxxxxxxx>
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>
References: <1320690327-12649-1-git-send-email-jean.guyader@xxxxxxxxxxxxx> <1320690327-12649-2-git-send-email-jean.guyader@xxxxxxxxxxxxx> <987664A83D2D224EAE907B061CE93D530206CE00D0@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20111108074225.GA7257@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acyd6f7EAS5GJ2oGTlGzSFmV66xijgAnlrmQ
Thread-topic: [PATCH 1/6] vtd: Refactor iotlb flush code
Jean,

Page 122 of VT-d spec indicates you can invalidate multiple pages by setting 
the Address Mask (AM) field.  Will this achieve what you wanted to do?

http://download.intel.com/technology/computing/vptech/Intel(r)_VT_for_Direct_IO.pdf

Allen

-----Original Message-----
From: Jean Guyader [mailto:jean.guyader@xxxxxxxxxxxxx] 
Sent: Monday, November 07, 2011 11:42 PM
To: Kay, Allen M
Cc: Jean Guyader; xen-devel@xxxxxxxxxxxxxxxxxxx; Tim (Xen.org)
Subject: Re: [PATCH 1/6] vtd: Refactor iotlb flush code


Allen,

You are probably talking about __intel_iommu_iotlb_flush.
This function takes a range of address to flush. I haven't found a function in 
the vtd code to invalidate a range on address without doing a loop of 
flush_iotlb_psi, so I thought that the most efficient and quick way to flush a 
range would be to use a domain selective invalidation.

Jean

On 08/11 03:10, Kay, Allen M wrote:
> Jean,
> 
> The original code does not call iommu_flush_iotlb_dsi().  What is the reason 
> the refractored code need to use domain selective invalidation?
> 
> Allen
> -----
> 
> +        if ( page_count > 1 || gfn == -1 )
> +        {
> +            if ( iommu_flush_iotlb_dsi(iommu, iommu_domid,
> +                        0, flush_dev_iotlb) )
> +                iommu_flush_write_buffer(iommu);
> +        }
> +        else
> +        {
> +            if ( iommu_flush_iotlb_psi(iommu, iommu_domid,
> +                        (paddr_t)gfn << PAGE_SHIFT_4K, 0,
> +                        !dma_old_pte_present, flush_dev_iotlb) )
> +                iommu_flush_write_buffer(iommu);
> 
> -----Original Message-----
> From: Jean Guyader [mailto:jean.guyader@xxxxxxxxxxxxx]
> Sent: Monday, November 07, 2011 10:25 AM
> To: xen-devel@xxxxxxxxxxxxxxxxxxx
> Cc: tim@xxxxxxx; Kay, Allen M; Jean Guyader
> Subject: [PATCH 1/6] vtd: Refactor iotlb flush code
> 
> 
> Factorize the iotlb flush code from map_page and unmap_page into it's own 
> function.
> 
> Signed-off-by: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>
> ---
>  xen/drivers/passthrough/vtd/iommu.c |   86 +++++++++++++++++-----------------
>  1 files changed, 43 insertions(+), 43 deletions(-)
> 

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