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 8FFE7C433ED for ; Tue, 6 Apr 2021 11:58:10 +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 F0CDD61019 for ; Tue, 6 Apr 2021 11:58:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0CDD61019 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=DZP3y1iOZNNFM3+0dUxz1cT0F6OmxM+6Yp22//Z3MDE=; b=Kax/uzTB/XCwFcKK7fbvfb5no ikpbUDe/8md07XlEDS+u3ghlQ7RS8GBmaGwy1QB3RqM4XjCChP8rLGL7vInJZpa9XlttzsMnfxNwy rzpzD4u2iNuATwbfsJck778IFWVGmuLhOvBzlAht5kkrvr4Ala5Ryjv4Ld1OUagW2S5zhYxrW5RNW irFDVpTbylOFYgSiKW5D9qpW4VMMNSfWEZzx7vYCQiFuffIl8BE8zP5SBjjYEb9NKxaZLTlyUuhts wrsHxl6IboKixp18xgjIMGKharcgt6bkopWeQDzOPzsmuG8VAQmQPgQsq+XKPPzQmG5AZMylgLb35 i1OP3XDHQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lTkJW-002SrX-Ez; Tue, 06 Apr 2021 11:56:11 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lTkHT-002SJ9-1x for linux-arm-kernel@lists.infradead.org; Tue, 06 Apr 2021 11:54:05 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6757B613B3; Tue, 6 Apr 2021 11:54:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617710041; bh=FLeSsbLGeBLtqZkfvWRI5YQcQsnaI6eFsqJu2Yc4PJQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Xw/82FklvCfBJz+OnBy2/5/xcDauG0uxmlHHzpwOZ8S5KqEin71n27LfhlbUqg5er DA1SYBDp5utuoUbi5HnCd0SYoiTNz+1LPzoVjsdu4PHYjnBBbU7I+Lx6e7s3N27VA0 bOg6m3OcCsu1nXu1kU2SQozLequYbtmgDrKTwKehLqtUGHdW1HdNpZjo8uuBaQt4ny G6FFGteOjuLiX7y1xharOKpvlfke90Z+ttRSz/2rFMoClJbIPlYnXuXattUuioEnBk sp6UcksOz6MlyO1NvSAszxLjUYd7+7noo3FnIPx2ZEFmwNy5O0JNWmxpLvv0WKwCX2 p/Xx76RkgaGPg== Date: Tue, 6 Apr 2021 12:53:56 +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, baolu.lu@linux.intel.com Subject: Re: [RFC PATCH v3 06/12] iommu: Split 'addr_merge' argument to iommu_pgsize() into separate parts Message-ID: <20210406115355.GC13747@willie-the-truck> References: <20210405191112.28192-1-isaacm@codeaurora.org> <20210405191112.28192-7-isaacm@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210405191112.28192-7-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-20210406_125403_745558_932B9B6C X-CRM114-Status: GOOD ( 16.00 ) 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 Mon, Apr 05, 2021 at 12:11:06PM -0700, Isaac J. Manjarres wrote: > From: Will Deacon > > The 'addr_merge' parameter to iommu_pgsize() is a fabricated address > intended to describe the alignment requirements to consider when > choosing an appropriate page size. On the iommu_map() path, this address > is the logical OR of the virtual and physical addresses. > > Subsequent improvements to iommu_pgsize() will need to check the > alignment of the virtual and physical components of 'addr_merge' > independently, so pass them in as separate parameters and reconstruct > 'addr_merge' locally. > > No functional change. > > Signed-off-by: Will Deacon > Signed-off-by: Isaac J. Manjarres > --- > drivers/iommu/iommu.c | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) > > diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c > index 9006397b6604..a3bbf7e310b0 100644 > --- a/drivers/iommu/iommu.c > +++ b/drivers/iommu/iommu.c > @@ -2357,12 +2357,13 @@ phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova) > } > EXPORT_SYMBOL_GPL(iommu_iova_to_phys); > > -static size_t iommu_pgsize(struct iommu_domain *domain, > - unsigned long addr_merge, size_t size) > +static size_t iommu_pgsize(struct iommu_domain *domain, unsigned long iova, > + phys_addr_t paddr, size_t size) > { > unsigned int pgsize_idx; > unsigned long pgsizes; > size_t pgsize; > + phys_addr_t addr_merge = paddr | iova; Huh, so this was 'unsigned long' before and, given that the pgsize_bitmap on the domain is also unsigned long, then I think that's fine. So using that would mean you don't need GENMASK_ULL for this guy either. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel