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_HELO_NONE,SPF_PASS,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 A4F8CC282DD for ; Thu, 23 May 2019 10:26:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7E12321019 for ; Thu, 23 May 2019 10:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729698AbfEWK0c (ORCPT ); Thu, 23 May 2019 06:26:32 -0400 Received: from verein.lst.de ([213.95.11.211]:45811 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727434AbfEWK0b (ORCPT ); Thu, 23 May 2019 06:26:31 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 9B4D868AFE; Thu, 23 May 2019 12:26:08 +0200 (CEST) Date: Thu, 23 May 2019 12:26:08 +0200 From: Christoph Hellwig To: "Koenig, Christian" Cc: Christoph Hellwig , Logan Gunthorpe , "linux-pci@vger.kernel.org" , Bjorn Helgaas Subject: Re: [PATCH] PCI/P2PDMA: Root complex whitelist should not apply when an IOMMU is present Message-ID: <20190523102608.GA15800@lst.de> References: <97aa52fc-f062-acf1-0e0c-5a4d1d505777@deltatee.com> <20190523094322.GA14986@lst.de> <20190523095057.GA15185@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, May 23, 2019 at 10:06:28AM +0000, Koenig, Christian wrote: > Ok, we certainly don't have a system which exercise this user case. > Could ask around if we have an ARM SOC with that properties somewhere. > > But asking the other way around: Where is the right place to start > fixing all this? dma_map_resource()? That is the the big gorrilla in the room. The offset applies to the device whos BARs/resources we map. The current dma_map_resource API does not even have the right information. So I think we need to enhance the API to pass a second struct device and we could fix it there and then in the next steps add a map_sg version of dma_map_resource and eventually also convert the PCIe P2P map_sg over to that.