Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1738101imu; Thu, 24 Jan 2019 00:41:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN5hZR5zZAC2w8nBDhikz0gugqzD89XZVPbXNPv9Ef7d6z0Mn0I76rgtRG6Uy8m4sWfjCkeN X-Received: by 2002:a63:c451:: with SMTP id m17mr5117705pgg.27.1548319309917; Thu, 24 Jan 2019 00:41:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548319309; cv=none; d=google.com; s=arc-20160816; b=ZwaP4ULz/0UQ6QznqcVjTwtyPZuIpL8fVphTHOnqdPDlklw3BZQpSR+/+twVeBnFet I28+AGhUFNE1c/nmBUaYvUxIhvqEZ+Ay626fPoya/WaacvG2EZFiWswlL7Sh5JpUXKJY ZkGzo/YIC3mAR4C07q5Rft5Fi9LlCicf0Y1wYOeP4jXHROk3IpIPbhr37De1Z6/TE3yZ rcFQeks8Wa6bkVvQXdVnV0Hq51v5ogGkja1w2PS3IOyxxvyNMBguqhOhiNt5H9yssQV+ x+yvSDE7ZGtw990GvbqePKpGMbNPRVQaZi9L+kMzJZQZ1np4Bo7h8gcPgkUGNbBbMMI9 2rpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=WVwFca4DALYgBd21pRaiOMyr5A1ds3EyjelNiqhAZMo=; b=DkGrZbi7zOox6sBwPMMcy5FyjoK4borpI5KcKJBWngUPUyzj86jIJ+A2uafeiAr4R4 KCEEZs0G3rMk16Y+BKEO2K9a9PIrN1bLM2++Olf7NByEhAHfM3HJCy0Qh33mhugUbV3O RoyoFoWTc2ayQD79UrXEgco67XMTNTaEe9TmjSiheALNtxiTu+TF0M/LLVYwUAtwTXMZ 29e2ytN5880DMj+JA8NfHPlz8fRzJJyPdJbnEso/UjKiL31c5G56vXsWEmO7orOzorot Qv98u/9rVk5FD3+bZ7ezo+YprZYe6Y61qJuOy8wTNzHfbSuW2zedzkdAdjPYwJAF6E7C dWTw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o3si19949822pgm.441.2019.01.24.00.41.35; Thu, 24 Jan 2019 00:41:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727443AbfAXIlJ (ORCPT + 99 others); Thu, 24 Jan 2019 03:41:09 -0500 Received: from verein.lst.de ([213.95.11.211]:47425 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725986AbfAXIlJ (ORCPT ); Thu, 24 Jan 2019 03:41:09 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id CD90268DD3; Thu, 24 Jan 2019 09:41:07 +0100 (CET) Date: Thu, 24 Jan 2019 09:41:07 +0100 From: Christoph Hellwig To: Joerg Roedel Cc: Christoph Hellwig , "Michael S . Tsirkin" , Jason Wang , Konrad Rzeszutek Wilk , Jens Axboe , virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, jfehlig@suse.com, jon.grimm@amd.com, brijesh.singh@amd.com, jroedel@suse.de Subject: Re: [PATCH 2/5] swiotlb: Add is_swiotlb_active() function 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-Disposition: inline In-Reply-To: <20190124082923.GI32526@8bytes.org> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.