Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2615147yba; Mon, 22 Apr 2019 09:52:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwzP1PgbHhhPG9e/hY1cpW9rYl2nNhYbMTEGbHv5HSP/60bPdRCs11e2pSdEzpzvI0fvAFz X-Received: by 2002:a17:902:e610:: with SMTP id cm16mr18933630plb.189.1555951929651; Mon, 22 Apr 2019 09:52:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555951929; cv=none; d=google.com; s=arc-20160816; b=Qg1g9ERBqhVMoQrS8CnUtUe2SddsWK/nAm0K6CMMJ/wEPCIlJATgBaqjg7U+N6L5kk 8h2lfZw1DjvASQeCZRoeNR9LkH42k1RtmOJbijZdHUaAm5zXfcagJ89ZBVEzDAkGC8OE 2qgZCy5SRhNsvdALt24hkoLB1IfIjevv0Kg/tProxCvO8wjo4I9Dl1AfM1oLAcbRfnyH 2fBohoNUHOhrLJshQ59PtRQTwD3AkY/GJMdTio6jIgutjnSpsPpRb7hi5ILY+WSKm7eS ajdJ7XB+yFoLnpX873aliB6NulEvFsdLlzaz+5NtIxH1YJ1c80ZPQjucLH8b6rhq3XPg Yhhw== 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=iGlDiyNuWOkHS6divUAgTUnDnvzQjft8Usx6HeaF+Gs=; b=avZUbC6wyw1s4BKXVoiNKOkfd1lFZeF9BHIvBYW3k4cspJ8SlLIXCzKzTnmuBelqUX 4fEPE2keDGRJUOfd1uiSaJM/eL5YoLdg2AEsKEz0spxvmx+M43OJOCNHMp7UiLbHkFbo WYUSRF4trh/vT9p1fqsYuWj2PJOJY7m55dB/yMg0b2SkUAW+by5gM0/phuw0ZowmR2J1 skMt/ZF/bSR/HWSPoljOk6XzLvM1y9cDksmjSES1l8XdNxm2uItEv6gE+PkPr79tUiZZ ezBh5a0PLstG7CuvtIdm1QkgRVrMFHamW+ujgehhAr3advUmY7EU6+pNYs4ySsVPuLY6 lOdw== 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 z6si13360497pln.54.2019.04.22.09.51.54; Mon, 22 Apr 2019 09:52:09 -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 S1728194AbfDVQsL (ORCPT + 99 others); Mon, 22 Apr 2019 12:48:11 -0400 Received: from verein.lst.de ([213.95.11.211]:40564 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726305AbfDVQsL (ORCPT ); Mon, 22 Apr 2019 12:48:11 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 2875068AFE; Mon, 22 Apr 2019 18:47:56 +0200 (CEST) Date: Mon, 22 Apr 2019 18:47:55 +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 Subject: Re: [PATCH v3 08/10] iommu/vt-d: Check whether device requires bounce buffer Message-ID: <20190422164755.GC31181@lst.de> References: <20190421011719.14909-1-baolu.lu@linux.intel.com> <20190421011719.14909-9-baolu.lu@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190421011719.14909-9-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:17AM +0800, Lu Baolu wrote: > +static inline bool device_needs_bounce(struct device *dev) > +{ > + struct pci_dev *pdev = NULL; > + > + if (intel_no_bounce) > + return false; > + > + if (dev_is_pci(dev)) > + pdev = to_pci_dev(dev); > + > + return pdev ? pdev->untrusted : false; > +} Again, this and the option should not be in a specific iommu driver.