Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4887971ybv; Mon, 17 Feb 2020 07:52:03 -0800 (PST) X-Google-Smtp-Source: APXvYqy7gjiqA0Rft/69A1JkAn8w5KGwD7CCclrSY0t1p5jfsFDjTq3WHQaLhRRXzzZ0xBGkXCXn X-Received: by 2002:aca:db56:: with SMTP id s83mr10568550oig.171.1581954723709; Mon, 17 Feb 2020 07:52:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581954723; cv=none; d=google.com; s=arc-20160816; b=pv6BzsvCMSkX72FN0LSABCmYxiv2u9+onJAUGgZBvmXVRyW0PXWIIa9gXTHmRPhyCD /Z+g4LtrBN+EPRXjyz8lDjhm074fE3YMQtyklZGqnTnqPQgWGhsMc1D2tqaG5yOZWzjW JPjGNPvlaKkWuqeuurSKOPDXWZ7JD/DZkAu1lOaDcoUW0j2NB+40lnp2hJxN0tbJSNXC 8vphqJ0rGqdzBFt2rlT+NtVc8PYQzUfGpNR0dDCeCpKBlKYCJoCMQmGpT04ny3p51gpQ WMC0LIjPB8IneSxCKEr24jwMLqJlr76klTHehUemEMEyB8N4D+9fTEaRcP0Z7o8SRIx/ O6Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8tmu/RhvsOtYTVb/4lI1OF6HwGU0DeGyUT+PiwpFJ5c=; b=gMlfK922xK6JK936kfUhbL6sVEevY4KNK0T2vzMxVXAi5CGV2j8dxU4Ke8O/Kd1pEB BMUcCSfGa9Wq7+rWKE9D99GUK9XvlB6GKsxFNXB8nJyuaNpkwZS9ot2PAc+2QNtTHaRO vrbUh3E/xcPV4qlYURRj7aNt8hAFb+r7x0YbDcmqwDtLuOIcli8sogutmb6af581srCr UyQ16Ds18KjM5LoPBYIGVZAckdBORhkNh3TX/oZNSW02xiXfI0tZCITInjn5MyYJ9HzX PuEDdJ8iLRsixCJx+ZXNf/7pGOU3Jzar9xzB5MJrpA0uEyvQOKQWw6yVRqlD1ozpUyWC rCtw== 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 b10si323630otp.124.2020.02.17.07.51.51; Mon, 17 Feb 2020 07:52:03 -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 S1729360AbgBQPuv (ORCPT + 99 others); Mon, 17 Feb 2020 10:50:51 -0500 Received: from foss.arm.com ([217.140.110.172]:37772 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729331AbgBQPuv (ORCPT ); Mon, 17 Feb 2020 10:50:51 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 14BF430E; Mon, 17 Feb 2020 07:50:51 -0800 (PST) Received: from [10.1.196.37] (e121345-lin.cambridge.arm.com [10.1.196.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2C9833F6CF; Mon, 17 Feb 2020 07:50:50 -0800 (PST) Subject: Re: [RFC PATCH] iommu/dma: Allow drivers to reserve an iova range To: Christoph Hellwig , "Isaac J. Manjarres" Cc: pratikp@codeaurora.org, linux-kernel@vger.kernel.org, Liam Mark , iommu@lists.linux-foundation.org, kernel-team@android.com References: <1581721096-16235-1-git-send-email-isaacm@codeaurora.org> <20200217080138.GB10342@infradead.org> From: Robin Murphy Message-ID: Date: Mon, 17 Feb 2020 15:50:48 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200217080138.GB10342@infradead.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 17/02/2020 8:01 am, Christoph Hellwig wrote: > On Fri, Feb 14, 2020 at 02:58:16PM -0800, Isaac J. Manjarres wrote: >> From: Liam Mark >> >> Some devices have a memory map which contains gaps or holes. >> In order for the device to have as much IOVA space as possible, >> allow its driver to inform the DMA-IOMMU layer that it should >> not allocate addresses from these holes. > > Layering violation. dma-iommu is the translation layer between the > DMA API and the IOMMU API. And calls into it from drivers performing > DMA mappings need to go through the DMA API (and be documented there). +1 More than that, though, we already have "holes in the address space" support for the sake of PCI host bridge windows - assuming this is the same kind of thing (i.e. the holes are between memory regions and other resources in PA space, so are only relevant once address translation comes into the picture), then this is IOMMU API level stuff, so even a DMA API level interface would be inappropriate. Robin.