Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp613703pxu; Thu, 7 Jan 2021 13:27:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJynKZVn3zesX29+8BiJMj9H3j3L37Ly9S29G8cjTOXLqVB2NMTfsynW8ZRBN7AQlFpf8RdD X-Received: by 2002:a17:906:2257:: with SMTP id 23mr522801ejr.497.1610054873184; Thu, 07 Jan 2021 13:27:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610054873; cv=none; d=google.com; s=arc-20160816; b=bmBau+PNQyWtZvefZE8cy5CrNiyRZp4LkB46LSefjmt8afrMGCZAE+FqSGRfTBA4KU UmT6VRNo6zAulotWQIIA+TgKxC28oSdL2LJeBsvlwSFy5pDvTj+bsskbPM6QIUSq9O4G oY0qtXzGjn9vr/rTN4zrck4cNeTO8g6Tn5snVxSOAAtEDcZXasl0b5cm1XkMm4kKbOlS Mf2lJwRRKnyki43eqEnNJI5ucjsWNoD+V0frHbOAEppAF7CH0qdbEipRXYLWHKct5iQx w3W26vKp02aXHTqL+42T7aOFNbqHM4QtB4ZKPUvZAHE+bAtJKgVO064ZzJJlFZxXxO9y 7tWg== 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 :dkim-signature; bh=c9kjhiPaRcgOzWstQJHEKUIH/U+Km3Fjzp7KkmlSZjc=; b=JfqckQQ7fxQ6usR14V3DOXMPYlC2WUv3HgNocKIa/TyvUeA9pQWoASz0XCP+/xYKhq tGe6icHwW1NpaOiFy6hMvJRiMJv8xIytmr4hSU/Ak7/csCw+EZ5oZVnwF6S7QEKFPiyF SCUie9T4wj51NbUAl2+PRN0DTC/NkOVmo1cWswxtPhfvY82FewvjR30A537eYKYnkBmx xmGwhUq5SnGmwPGQ4VrRxHlRgQQcGXD704i2AjnKiZTBRyz4fntBNjUWpvfzYWxc4oS3 fFdrYl5jniimz1W+sJPbbEoWNblYJs5aerK8cGGbE4ljSEE5ejB0ScShvzHehcicl9WS PemA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=rKYVHRBU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bo6si2834263edb.434.2021.01.07.13.27.29; Thu, 07 Jan 2021 13:27:53 -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; dkim=pass header.i=@oracle.com header.s=corp-2020-01-29 header.b=rKYVHRBU; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbhAGVY2 (ORCPT + 99 others); Thu, 7 Jan 2021 16:24:28 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:42494 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726666AbhAGVY1 (ORCPT ); Thu, 7 Jan 2021 16:24:27 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 107L9qUN157941; Thu, 7 Jan 2021 21:21:52 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=c9kjhiPaRcgOzWstQJHEKUIH/U+Km3Fjzp7KkmlSZjc=; b=rKYVHRBU6NO1rtuG37bqZjZCK6xmxGbYy0AsyG/XUttowywJr9+V7ezApjVzpWtJ13Y5 3G9p/wvcTEewjEr/2DCY1Yf6AVruqXotBoUQgjKYun298vJlx2gRKh1u7lGAwbac4rLd BYWr2fcfuqXZDIGaafVjEG6mz8GDnxVIm5kAAtxIMvLa+4GNYE3gnRv6RwMFs4ZX1tcD fi4NOxKKyN47kdzcafOqy2rEvxswHIxc67dH2oD2nIc655e6a+1QpeXN26qBzNIRAApc CNcwaIbofYPZxp/INyde860tR49n8Bh9IDhLdaIW7LGk47AmYuhdzr9+mGRHjfQSevdx PQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 35wftxdyp9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 07 Jan 2021 21:21:52 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 107LASx6174620; Thu, 7 Jan 2021 21:19:51 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userp3020.oracle.com with ESMTP id 35w3qu9kyc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Jan 2021 21:19:51 +0000 Received: from abhmp0017.oracle.com (abhmp0017.oracle.com [141.146.116.23]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 107LJcni003821; Thu, 7 Jan 2021 21:19:38 GMT Received: from char.us.oracle.com (/10.152.32.25) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 07 Jan 2021 21:19:38 +0000 Received: by char.us.oracle.com (Postfix, from userid 1000) id 3F3FD6A010C; Thu, 7 Jan 2021 16:19:37 -0500 (EST) Date: Thu, 7 Jan 2021 16:19:37 -0500 From: Konrad Rzeszutek Wilk To: Florian Fainelli Cc: Claire Chang , Rob Herring , mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org, "list@263.net:IOMMU DRIVERS" , Joerg Roedel , will@kernel.org, Frank Rowand , boris.ostrovsky@oracle.com, jgross@suse.com, sstabellini@kernel.org, Christoph Hellwig , Marek Szyprowski , Robin Murphy , grant.likely@arm.com, xypron.glpk@gmx.de, Thierry Reding , mingo@kernel.org, bauerman@linux.ibm.com, peterz@infradead.org, Greg KH , Saravana Kannan , rafael.j.wysocki@intel.com, heikki.krogerus@linux.intel.com, Andy Shevchenko , rdunlap@infradead.org, dan.j.williams@intel.com, Bartosz Golaszewski , linux-devicetree , lkml , linuxppc-dev@lists.ozlabs.org, xen-devel@lists.xenproject.org, Tomasz Figa , Nicolas Boichat Subject: Re: [RFC PATCH v3 2/6] swiotlb: Add restricted DMA pool Message-ID: <20210107211937.GA19460@char.us.oracle.com> References: <20210106034124.30560-1-tientzu@chromium.org> <20210106034124.30560-3-tientzu@chromium.org> <20210106185241.GA109735@localhost.localdomain> <20210107175740.GA16519@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9857 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 spamscore=0 mlxlogscore=999 phishscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101070123 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9857 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 suspectscore=0 mlxscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 clxscore=1011 lowpriorityscore=0 mlxlogscore=999 malwarescore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101070123 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 07, 2021 at 10:09:14AM -0800, Florian Fainelli wrote: > On 1/7/21 9:57 AM, Konrad Rzeszutek Wilk wrote: > > On Fri, Jan 08, 2021 at 01:39:18AM +0800, Claire Chang wrote: > >> Hi Greg and Konrad, > >> > >> This change is intended to be non-arch specific. Any arch that lacks DMA access > >> control and has devices not behind an IOMMU can make use of it. Could you share > >> why you think this should be arch specific? > > > > The idea behind non-arch specific code is it to be generic. The devicetree > > is specific to PowerPC, Sparc, and ARM, and not to x86 - hence it should > > be in arch specific code. > > In premise the same code could be used with an ACPI enabled system with > an appropriate service to identify the restricted DMA regions and unlock > them. Which this patchset is not. > > More than 1 architecture requiring this function (ARM and ARM64 are the > two I can think of needing this immediately) sort of calls for making > the code architecture agnostic since past 2, you need something that scales. I believe the use-case is for ARM64 at this moment. > > There is already code today under kernel/dma/contiguous.c that is only > activated on a CONFIG_OF=y && CONFIG_OF_RESERVED_MEM=y system, this is > no different. > -- > Florian