Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1890825imu; Sat, 8 Dec 2018 09:19:17 -0800 (PST) X-Google-Smtp-Source: AFSGD/WFSUHqNXjxmTcjdrakZQiAAPuwI17tBnmybHBq1ispMDrJEvQcsQ2sIXKkylRYXygyd8Qy X-Received: by 2002:a17:902:bf03:: with SMTP id bi3mr6348080plb.83.1544289557525; Sat, 08 Dec 2018 09:19:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544289557; cv=none; d=google.com; s=arc-20160816; b=bJANZc1MyO2btjSAVM3ecui2pQ433UG6/AguO4rIgsp30JQ0Ore4JzPVDPNtxWjozj 48PMYS/P2o2qdaZ2t0HHjySa9mHROzvCuX12vLkYrjl6LOnBmaKs1ClqR7SlUehLQ3Yz rJviM7pDIHL7nMyP/bKVBeGoLCNMCRDKyDQZAQ1ptM6wY1phiQooeD6TGHOAjHDE4vzW AxE3AwrW592sXA+ryWRLFXLUwL9yTGdvdV+xO7jXh2nzzUAJEM2deRjdf4A8NpmKO6lu uugJFSX4jlUBmdWfgZ82J6Qy6E+gNSIsNS8s0cEfZPvTrvZSJt3vaWSDIcxKHm8fnS3C GduQ== 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=hHmPNQBC0D97G05v6l2/dbAsDt2EsBotQzhPZF1wtXE=; b=qpFkJSfN2bU7TNyyzk28IPB4eBz8G+P9uspNnMilHiWcMYQxvoV/j+s1GAjIQtMNms Jjz2oxTmLeBZLyEzcTLqgjWOzPJ1+rZrJGVscIYNs8YoH7QI8kqZRCr1utu/NjMuT+8Z MG8DCDPeTS0fLbef0CL1FFrTUc6tS2lCtK3bnC/rQcunvxUvCBgQ6w0ccurxouqEHPWS q45KehmM5oMhEh4WZLnSQGaq6EL8PVcc6zfD/yiw1pl0h9kFkV2X0rs+PhgKQCUX7SQv cnQf7iBxoDE6yVWYcEN0rcYVwq62KxgXiqOvg0QYNiDAhcwQJqCX6fBprgLuuqouEzkW w+Pg== 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 z29si6311841pfi.9.2018.12.08.09.19.02; Sat, 08 Dec 2018 09:19:17 -0800 (PST) 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 S1726207AbeLHRRs (ORCPT + 99 others); Sat, 8 Dec 2018 12:17:48 -0500 Received: from verein.lst.de ([213.95.11.211]:40861 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbeLHRRs (ORCPT ); Sat, 8 Dec 2018 12:17:48 -0500 Received: by newverein.lst.de (Postfix, from userid 2407) id 42CC268AA6; Sat, 8 Dec 2018 18:17:46 +0100 (CET) Date: Sat, 8 Dec 2018 18:17:46 +0100 From: Christoph Hellwig To: Benjamin Herrenschmidt Cc: Rui Salvaterra , hch@lst.de, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: use generic DMA mapping code in powerpc V4 Message-ID: <20181208171746.GB15228@lst.de> References: <20181130103222.GA23393@lst.de> <42b1408cafe77ebac1b1ad909db237fe34e4d177.camel@kernel.crashing.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42b1408cafe77ebac1b1ad909db237fe34e4d177.camel@kernel.crashing.org> 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, Dec 02, 2018 at 05:11:02PM +1100, Benjamin Herrenschmidt wrote: > Talking of which ... Christoph, not sure if we can do something about > this at the DMA API level or keep hacks but some adapters such as the > nVidia GPUs have a HW hack we can use to work around their limitations > in that case. > > They have a register that can program a fixed value for the top bits > that they don't support. > > This works fine for any linear mapping with an offset, provided they > can program the offset in that register and they have enough DMA range > to cover all memory from that offset. > > I can probably get the info about this from them so we can exploit it > in nouveau. I think we can expose the direct mapping offset if people care enough, we just have to be very careful designing the API. I'll happily leave that to those that actually want to use it, but I'll gladly help reviewing it.