From: Jean Guyader Subject: Re: [PATCH 1/6] vtd: Refactor iotlb flush code Date: Tue, 8 Nov 2011 07:42:25 +0000 Message-ID: <20111108074225.GA7257@spongy.cam.xci-test.com> References: <1320690327-12649-1-git-send-email-jean.guyader@eu.citrix.com> <1320690327-12649-2-git-send-email-jean.guyader@eu.citrix.com> <987664A83D2D224EAE907B061CE93D530206CE00D0@orsmsx505.amr.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <987664A83D2D224EAE907B061CE93D530206CE00D0@orsmsx505.amr.corp.intel.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Kay, Allen M" Cc: "xen-devel@lists.xensource.com" , "Tim (Xen.org)" , Jean Guyader List-Id: xen-devel@lists.xenproject.org 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@eu.citrix.com] > Sent: Monday, November 07, 2011 10:25 AM > To: xen-devel@lists.xensource.com > Cc: tim@xen.org; 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 > --- > xen/drivers/passthrough/vtd/iommu.c | 86 +++++++++++++++++----------------- > 1 files changed, 43 insertions(+), 43 deletions(-) >