Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp967708ybh; Tue, 10 Mar 2020 11:49:26 -0700 (PDT) X-Google-Smtp-Source: ADFU+vten4Kg8i54pfxTiCptbn1feSWL4l5QniImjoJo2xlMzGlqzqczVBBcoyEjHVqFhLQIKldg X-Received: by 2002:a05:6830:1459:: with SMTP id w25mr7289447otp.121.1583866166681; Tue, 10 Mar 2020 11:49:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583866166; cv=none; d=google.com; s=arc-20160816; b=yZJAKbi3bVGftndF9Fy40Qn2C4o0+bfImlF9eCtULkGvpDcHxz3iQX4W7MIwFftl+Y AZK0/hXSVKAQe2cPOkwk+YaPvsSo/HYakT3VhB8NBYmHXRBmLUKSxah1qlqS0FrzOZHY gFcF8EZu2Sgg7i6FICWim/u+9kWcYO8qsARrCNKaPGdF4yzTjdFg5JOGCv9MjCj4GXRu grgRcqE6s6WRqLPrJU+eWVHimFlJjt7HAb+D72sIX5G010WXbM0lVypN0ye+i1XA23YH 5GVQsAlr6mhGKElae3+LAWyr727Ndkvr8b0f3ubg9CMkUoObPoz5y50Um9x51biaClLM Zm9Q== 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=pSQm4nBwmOARt4qw6O83eg4Wjgepvl2wIhcex8xqumo=; b=E17djkAo8tZ0aQc8VGiYBirYmWV6ge/EnA+mAME23+Y8+d5he185HPzC/rCt7NBw6x PbifSdrl0V5kbeijzjGTR8cazNYZK96m6sItfw+EnbUGljZ0JfadvjReL33EwjWhp2j/ kff+pAJ+Gv4B4EFpSyFp9+v7cqPeB+Nq4vVHNVfnzjcw4FpGJFl3wWdc/Dje5x4CO0hN 1y5VN8KtZqKOj26lCh182GNuIP1vqTvSalR9jQ5avV8T2YHbj9ubVwgBxAyatzwwEEeU t8OasWSXOIYm6nWgdXjJdHDZW/bMsiNGJ4wpbB4R21wYkmbCP8ABt8Xkl7W/rAh219As DoJw== 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 23si1382488ois.29.2020.03.10.11.49.15; Tue, 10 Mar 2020 11:49:26 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727289AbgCJSro (ORCPT + 99 others); Tue, 10 Mar 2020 14:47:44 -0400 Received: from verein.lst.de ([213.95.11.211]:54558 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727228AbgCJSrn (ORCPT ); Tue, 10 Mar 2020 14:47:43 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 2A66068BE1; Tue, 10 Mar 2020 19:47:41 +0100 (CET) Date: Tue, 10 Mar 2020 19:47:41 +0100 From: Christoph Hellwig To: David Rientjes Cc: Christoph Hellwig , Tom Lendacky , "Singh, Brijesh" , "Grimm, Jon" , Joerg Roedel , baekhw@google.com, "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" Subject: Re: [rfc 5/6] dma-direct: atomic allocations must come from unencrypted pools Message-ID: <20200310184740.GA9745@lst.de> References: <20200305154456.GC5332@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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 06, 2020 at 04:36:07PM -0800, David Rientjes wrote: > As a preliminary change to this series, I could move the atomic pools and > coherent_pool command line to a new kernel/dma/atomic_pools.c file with a > new CONFIG_DMA_ATOMIC_POOLS that would get "select"ed by CONFIG_DMA_REMAP > and CONFIG_AMD_MEM_ENCRYPT and call into dma_common_contiguous_remap() if > we have CONFIG_DMA_DIRECT_REMAP when adding pages to the pool. Yes. Although I'd just name it kernel/dma/pool.c and CONFIG_DMA_COHERENT_POOL or so, as I plan to reuse the code for architectures that just preallocate all coherent memory at boot time as well. > I think that's what you mean by splitting the pool from remapping, > otherwise we still have a full CONFIG_DMA_REMAP dependency here. If you > had something else in mind, please let me know. Thanks! Yes, that is exactly what I meant.