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.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 A7BFAC10F27 for ; Tue, 10 Mar 2020 18:47:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 77C8A20873 for ; Tue, 10 Mar 2020 18:47:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbgCJSro (ORCPT ); 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.