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. 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 6A846C18E5A for ; Tue, 10 Mar 2020 18:47:48 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 37AE1208C3 for ; Tue, 10 Mar 2020 18:47:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 37AE1208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 15A618692B; Tue, 10 Mar 2020 18:47:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZhAglRLrGMiQ; Tue, 10 Mar 2020 18:47:47 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9802386274; Tue, 10 Mar 2020 18:47:47 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 7D6EEC07FE; Tue, 10 Mar 2020 18:47:47 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id 16FDFC0177 for ; Tue, 10 Mar 2020 18:47:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0DD008692B for ; Tue, 10 Mar 2020 18:47:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 88gZup30EH5r for ; Tue, 10 Mar 2020 18:47:45 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by fraxinus.osuosl.org (Postfix) with ESMTPS id CBC2386274 for ; Tue, 10 Mar 2020 18:47:44 +0000 (UTC) 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 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Tom Lendacky , "Singh, Brijesh" , "Grimm, Jon" , baekhw@google.com, "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , Christoph Hellwig X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" 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. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu