From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 2/5] swiotlb: Add is_swiotlb_active() function Date: Thu, 24 Jan 2019 09:41:07 +0100 Message-ID: <20190124084107.GA19441@lst.de> References: <20190123163049.24863-1-joro@8bytes.org> <20190123163049.24863-3-joro@8bytes.org> <20190123212755.GA9032@lst.de> <20190124082923.GI32526@8bytes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20190124082923.GI32526-zLv9SwRftAIdnm+yROfE0A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Joerg Roedel Cc: Jens Axboe , jon.grimm-5C7GfCeVMHo@public.gmane.org, brijesh.singh-5C7GfCeVMHo@public.gmane.org, Konrad Rzeszutek Wilk , Jason Wang , "Michael S . Tsirkin" , jfehlig-IBi9RG/b67k@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, virtualization-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-block-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, jroedel-l3A5Bk7waGM@public.gmane.org, Christoph Hellwig List-Id: iommu@lists.linux-foundation.org On Thu, Jan 24, 2019 at 09:29:23AM +0100, Joerg Roedel wrote: > > As I've just introduced and fixed a bug in this area in the current > > cycle - I don't think no_iotlb_memory is what your want (and maybe > > not useful at all): if the arch valls swiotlb_exit after previously > > initializing a buffer it won't be set. You probably want to check > > for non-zero io_tlb_start and/or io_tlb_end. > > Okay, but that requires that I also set io_tlb_start and friends back to > zero in the failure path of swiotlb_init(). Otherwise it could be left > non-zero in case swiotlb_init_with_tbl() returns an error. Indeed, and we'll need to do that anyway as otherwise the dma mapping path might cause problems similar to the one when swiotlb_exit is called that I fixed.