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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 54CDDEB64DC for ; Thu, 15 Jun 2023 21:25:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2+/z6/abKuuQ+OHIGLik0VAXn5IDTRhOHwOarQ/xn04=; b=1Gkdhe/6SvqBFa Pwvf0jFOZt9Ao36/Wr3Scfisw3Y4luoeMuoSIE3m8t9+Onpq0hxTRF6d4k357ZLz2FrNOlCVpoQ4i oQTsHbqNtF1lNSNMiwQ0fqgclCccbkD4TtN6KNuZaedUeN9ZuOCLQoOxVIxANy/3X/89n4uPhGx6G Xn7MrUzyvj3UxCfeiPlFEPlTb04+RY3WBSKmKPwgHU3Wd2TPOPO1Ug10TI8yCFJdYm9Og/nzbUxPR SHusXyTT1bQlkB8zdQFm2PtNTg44ckwVTtmVApVmfrHGf0BH7FHjTOae1oUWtBP0wO8qjrbY7JBPw vIqqxd3qqboAL8vrrc1Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9uTD-00G8ey-2D; Thu, 15 Jun 2023 21:25:31 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9uTA-00G8de-1J; Thu, 15 Jun 2023 21:25:30 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 457C31FB; Thu, 15 Jun 2023 14:26:10 -0700 (PDT) Received: from [10.57.85.251] (unknown [10.57.85.251]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9CC173F663; Thu, 15 Jun 2023 14:25:24 -0700 (PDT) Message-ID: <67aab611-29cd-1a80-d0e2-e5b6523b2785@arm.com> Date: Thu, 15 Jun 2023 22:25:19 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH v2 3/3] iommu: rockchip: Allocate tables from all available memory Content-Language: en-GB To: Jonas Karlman , Joerg Roedel , Will Deacon , Heiko Stuebner Cc: Benjamin Gaignard , iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org References: <20230615201042.2291867-1-jonas@kwiboo.se> <20230615201042.2291867-4-jonas@kwiboo.se> From: Robin Murphy In-Reply-To: <20230615201042.2291867-4-jonas@kwiboo.se> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230615_142528_488246_509DC329 X-CRM114-Status: GOOD ( 16.61 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org On 2023-06-15 21:10, Jonas Karlman wrote: > Newer Rockchip SoCs, RK356x and RK3588, support more then 4GB of memory. Older ones supposedly did too, e.g. commit 79db45be2b8b ("ARM: dts: rockchip: convert rk3288 device tree files to 64 bits"). Are we certain that nobody actually has a system with IOMMUv1 and more than 4GB of RAM? > However, the RK IOMMU driver is using the GFP_DMA32 flag to limit > allocation of the discovery and page tables into memory below 4GB. > > Let's remove this limitation now that the discovery table address is Nit: s/discovery/directory/g again Thanks, Robin. > correctly configured for addresses above 4GB. > > Signed-off-by: Jonas Karlman > --- > v2: > - no change > > drivers/iommu/rockchip-iommu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c > index 62be9bf42390..46498fc382ee 100644 > --- a/drivers/iommu/rockchip-iommu.c > +++ b/drivers/iommu/rockchip-iommu.c > @@ -727,7 +727,7 @@ static u32 *rk_dte_get_page_table(struct rk_iommu_domain *rk_domain, > if (rk_dte_is_pt_valid(dte)) > goto done; > > - page_table = (u32 *)get_zeroed_page(GFP_ATOMIC | GFP_DMA32); > + page_table = (u32 *)get_zeroed_page(GFP_ATOMIC); > if (!page_table) > return ERR_PTR(-ENOMEM); > > @@ -1076,7 +1076,7 @@ static struct iommu_domain *rk_iommu_domain_alloc(unsigned type) > * Each level1 (dt) and level2 (pt) table has 1024 4-byte entries. > * Allocate one 4 KiB page for each table. > */ > - rk_domain->dt = (u32 *)get_zeroed_page(GFP_KERNEL | GFP_DMA32); > + rk_domain->dt = (u32 *)get_zeroed_page(GFP_KERNEL); > if (!rk_domain->dt) > goto err_free_domain; > _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip