Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2615130yba; Mon, 22 Apr 2019 09:52:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVAAxBCUcjBDBeKyh3ZtbiFp+PhjcIQxnsP7DueVTnA0PtqOsD2NL1G1BweJBw6ATgy5LZ X-Received: by 2002:a63:e20b:: with SMTP id q11mr20411225pgh.263.1555951928577; Mon, 22 Apr 2019 09:52:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555951928; cv=none; d=google.com; s=arc-20160816; b=dmVof5fqXz7EM7aeo8+KZZIZ8XfUNL97J6r3OTc1yjfmqmsyRgv5fNBwmbWi0dIi3V o4yRFkJxNLtw07fOwdUnVI/F7rjSo3W6hFUSmPu97++YC4EDL+VV4kh9ic/6kW1OWru7 wdZXKKlHTzysAZIZEKnZpOEvY3C3SnRueeT0ekHpcpMBgx3Im5uz0HD0hxROtzAPnGk/ CdmgnND0y+gg9JziUYbjoQ40PW0awFoIdTbMSqwChPUPD+K6D/2cHSeZCvxESEjnYNSQ F0Srqo7Pnd1uaCy1CYrCdXnZ6sYhEuC/ohHMg8qeqJOprB4ymO0iAKn1j6mLyzNKWNxx oENA== 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=/eatErTXQgO9/fUyYc0KhCiX9NTBEoYC/d9UpGuW4Ts=; b=PC1QnRSyYjvlFqzop/6hG3pOsYmCN6/r75tyWSKk9fZdUaWEfPkBzRzL7/1ELBfudm LQr89JDVlA0mpMsi+leKZNlWhSGFtgMQGW/aGJb9rgRfVg0Xx/JDjLMkxiWlRK+D1K8R 0RLuVAE0xWNSFEwU7EKdBH0uHsF8GyItgOaW1cyvNhG9/+qNF9srRflcOfsEtvayUeHR th+6QDWZSj035Q6CdjMwxAc4ZrtN6F0pLer1Zi/QTWuyCZJqT5RTSwKjl90LiRz6Rn2U roRmeE9AC6ef+su1tHd5gGR7FsRlGlLQxZWr1ro3woAwZ6xij3uZWZ9PqQhSIAz2oofS yL9A== 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 a17si13604731pfn.95.2019.04.22.09.51.52; Mon, 22 Apr 2019 09:52:08 -0700 (PDT) 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 S1728158AbfDVQrg (ORCPT + 99 others); Mon, 22 Apr 2019 12:47:36 -0400 Received: from verein.lst.de ([213.95.11.211]:40554 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbfDVQrg (ORCPT ); Mon, 22 Apr 2019 12:47:36 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 29FD568AFE; Mon, 22 Apr 2019 18:47:21 +0200 (CEST) Date: Mon, 22 Apr 2019 18:47:20 +0200 From: Christoph Hellwig To: Lu Baolu Cc: David Woodhouse , Joerg Roedel , ashok.raj@intel.com, jacob.jun.pan@intel.com, alan.cox@intel.com, kevin.tian@intel.com, mika.westerberg@linux.intel.com, pengfei.xu@intel.com, Konrad Rzeszutek Wilk , Christoph Hellwig , Marek Szyprowski , Robin Murphy , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Jacob Pan , Mika Westerberg Subject: Re: [PATCH v3 07/10] iommu/vt-d: Keep swiotlb on if bounce page is necessary Message-ID: <20190422164720.GB31181@lst.de> References: <20190421011719.14909-1-baolu.lu@linux.intel.com> <20190421011719.14909-8-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190421011719.14909-8-baolu.lu@linux.intel.com> 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 Sun, Apr 21, 2019 at 09:17:16AM +0800, Lu Baolu wrote: > +static inline bool platform_has_untrusted_device(void) > { > + bool has_untrusted_device = false; > struct pci_dev *pdev = NULL; > > for_each_pci_dev(pdev) { > if (pdev->untrusted) { > + has_untrusted_device = true; > break; > } > } > > + return has_untrusted_device; This shouldn't really be in the intel-iommu driver, should it? This probably should be something like pci_has_untrusted_devices and be moved to the PCI code.