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=-5.5 required=3.0 tests=BAYES_00, 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 31800C433E0 for ; Thu, 23 Jul 2020 11:55:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 07F1120684 for ; Thu, 23 Jul 2020 11:55:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728265AbgGWLza (ORCPT ); Thu, 23 Jul 2020 07:55:30 -0400 Received: from verein.lst.de ([213.95.11.211]:59866 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726109AbgGWLza (ORCPT ); Thu, 23 Jul 2020 07:55:30 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 6004C68AFE; Thu, 23 Jul 2020 13:55:27 +0200 (CEST) Date: Thu, 23 Jul 2020 13:55:27 +0200 From: Christoph Hellwig To: "Song Bao Hua (Barry Song)" Cc: Christoph Hellwig , "m.szyprowski@samsung.com" , "robin.murphy@arm.com" , "will@kernel.org" , "ganapatrao.kulkarni@cavium.com" , "catalin.marinas@arm.com" , "iommu@lists.linux-foundation.org" , Linuxarm , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Jonathan Cameron , Nicolas Saenz Julienne , Steve Capper , Andrew Morton , Mike Rapoport , "Zengtao (B)" , huangdaode Subject: Re: [PATCH v3 1/2] dma-direct: provide the ability to reserve per-numa CMA Message-ID: <20200723115527.GA31598@lst.de> References: <20200628111251.19108-1-song.bao.hua@hisilicon.com> <20200628111251.19108-2-song.bao.hua@hisilicon.com> <20200722141658.GA17658@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 Wed, Jul 22, 2020 at 09:26:03PM +0000, Song Bao Hua (Barry Song) wrote: > I understand your concern. Anyway, The primary purpose of this patchset is providing > a general way for users like IOMMU to get local coherent dma buffers to put their > command queue and page tables in. The first user case is what really made me > begin to prepare this patchset. > > For the second case, it is probably a positive side effect of this patchset for those users > who have more concern on performance than dma security, then they maybe skip > IOMMU by > iommu.passthrough= > [ARM64, X86] Configure DMA to bypass the IOMMU by default. > Format: { "0" | "1" } > 0 - Use IOMMU translation for DMA. > 1 - Bypass the IOMMU for DMA. > unset - Use value of CONFIG_IOMMU_DEFAULT_PASSTHROUGH. > In this case, they can get local memory and get better performance. > However, it is not the primary purpose of this patchset. That's not what I mean. Hardcoding the CMA regions in the kernel config is just a bad idea, and we should not add more hard coded values. You can always use CONFIG_CMDLINE to force a specific kernel command line including your options.