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=-15.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 CF0EAC433B4 for ; Thu, 8 Apr 2021 13:58:17 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (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 704E66102A for ; Thu, 8 Apr 2021 13:58:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 704E66102A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 390AF84B0A; Thu, 8 Apr 2021 13:58:17 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xZXenhjbRG4Y; Thu, 8 Apr 2021 13:58:16 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp1.osuosl.org (Postfix) with ESMTP id 2457B84AF7; Thu, 8 Apr 2021 13:58:16 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id EE069C000B; Thu, 8 Apr 2021 13:58:15 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 46A4DC000B for ; Thu, 8 Apr 2021 13:58:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2806B84B0A for ; Thu, 8 Apr 2021 13:58:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id p5ZcddjvY7Wz for ; Thu, 8 Apr 2021 13:58:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp1.osuosl.org (Postfix) with ESMTPS id AA52F84AF7 for ; Thu, 8 Apr 2021 13:58:12 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 2177D610FB; Thu, 8 Apr 2021 13:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617890292; bh=sE1Qram1VeOU1YRXJK66SXAyjytxycG6cooodItBbOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gAa3xHbEsySDocFO0l126rUM6WglwRSvMNmU6KhY9EiZH30VgD3H2weMujNwNPn+m 8aT+c27X+WP/Bav9yB4lhEr89xiLcPKLUq+dgw1OygwV5CSx5ZBjSY1J/qjBKk8bLD TfajsOyOV6CzKvn8/QyC2llHhifHms7wBXJaT0/s6Au7vLvE6/T8Wml4q0nWVoF4nx p72glfnIf5yTTMyuq+hxf/5b2WBTPUlVtkA/dnZ86webbRqNKwzT11m2Zx6gBTIyIT Y3MoeXeTodIanOSzu0rjXacHor9lc0Nu9zwrCt8dPMBoN1lPwqaXNq5cjAEdPw7UZW TnDTVFyDHpMIw== Date: Thu, 8 Apr 2021 14:58:07 +0100 From: Will Deacon To: "Isaac J. Manjarres" Subject: Re: [RFC PATCH v4 12/15] iommu/io-pgtable-arm-v7s: Implement arm_v7s_unmap_pages() Message-ID: <20210408135807.GA17998@willie-the-truck> References: <20210408045241.27316-1-isaacm@codeaurora.org> <20210408045241.27316-13-isaacm@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210408045241.27316-13-isaacm@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Cc: pratikp@codeaurora.org, iommu@lists.linux-foundation.org, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org 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 Wed, Apr 07, 2021 at 09:52:38PM -0700, Isaac J. Manjarres wrote: > Implement the unmap_pages() callback for the ARM v7s io-pgtable > format. > > Signed-off-by: Isaac J. Manjarres > --- > drivers/iommu/io-pgtable-arm-v7s.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c > index d4004bcf333a..5e203e03c352 100644 > --- a/drivers/iommu/io-pgtable-arm-v7s.c > +++ b/drivers/iommu/io-pgtable-arm-v7s.c > @@ -710,15 +710,32 @@ static size_t __arm_v7s_unmap(struct arm_v7s_io_pgtable *data, > return __arm_v7s_unmap(data, gather, iova, size, lvl + 1, ptep); > } > > -static size_t arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long iova, > - size_t size, struct iommu_iotlb_gather *gather) > +static size_t arm_v7s_unmap_pages(struct io_pgtable_ops *ops, unsigned long iova, > + size_t pgsize, size_t pgcount, > + struct iommu_iotlb_gather *gather) > { > struct arm_v7s_io_pgtable *data = io_pgtable_ops_to_data(ops); > + size_t unmapped = 0, ret; > > if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias))) > return 0; > > - return __arm_v7s_unmap(data, gather, iova, size, 1, data->pgd); > + while (pgcount--) { > + ret = __arm_v7s_unmap(data, gather, iova, pgsize, 1, data->pgd); > + if (!ret) > + break; > + > + unmapped += pgsize; > + iova += pgsize; > + } > + > + return unmapped; > +} Wait -- don't you need to hook this up somewhere (likewise for ->map_pages)? How are you testing this? Will _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu 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=-15.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 2E427C433ED for ; Thu, 8 Apr 2021 13:59:41 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 B82C7610E5 for ; Thu, 8 Apr 2021 13:59:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B82C7610E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=X3reBAqDystZb4fdqtJroynvT+NtiHh08NPC+8B88XA=; b=FpfKnSeE52h32ucfMVL/SFLUN H71vlPJOdqv43DwcNo5yesGT9Pwq+NgPbD9h8j7aLvH3z0Ly4Jjle63aITWwwz6j12Ksz/h9oxJ+d b+UG2jPUG9j9gPUpWBHiTFiEXsliURI7ZBNAp13BeC+xot2cfa6oxhWXeRFRn+D4itzkouQ8lbJrJ fxhCTapY068c873xmvy9RrIt9zCL8vGW1+dahgmG7CxmrBr3vFwLf1ekRkZm2EBJFera0V8uotKcJ 1JL4orGCC8st5vmcX73pe6dmI5GmAmD8/rUmLeypnJzju44i51dj9F/yaNFd1f5GwCK0xVq/MOTXt EJRvHhtIA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUVAo-008CVz-1q; Thu, 08 Apr 2021 13:58:18 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUVAj-008CVB-Mv for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 13:58:15 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2177D610FB; Thu, 8 Apr 2021 13:58:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617890292; bh=sE1Qram1VeOU1YRXJK66SXAyjytxycG6cooodItBbOg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gAa3xHbEsySDocFO0l126rUM6WglwRSvMNmU6KhY9EiZH30VgD3H2weMujNwNPn+m 8aT+c27X+WP/Bav9yB4lhEr89xiLcPKLUq+dgw1OygwV5CSx5ZBjSY1J/qjBKk8bLD TfajsOyOV6CzKvn8/QyC2llHhifHms7wBXJaT0/s6Au7vLvE6/T8Wml4q0nWVoF4nx p72glfnIf5yTTMyuq+hxf/5b2WBTPUlVtkA/dnZ86webbRqNKwzT11m2Zx6gBTIyIT Y3MoeXeTodIanOSzu0rjXacHor9lc0Nu9zwrCt8dPMBoN1lPwqaXNq5cjAEdPw7UZW TnDTVFyDHpMIw== Date: Thu, 8 Apr 2021 14:58:07 +0100 From: Will Deacon To: "Isaac J. Manjarres" Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, robin.murphy@arm.com, pratikp@codeaurora.org Subject: Re: [RFC PATCH v4 12/15] iommu/io-pgtable-arm-v7s: Implement arm_v7s_unmap_pages() Message-ID: <20210408135807.GA17998@willie-the-truck> References: <20210408045241.27316-1-isaacm@codeaurora.org> <20210408045241.27316-13-isaacm@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210408045241.27316-13-isaacm@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210408_145814_211323_BC2871D0 X-CRM114-Status: GOOD ( 14.64 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 07, 2021 at 09:52:38PM -0700, Isaac J. Manjarres wrote: > Implement the unmap_pages() callback for the ARM v7s io-pgtable > format. > > Signed-off-by: Isaac J. Manjarres > --- > drivers/iommu/io-pgtable-arm-v7s.c | 23 ++++++++++++++++++++--- > 1 file changed, 20 insertions(+), 3 deletions(-) > > diff --git a/drivers/iommu/io-pgtable-arm-v7s.c b/drivers/iommu/io-pgtable-arm-v7s.c > index d4004bcf333a..5e203e03c352 100644 > --- a/drivers/iommu/io-pgtable-arm-v7s.c > +++ b/drivers/iommu/io-pgtable-arm-v7s.c > @@ -710,15 +710,32 @@ static size_t __arm_v7s_unmap(struct arm_v7s_io_pgtable *data, > return __arm_v7s_unmap(data, gather, iova, size, lvl + 1, ptep); > } > > -static size_t arm_v7s_unmap(struct io_pgtable_ops *ops, unsigned long iova, > - size_t size, struct iommu_iotlb_gather *gather) > +static size_t arm_v7s_unmap_pages(struct io_pgtable_ops *ops, unsigned long iova, > + size_t pgsize, size_t pgcount, > + struct iommu_iotlb_gather *gather) > { > struct arm_v7s_io_pgtable *data = io_pgtable_ops_to_data(ops); > + size_t unmapped = 0, ret; > > if (WARN_ON(iova >= (1ULL << data->iop.cfg.ias))) > return 0; > > - return __arm_v7s_unmap(data, gather, iova, size, 1, data->pgd); > + while (pgcount--) { > + ret = __arm_v7s_unmap(data, gather, iova, pgsize, 1, data->pgd); > + if (!ret) > + break; > + > + unmapped += pgsize; > + iova += pgsize; > + } > + > + return unmapped; > +} Wait -- don't you need to hook this up somewhere (likewise for ->map_pages)? How are you testing this? Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel