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 710D0C433B4 for ; Thu, 8 Apr 2021 14:32:41 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (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 16B13610CC for ; Thu, 8 Apr 2021 14:32:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 16B13610CC 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 smtp2.osuosl.org (Postfix) with ESMTP id DF92B401BF; Thu, 8 Apr 2021 14:32:40 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KgT5eNBqQWBn; Thu, 8 Apr 2021 14:32:40 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp2.osuosl.org (Postfix) with ESMTP id BFF5540100; Thu, 8 Apr 2021 14:32:39 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id AAF7AC000C; Thu, 8 Apr 2021 14:32:39 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 711D5C000A for ; Thu, 8 Apr 2021 14:32:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 5FE0240115 for ; Thu, 8 Apr 2021 14:32:38 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dIDrZ4-lM-WO for ; Thu, 8 Apr 2021 14:32:37 +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 smtp2.osuosl.org (Postfix) with ESMTPS id D8B8140100 for ; Thu, 8 Apr 2021 14:32:37 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 8C8C1610C7; Thu, 8 Apr 2021 14:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617892357; bh=bnvDob5CztkbQUTwJofxCyEWEfxMl4WR1ds+3MCG2bU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EubHS+SS5+R2YdFDGsq4j/i9986/4BeTdsdE/Oo7lnSWR7ZtteiGELjdkORrhDqXp loRu07iqgMlDdWzgWSumOvYOM0cZFJxg7lx/9ciim4O+YSbc+Uu56LeC4Dz/VlqOKO rcWVlIt9p6tQV2s4xcwMoIkdeqQDSFolHUhd1cE0J/dQgwLVnVyeevN9xAaS3ulHbg srYBS3q6zOGt2sAZTDCKxrWJ+lqeNMDqxVOBP2qvk5wi0uBzwwm0jnRmbPSgTOSgJk Y9ZR5k+gpwEwj1EUI1NntWSp3PO5yWOe7vRsKwBdC/IrU18DRaNL1m4GC2006HcJcw f6tfZg+FtIO6A== Date: Thu, 8 Apr 2021 15:32:33 +0100 From: Will Deacon To: isaacm@codeaurora.org Subject: Re: [RFC PATCH v4 12/15] iommu/io-pgtable-arm-v7s: Implement arm_v7s_unmap_pages() Message-ID: <20210408143232.GF17998@willie-the-truck> References: <20210408045241.27316-1-isaacm@codeaurora.org> <20210408045241.27316-13-isaacm@codeaurora.org> <20210408135807.GA17998@willie-the-truck> <342d453c1e5d737122b43be006de6077@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <342d453c1e5d737122b43be006de6077@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 Thu, Apr 08, 2021 at 07:19:29AM -0700, isaacm@codeaurora.org wrote: > On 2021-04-08 06:58, Will Deacon wrote: > > 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)? > Done. Likewise for map_pages(). I'm not sure how the compiler didn't catch > this; I'm compile testing this, as I don't have hardware that uses the short > descriptor format. Damn, neither do I :/ My seattle has all the memory high up iirc. 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,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 69C39C433B4 for ; Thu, 8 Apr 2021 14:34:23 +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 0B4A860FF1 for ; Thu, 8 Apr 2021 14:34:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0B4A860FF1 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=c852z98lmPpvqush7vGvGksyJkPz8YKrzsDAkc12odQ=; b=RhxbtSbWOeNxI997jobmf1Hep BXOrko5Kq5Jx/R4PG0feiWp0hEH1UDQsgqisMc1aLh3bGJ8wT8ZCDPkO50UXUNQSMVWl8qsO1d+zi RWrJsq8nvS5CsKwjgqpYuCUw6nf/FjCv3F0f326/lYnbyb45whfRt0JN69hAbDPe33wRyFK6eYEBM hscHt+eCSv9XPdkOW5H0q+35kCEavMmPf/3UfNmhkjDpUfOMceu5GVEp8fxpl4xswsadkb9JbZhXc vZ09ROUE/1JiM/9hBVrwDWx6DPK813xWZ3mgKBt/s12bAn73rHVTHop/3dZ2elt0Wwpx5dXHKsbh1 /nMUPKMfA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUVi7-008G49-HC; Thu, 08 Apr 2021 14:32:43 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUVi2-008G3V-Ss for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 14:32:40 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8C8C1610C7; Thu, 8 Apr 2021 14:32:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617892357; bh=bnvDob5CztkbQUTwJofxCyEWEfxMl4WR1ds+3MCG2bU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EubHS+SS5+R2YdFDGsq4j/i9986/4BeTdsdE/Oo7lnSWR7ZtteiGELjdkORrhDqXp loRu07iqgMlDdWzgWSumOvYOM0cZFJxg7lx/9ciim4O+YSbc+Uu56LeC4Dz/VlqOKO rcWVlIt9p6tQV2s4xcwMoIkdeqQDSFolHUhd1cE0J/dQgwLVnVyeevN9xAaS3ulHbg srYBS3q6zOGt2sAZTDCKxrWJ+lqeNMDqxVOBP2qvk5wi0uBzwwm0jnRmbPSgTOSgJk Y9ZR5k+gpwEwj1EUI1NntWSp3PO5yWOe7vRsKwBdC/IrU18DRaNL1m4GC2006HcJcw f6tfZg+FtIO6A== Date: Thu, 8 Apr 2021 15:32:33 +0100 From: Will Deacon To: isaacm@codeaurora.org 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: <20210408143232.GF17998@willie-the-truck> References: <20210408045241.27316-1-isaacm@codeaurora.org> <20210408045241.27316-13-isaacm@codeaurora.org> <20210408135807.GA17998@willie-the-truck> <342d453c1e5d737122b43be006de6077@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <342d453c1e5d737122b43be006de6077@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_153239_280133_F37F2F8E X-CRM114-Status: GOOD ( 18.34 ) 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 Thu, Apr 08, 2021 at 07:19:29AM -0700, isaacm@codeaurora.org wrote: > On 2021-04-08 06:58, Will Deacon wrote: > > 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)? > Done. Likewise for map_pages(). I'm not sure how the compiler didn't catch > this; I'm compile testing this, as I don't have hardware that uses the short > descriptor format. Damn, neither do I :/ My seattle has all the memory high up iirc. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel