From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: per-device dma_map_ops for intel-iommu? Date: Thu, 11 Apr 2019 15:57:49 +0200 Message-ID: <20190411135749.GE4518@8bytes.org> References: <20190409135924.GA11431@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: David Woodhouse Cc: Christoph Hellwig , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org List-Id: iommu@lists.linux-foundation.org On Tue, Apr 09, 2019 at 05:03:52PM +0300, David Woodhouse wrote: > On Tue, 2019-04-09 at 15:59 +0200, Christoph Hellwig wrote: > > Hi David and Joerg, > > > > do you remember a good reason why intel-iommu is not using per-device > > dma_map_ops like the AMD iommu or the various ARM iommus? > > > > Right now intel-iommu.c contains a half-asses reimplementation of the > > dma direct code for the iommu_no_mapping() case, and it would seem > > much nicer to just fall back to that case and not even call into > > intel-iommu in that case. > > Other than the complexities about passthrough mode and various "oh shit > we forgot to actually test that iommu+gfx actually works before > shipping hardware" type of quirks that bypass the IOMMU for certain > devices — and retpolines, which I think you already dealt with — no, no > good reason that I recall. Same here, I looked into this in the past as well, but I can't recall any reason this was left in place. Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52415C10F13 for ; Thu, 11 Apr 2019 13:58:57 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2398B2077C for ; Thu, 11 Apr 2019 13:58:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2398B2077C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=8bytes.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A3DBC27CE; Thu, 11 Apr 2019 13:58:56 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id E44B0254F for ; Thu, 11 Apr 2019 13:57:52 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 801D163D for ; Thu, 11 Apr 2019 13:57:52 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id C0AD442D; Thu, 11 Apr 2019 15:57:50 +0200 (CEST) Date: Thu, 11 Apr 2019 15:57:49 +0200 From: Joerg Roedel To: David Woodhouse Subject: Re: per-device dma_map_ops for intel-iommu? Message-ID: <20190411135749.GE4518@8bytes.org> References: <20190409135924.GA11431@lst.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Cc: iommu@lists.linux-foundation.org, Christoph Hellwig , linux-kernel@vger.kernel.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: base64 Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-b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