Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1252859imu; Wed, 23 Jan 2019 13:28:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN4G78EEFeWr9T+82QkRC4fHYIOLfh6NqdQO2TPqNXAnkFFFvfTUvDrc031IS4oRDMmG0zIa X-Received: by 2002:a17:902:981:: with SMTP id 1mr3843673pln.142.1548278899379; Wed, 23 Jan 2019 13:28:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548278899; cv=none; d=google.com; s=arc-20160816; b=Gft9nT3n7Y+kWJtwoDcbFEMl+bJIjFh5D4f+GsqNHHF+NWrkqk34aQufzd9229t+3h +DCSdPbazXyq6WcjcE/BZA/ArxvtZbbjmNA60LYin+SfTvqas58/3CB4v5UhWfcqu/QL cEOGq7rcEMISIsdgXHp1P7LQItKxx+PH+PKIWoXdNycMQ0KAiO45cFfuYpuyrfoNcL6H xy9Uw1671n8Qp6zvLQQfk9Hrhbr6urJ4uuSc0qY7dL2AJKUnLItkxTdYhQ/htUkHlrH3 XERUN9Fr/30NlY21QzsAImckttvMc8nessYv6sCYLA6BYObkCeDTFLfTSlCOy3eOtLa8 7mcg== 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=3JkTIBcvNU3RBVDqxLwL91VG53HeOdfPYXoNUdZWeDA=; b=LqWUODc14c58XxFB2Nnc93F/rfrZcvMHV6rjXc5kuHkr1WntvIof7jrC2eQyx7pEN6 v6HdwoTIz3pkawlfDYjK/X878D2fYjJRowu6qvnQ7I7l6Lm/R9RS+Upvz40FEJMwaUVi kcb5Nr1HArW9zo+F2h8jLctRoPwRpBaypn82UyoWZ7YFFx4HK3OpD7g3kGWswclgDS7l fnBBlQAUdQgX8F5JZ1uaJ9fHBXVMK+jTEOOBgCgR5p3RQmGYL87J8n8Hz4zbt9/41twQ gqguQawYdPHfoIRp1wPE6o+WFKkt2SpydbRqsMK8M8U6NfH6yPiRFidReUhHMaiOVl5l 56Zw== 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 a193si13292122pfa.214.2019.01.23.13.28.03; Wed, 23 Jan 2019 13:28:19 -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 S1726821AbfAWV15 (ORCPT + 99 others); Wed, 23 Jan 2019 16:27:57 -0500 Received: from verein.lst.de ([213.95.11.211]:44982 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726352AbfAWV15 (ORCPT ); Wed, 23 Jan 2019 16:27:57 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 457C168CEC; Wed, 23 Jan 2019 22:27:55 +0100 (CET) Date: Wed, 23 Jan 2019 22:27:55 +0100 From: Christoph Hellwig To: Joerg Roedel Cc: "Michael S . Tsirkin" , Jason Wang , Konrad Rzeszutek Wilk , Christoph Hellwig , 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: <20190123212755.GA9032@lst.de> References: <20190123163049.24863-1-joro@8bytes.org> <20190123163049.24863-3-joro@8bytes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190123163049.24863-3-joro@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 Wed, Jan 23, 2019 at 05:30:46PM +0100, Joerg Roedel wrote: > +bool is_swiotlb_active(void) > +{ > + return !no_iotlb_memory; > +} 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.