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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 AF465C433ED for ; Thu, 8 Apr 2021 14:21:52 +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 4D0836101B for ; Thu, 8 Apr 2021 14:21:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D0836101B 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=7n49l4BeqjvvKCrjBvA0rgfxmKeDdLiZk8tz3nxKTy0=; b=KyZqvh6fJ4hOzmweZKW4fAbQ0 mWKDQXCvw6K4YM9OJqIzcjNYQl67V4aEMU1ASvGIl4IyUPeKHin11jcibpmAIKpSWwLlQ7adWtvmO 8WBfdM3w8Ne2d+zS87rDnTK0CBoXkdinf4Gl6B7kQzY3rjTNOmsMxsmO4tK9/oStLb1zu2S4o6kQA LPHQxPf4LtG1cro7a61KL1S1FOjE6PzxGsMvYqj1AJRIEsl4x/gUXtkfFl91eHdrH7VRhfvw8v5qV mgrw/6/3SnwqqG8kIsK9OLEzcB12MVU8yI0OiVNrG7c9Nex6/sLTdK8bQvkt/S/MlwKNOiaDNBiRa 0qO7Jj27g==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lUVWE-008Emm-Un; Thu, 08 Apr 2021 14:20:27 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lUVW7-008El0-VM for linux-arm-kernel@lists.infradead.org; Thu, 08 Apr 2021 14:20:22 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 658EB610A3; Thu, 8 Apr 2021 14:20:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617891618; bh=uLoXvvSUzFFbjBNWJhGTe7w4vOJZpuFCXoBODBm9LbQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oW6lF5DbIp/mElokhuciKRVNfWMadHR0Nrb8uFMBPaDP5Iitxbx3Axn0PxNxYU0EA lA7aKb5Zc/NcVY0D7VzKnk+d+PxcYvrIS1dApUnYuW2ljuT2thD8TZBZzoQk+VrkQO 4lecKizF2238BTEVd6h8e/IPLDTnCvRGhkI/M+zCYu7wGdWzmPYFPgrkYgJADqRm5i 5H2giEGDu5LA9SBsHyF+0U5BRy8JYlfWEEN5cbi2SFBswTvdErrOo8F8fUR1j6oRHo mGKYxRtejMOCG4lnOR3b00RnAlOnjsqiNiJzgO4P9zHJUzBXaY9Qw8xfPyK3zGN7VZ Y04eBfCAs/sMw== Date: Thu, 8 Apr 2021 15:20:14 +0100 From: Will Deacon To: Christoph Hellwig Cc: "Isaac J. Manjarres" , pratikp@codeaurora.org, iommu@lists.linux-foundation.org, robin.murphy@arm.com, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH v4 09/15] iommu/io-pgtable-arm: Prepare PTE methods for handling multiple entries Message-ID: <20210408142014.GD17998@willie-the-truck> References: <20210408045241.27316-1-isaacm@codeaurora.org> <20210408045241.27316-10-isaacm@codeaurora.org> <20210408135925.GC17998@willie-the-truck> <20210408140230.GA3884124@infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210408140230.GA3884124@infradead.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_152020_318886_55C3214A X-CRM114-Status: GOOD ( 15.59 ) 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 03:02:30PM +0100, Christoph Hellwig wrote: > On Thu, Apr 08, 2021 at 02:59:26PM +0100, Will Deacon wrote: > > > -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. > > syncing over a page boundary is perfectly fine. It just needs to say in > the bounds of the original mapping. Yes, you're right. I got the CPU page size mixed up with the IOMMU page size, so I think we're good as the allocations here are made at IOMMU page size granularity. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel