From: Jean Guyader Subject: Re: [PATCH 2/6] iommu: Introduce iommu_flush and iommu_flush_all. Date: Tue, 8 Nov 2011 10:25:15 +0000 Message-ID: <20111108102515.GA7818@spongy.cam.xci-test.com> References: <1320678999-24995-1-git-send-email-jean.guyader@eu.citrix.com> <1320678999-24995-2-git-send-email-jean.guyader@eu.citrix.com> <1320678999-24995-3-git-send-email-jean.guyader@eu.citrix.com> <4EB8188B020000780005F6E4@novprvoes0310.provo.novell.com> <20111107170601.GB26428@spongy.cam.xci-test.com> <4EB8F549020000780005F87C@novprvoes0310.provo.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Return-path: Content-Disposition: inline In-Reply-To: <4EB8F549020000780005F87C@novprvoes0310.provo.novell.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: Jan Beulich Cc: "Tim (Xen.org)" , "xen-devel@lists.xensource.com" , "allen.m.kay@intel.com" , Jean Guyader List-Id: xen-devel@lists.xenproject.org On 08/11 08:24, Jan Beulich wrote: > >>> On 07.11.11 at 18:06, Jean Guyader wrote: > > On 07/11 04:42, Jan Beulich wrote: > >> >>> On 07.11.11 at 16:16, Jean Guyader wrote: > >> > >> > Signed-off-by: Jean Guyader > >> > --- > >> > xen/drivers/passthrough/iommu.c | 20 ++++++++++++++++++++ > >> > xen/drivers/passthrough/vtd/iommu.c | 12 ++++++++++++ > >> > xen/include/xen/iommu.h | 5 +++++ > >> > 3 files changed, 37 insertions(+), 0 deletions(-) > >> > >> In iommu_iotlb_flush() you check whether the to-be-called function > >> pointer is NULL, whereas in iommu_iotlb_flush_all() you don't. I > >> actually think the second behavior is the correct one, but that > >> implies that you need to also implement respective AMD IOMMU > >> functions. > >> > > > > Yes, It's an error on my part. I've updated the patch to check > > for the present of iotlb_flush_all before I call it now. > > But as said, I don't think this is the right solution: How can it be > correct on non-Intel hardware to have these functions simply do > nothing? > These functions are only here to counter balance the dont_flush_iotlb_flag. If they don't acknowlage this flag doing nothing is the right thing to do. That said I can probably implement a naive version for the AMD iommu that will use amd_iommu_flush_pages once or in a loop. Obviously I will remove the check for the non existing callback if I do that as it become mandatory. Jean