Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp579052pxb; Wed, 13 Jan 2021 10:34:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJx4e1AR3kitYSCtpFC/fR1JQ09QzJp4/rO1Qsv8JzOgq+K2iI8w4h5xGTKiIxjJndV9+GPX X-Received: by 2002:a17:906:7156:: with SMTP id z22mr2492177ejj.441.1610562852318; Wed, 13 Jan 2021 10:34:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610562852; cv=none; d=google.com; s=arc-20160816; b=i0RztimviNQojlkFAzb4dAzH+J8qBe6Y+nTG9ttmkH2sPI+OV3fdMORGS1YLnz92L3 UyLEb25+CSbjtx+xwc56qldMmITiQ6SKx2HMoj1JBhHZnqrm+01e6rnN8HHClHK+fCi8 /U3ak4Jn22XegvgpUC/vGGLxmzBCJVoSp0Q7LY83BD/VuNy/WhO92w1+IFAIJZO57tUD dLbiqur4b1eWxs/C3zMbjx1OWzBUjWDJ0x2dcZY2R3DbPC6nZlpEO2sTm0jdmUzBQCsI s79q/4yc0+f2gy0WfDo4vtSWepskcIWUmCYvlpA1TK4Vcw4nWcoEMKwL++EUS/GOlLyS AZEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=H22bI5RmHw6DjUBkCKe0sM6dtXKXC6zD/1fvuoMlEkk=; b=lHgX+NxlxuVaRPw68tPB/U8MMpMs17JbFo26WdUrqyuDMM3Dkj2riBYq6EvA2zopp5 V4hycaliDJDYSpzOYOevI+3zkELe9L47SzO8K/p4c5br+inFQFiaARTR/LIcf1jWyH6+ TY3uAp/LgnK3tPCuVwSLPUVg6zPy3CXCrvpW3lf9vC3x5siqJDEEXT34BNW5bqYIxoZ7 KgkMP5Lc0Oh7IMVtvV/wOr2ZYRzY4r/cbUABX/L/ixdNMm4WB3SxOOC6GylK4mIYNXsq FvxZ0UJPVffOewci/A3zCF1uPU8h0msBhMUGrwuUPoHeEj/zAdR906lCgiafmUK5zoVR LpGA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v24si1493291edy.573.2021.01.13.10.33.48; Wed, 13 Jan 2021 10:34:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728228AbhAMSdI (ORCPT + 99 others); Wed, 13 Jan 2021 13:33:08 -0500 Received: from verein.lst.de ([213.95.11.211]:33066 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728157AbhAMSdI (ORCPT ); Wed, 13 Jan 2021 13:33:08 -0500 Received: by verein.lst.de (Postfix, from userid 2407) id A66E868B02; Wed, 13 Jan 2021 19:32:19 +0100 (CET) Date: Wed, 13 Jan 2021 19:32:18 +0100 From: Christoph Hellwig To: Robin Murphy Cc: Christoph Hellwig , Claire Chang , robh+dt@kernel.org, mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, joro@8bytes.org, will@kernel.org, frowand.list@gmail.com, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, m.szyprowski@samsung.com, grant.likely@arm.com, xypron.glpk@gmx.de, treding@nvidia.com, mingo@kernel.org, bauerman@linux.ibm.com, peterz@infradead.org, gregkh@linuxfoundation.org, saravanak@google.com, rafael.j.wysocki@intel.com, heikki.krogerus@linux.intel.com, andriy.shevchenko@linux.intel.com, rdunlap@infradead.org, dan.j.williams@intel.com, bgolaszewski@baylibre.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, iommu@lists.linux-foundation.org, xen-devel@lists.xenproject.org, tfiga@chromium.org, drinkcat@chromium.org Subject: Re: [RFC PATCH v3 4/6] swiotlb: Add restricted DMA alloc/free support. Message-ID: <20210113183218.GB19254@lst.de> References: <20210106034124.30560-1-tientzu@chromium.org> <20210106034124.30560-5-tientzu@chromium.org> <20210113124847.GC1383@lst.de> <82bb75bc-11e6-ac94-9d24-7c896e3aae98@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <82bb75bc-11e6-ac94-9d24-7c896e3aae98@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 13, 2021 at 06:27:08PM +0000, Robin Murphy wrote: >> Can we hook in somewhat lower level in the dma-direct code so that all >> the remapping in dma-direct can be reused instead of duplicated? That >> also becomes important if we want to use non-remapping uncached support, >> e.g. on mips or x86, or the direct changing of the attributes that Will >> planned to look into for arm64. > > Indeed, AFAICS this ought to boil down to a direct equivalent of > __dma_direct_alloc_pages() - other than the address there should be no > conceptual difference between pages from the restricted pool and those from > the regular page allocator, so this probably deserves to be plumbed in as > an alternative to that. Yes, that's what I mean. You managed to word it much better, though.