Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5844337yba; Thu, 11 Apr 2019 07:00:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxM+Zw2gQzYIEZsPENiKSoHeATAJj1qEMmNn3RpInd+6L4wOCnvEKGImjyVUZogmAburSCt X-Received: by 2002:a63:e818:: with SMTP id s24mr46955681pgh.190.1554991216384; Thu, 11 Apr 2019 07:00:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554991216; cv=none; d=google.com; s=arc-20160816; b=QdC9M5nvMLuSW/qdX1UYUrXJrv1ch5iGmrC1oBz31pIEcXmSDe3G4X0qLU/nL98WJq Ucb4GgdynT83n6A/96Sj3BY68t5J5DoMYuXTP1nmimdvWOnWB/+WNUH3OlZcL3JIdccL JN0WBWmPb+KI4K31JKb399jXRkuJVzp2nWMQRdMteB8nHGyx31xNBHEAmWQP7dk9ene8 dX6F6O37nLQbSjHRXCCY+dp++XkrMOzyXDYhE2BdnYxGP5zrBvKszuxABgqIuN7jFS6n EwsXcOmAnoFzfW2zOjUNz5o49L3fEqglhpS8LbpZQWgONZh5OGKCVlNpXwCHVL62+euU ZtnA== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=rer8AZ7sjS97tTTRe71ILZVl7yqIvLt4v/PlQcpMirM=; b=rOXoFGxC+PJrCCPZPSt3VaYswcGj7nYsULplUCW/cQGNOq3dLUTKh4f+Cdi0SrqwLK tTTg6IptwUDGlwuJo7NLoN7y6Xb+81r11aclZuzpK6fQxhYKeFH3ZEma/CGpQcafTitw 5w6RsjOrLVYMiZuG7PBNyZK5E/4adr0H2J3r9CVi1NCxEHKnGYXrF6UaAiFraF136KXm VlReJUqL2AQzO747bO6yXFHjHMWl8fU0bDH+apRjhE6dA6W4O/OG/g9Zbg+ZS9crPUQe XiFHnp+Ga7d655pmpPx1i2VSaGLQylBjS8ziM/hilpkyxWUo7ZKVymXN8c/Jl+ym/lXI 4Vew== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h40si12529096plb.261.2019.04.11.07.00.00; Thu, 11 Apr 2019 07:00:16 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726655AbfDKN5w (ORCPT + 99 others); Thu, 11 Apr 2019 09:57:52 -0400 Received: from 8bytes.org ([81.169.241.247]:34140 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726106AbfDKN5w (ORCPT ); Thu, 11 Apr 2019 09:57:52 -0400 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 Cc: Christoph Hellwig , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org 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-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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