Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp2351090rdb; Mon, 11 Sep 2023 21:28:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeSH+cdaS4ds+Ry/7rEXPR4Xdde/i4jsy2+4782OIuMcqrrhGEKHw/Vi76lS9ec4y0bxDH X-Received: by 2002:a17:902:7587:b0:1b5:561a:5ca9 with SMTP id j7-20020a170902758700b001b5561a5ca9mr9674632pll.50.1694492932713; Mon, 11 Sep 2023 21:28:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694492932; cv=none; d=google.com; s=arc-20160816; b=kz1HNe2nUXWhtMCbS5CFVZUPCP/twLN87uJ5F2fAbCIV91iLvLd6rra31sqrnYft/V s4ND2C/WLHsJxOEynQfSHgRlteiLzakr1Yj7OIdD2a/ViXGjntdGCF5sAkc64rOx0DUZ 1V/WBKnDwsyv+HXQ+ddN9D0pGBjnUmtWa0s3D/s8NcSSgcxp+KT0nexXgR8opuYpkX5o sOLFmQZ3ZJNxxbmB3ik4R03fPChS0zv1QgFQRLsUrYcj3oRclAFsNEPEZ0niTEGCLeOH TBDNwBxphtX9Yj4OHty2xxvg5GFYtn4mCI/QUnEXR7q2KQiS035BNZhkxbkDWB8PlZ52 k4gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=AwdgsLDc0x9EEkz4YpUTo1bYvEZS+0gukuLtaCv9ecE=; fh=31n/CivT0+M8vIabTwhjHhLgU6i61itRqny8ZNflM4g=; b=XhZBhNwUynljVvUOqN5k94GG6YAt4A+/c9X8/bO8sdgbGCpD0X9ZBqpvazWhAPWWio EjbNf8tCall2YwvGvaarWF7BpWAjdPgYK6LvHnJju9S/oQYjt/1Tn2mnPnmimwEjJUuW 3MhptNM7TdiN7cub1X8UoCLedMVMQmh+wAvkAhcyE+XnkRUn4UKHghH6fx4nw7gSJPL0 BZFjWyy3sxWS8jgR0UMGivNwoed7LnybdWJbLwXf+3pt0UW+PBowIXZUNsCE2xTq7xQD jWYjyc9mO+iQIYoHItYHpLrFFxXWU/GRoiQAZLQ9uzHJXPFVfH63xN2HdJthZrUrkBWX BLKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id p7-20020a170902b08700b001c0953d0055si7152917plr.262.2023.09.11.21.28.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 21:28:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 06C1F807D8CA; Mon, 11 Sep 2023 21:26:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241335AbjILDAN (ORCPT + 99 others); Mon, 11 Sep 2023 23:00:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241089AbjILDAA (ORCPT ); Mon, 11 Sep 2023 23:00:00 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E7D0298A7A for ; Mon, 11 Sep 2023 15:38:31 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BA3971007; Mon, 11 Sep 2023 15:01:03 -0700 (PDT) Received: from [10.57.0.19] (unknown [10.57.0.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2A98F3F5A1; Mon, 11 Sep 2023 15:00:25 -0700 (PDT) Message-ID: <15a0de3a-086a-b30d-0512-02e3bbf69662@arm.com> Date: Mon, 11 Sep 2023 23:00:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH] iommu/sun50i: Allow page sizes between 4K and 1M Content-Language: en-GB To: =?UTF-8?Q?Jernej_=c5=a0krabec?= , joro@8bytes.org, will@kernel.org Cc: wens@csie.org, samuel@sholland.org, iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org References: <20230911190218.1758812-1-jernej.skrabec@gmail.com> <40649946-739b-fec6-d743-f7828613fec5@arm.com> <5707055.DvuYhMxLoT@archlinux> From: Robin Murphy In-Reply-To: <5707055.DvuYhMxLoT@archlinux> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 11 Sep 2023 21:26:48 -0700 (PDT) On 2023-09-11 20:29, Jernej Škrabec wrote: > On Monday, September 11, 2023 9:06:12 PM CEST Robin Murphy wrote: >> On 2023-09-11 20:02, Jernej Skrabec wrote: >>> While peripheral supports only 4K page sizes, we can easily emulate >>> support for bigger page sizes, up to 1M. This is done by making multiple >>> entries in map function or clearing multiple entries in unmap. >> >> No, it's done by converting over to the {map,unmap}_pages ops. There's >> no need to resurrect this horrible bodge. > > Missed those, thanks! In any case, logic to implement those isn't that > different than here. Indeed, if anything it should be even simpler since you don't need to worry about specific sizes at all - any tricky boundary you don't want to iterate through, just return short at that point and let the core call you back again with the remainder. (In fact this reminds me one of the low-priority cleanup jobs outstanding was to trivially convert all the remaining drivers and retire the old interfaces altogether) Cheers, Robin.