From: Lu Baolu Subject: Re: [PATCH v3 08/10] iommu/vt-d: Check whether device requires bounce buffer Date: Tue, 23 Apr 2019 10:03:28 +0800 Message-ID: <76e35340-32c3-ee0d-5232-bd8800248402@linux.intel.com> References: <20190421011719.14909-1-baolu.lu@linux.intel.com> <20190421011719.14909-9-baolu.lu@linux.intel.com> <20190422164755.GC31181@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20190422164755.GC31181-jcswGhMUV9g@public.gmane.org> Content-Language: en-US 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: Christoph Hellwig Cc: kevin.tian-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, ashok.raj-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, Konrad Rzeszutek Wilk , alan.cox-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, Robin Murphy , iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, pengfei.xu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, jacob.jun.pan-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, David Woodhouse List-Id: iommu@lists.linux-foundation.org Hi, On 4/23/19 12:47 AM, Christoph Hellwig wrote: > 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. > The option of whether bounce is ignored should be in the specific iommu driver. Or any other thought? Best regards, Lu Baolu