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=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 DFD9DC433B4 for ; Thu, 8 Apr 2021 14:01:01 +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 7B7DA610E5 for ; Thu, 8 Apr 2021 14:01:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7B7DA610E5 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=nrSv6g/JfPDWOcgI3WUYKuMGNJcc0vQ2xcgXgWrffqA=; b=UR4jC+vBGdFlfGgBFH3n47Xhq t5ejDmJhjZ8I3uynrqV0y8DuycOcmt27onx08AiLg51lBaaEOd6OFeIaK2lJ2mxlgnF3UU99n+9KN 2lxbkc2e5n9ii4GMIfLUk2qOCxk/HTFhQbZwB0bvpfOlnAOYhglY8FzrYKV2U5VrinZgX9IPD1vyC V2OOS/wTnnTfPTrOnhL6i1xaotjgwIAvhiuczSByjase3aICyUGo/x1tdQ+EqFONm2f/Qfbh7h/9t de4qCSa0dwdwO0LTgPwL3bYJYj6yW4qLs4mrDQzK3td2qbw1B+uCcvAe/vlo8zrLZlILZ9P7Qfomk Y3WntUVaw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUVC3-008CiW-9R; Thu, 08 Apr 2021 13:59:36 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUVBz-008Chf-Mn for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 13:59:33 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3AD6C610E5; Thu, 8 Apr 2021 13:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617890370; bh=5WxiFj+zfcSMpEsdijyRfOvg6VNorTqG6TDfdppl/PQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ctpePctjesOlc5aRRx2wqrL12H3cK8WmYPvrPcS9H6S3Md+VgnodkXnpZT9ILZwPG rFE5jCsQIHKRY1NYQ4BulpGW0n9U8c93OrbnKnreVVy6h9UQJAAskFSEbCaCA7pyu8 0+SeFAk4I8h0Tg8CU2S7rsBOrFO2GAJ9340wb8kca+5CZVfGXaC+/OWovVkd/9OlRK He0/77Q/F6vVQsMHC4zLF21xTpRhv92+95jy7e2i90AVn0Wt2HsQamfax9BKq2zsV6 D59gRIA5LFSKtxRXuCYQmxDZG1NWrggGu1GHAWhDdmIMKMFImBZMs3WGxvyCgE12+D PaZ22QWU/JAEA== Date: Thu, 8 Apr 2021 14:59:26 +0100 From: Will Deacon To: "Isaac J. Manjarres" Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, baolu.lu@linux.intel.com, robin.murphy@arm.com, pratikp@codeaurora.org Subject: Re: [RFC PATCH v4 09/15] iommu/io-pgtable-arm: Prepare PTE methods for handling multiple entries Message-ID: <20210408135925.GC17998@willie-the-truck> References: <20210408045241.27316-1-isaacm@codeaurora.org> <20210408045241.27316-10-isaacm@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210408045241.27316-10-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_145931_970397_AC183CD9 X-CRM114-Status: GOOD ( 14.47 ) 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:35PM -0700, Isaac J. Manjarres wrote: > The PTE methods currently operate on a single entry. In preparation > for manipulating multiple PTEs in one map or unmap call, allow them > to handle multiple PTEs. > > Signed-off-by: Isaac J. Manjarres > Suggested-by: Robin Murphy > --- > drivers/iommu/io-pgtable-arm.c | 78 +++++++++++++++++++--------------- > 1 file changed, 44 insertions(+), 34 deletions(-) > > diff --git a/drivers/iommu/io-pgtable-arm.c b/drivers/iommu/io-pgtable-arm.c > index 87def58e79b5..ea66b10c04c4 100644 > --- a/drivers/iommu/io-pgtable-arm.c > +++ b/drivers/iommu/io-pgtable-arm.c > @@ -232,20 +232,23 @@ static void __arm_lpae_free_pages(void *pages, size_t size, > free_pages((unsigned long)pages, get_order(size)); > } > > -static void __arm_lpae_sync_pte(arm_lpae_iopte *ptep, > +static void __arm_lpae_sync_pte(arm_lpae_iopte *ptep, int num_entries, > struct io_pgtable_cfg *cfg) > { > dma_sync_single_for_device(cfg->iommu_dev, __arm_lpae_dma_addr(ptep), > - sizeof(*ptep), DMA_TO_DEVICE); > + sizeof(*ptep) * num_entries, DMA_TO_DEVICE); > } Have you tested this with CONFIG_DMA_API_DEBUG=y? I _think_ it should be ok as long as we don't attempt to sync across a page boundary, but it would be good to give it a spin just to check. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel