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 BE402C77B75 for ; Wed, 17 May 2023 14:45:53 +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-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=jRj5sWHMT2x4b2omsXkgm3B8LOUc9mBvDgPzIX88UlQ=; b=NxS0XP80Vb3V+1 crG51nzV4Pa+IyRTPzT1r3/74TQrUQBxgQFvCoJbxL9odzLJodrz8YW8cHMvKvBgXvjnsrHCqdzzB 7BkyJC8rPbx7U8ZrfAqL5BvlbEwKtRjU2MIJDTaDMyP7OQH+roA4u6NCDwOUkRcFMX5vrl8b/9Xp3 oUNvA9xwkYvvF4wq+8JclQ5rKd4FcwIHq50XGNCvx2Gg7rWeVxoB9P+7ZPQNp8ORyf1rtUvXGfdr+ kUc9BgoICRiiV7LRVBVSvZxBhLcUWctEnwntbCYsxsVMNEqj5XQgyI1rVTAaF1Dw92E+huT7TxuPH Zt/1NNaGuXFjypUmlUOw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pzIPE-00AB3O-0V; Wed, 17 May 2023 14:45:32 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pzIPB-00AB0V-0g for linux-arm-kernel@lists.infradead.org; Wed, 17 May 2023 14:45:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=ou4mWwQUaLY2yeiEe2Z672/ngFzShumuqU0NF8RK9BQ=; b=zgF+qO0l2PIluaGzWCO/R8Fn5Q G4CcAY2ps93xC9iuIAtgrQoCr2k/PptfJK1ioaDywizjZeYFw1vixoeTm2cE+1esKhnG1oiBUB8Fo QOV1wpMtlvGu6Sohxlo1tEHCrbLkVRMxTjDZ5ACsw/GSYPzWQUCK3Tu7csaJ4Dzuf3FcFBTDmXdJ4 /Yslh4VEY/3Pi5gTU7kgi1uZXk4lJdt6Oqohu4xdCtv/o2XAF9Tx86PU+eN/zQebGuOAGnFIA0+Rd vaxFPkc2yAqD3/Ah06UWgcfHO4aun9CqczHCP6KFS2R4VGfis5PN2H6F1X/zyL6mMzU+z8GsihBZE HnN5OCgA==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:41602) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pzIOz-00086K-Gn; Wed, 17 May 2023 15:45:17 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1pzIOx-0001wm-3i; Wed, 17 May 2023 15:45:15 +0100 Date: Wed, 17 May 2023 15:45:15 +0100 From: "Russell King (Oracle)" To: Stefan Wahren Cc: Arnd Bergmann , Robin Murphy , Florian Fainelli , Maxime Ripard , Christoph Hellwig , Phil Elwell , Linux ARM , Alexander Stein Subject: Re: ARM_LPAE + VMSPLIT_2G cause swiotlb warning on Raspberry Pi 4 Message-ID: References: <41111a5d-cce2-a863-322e-0a5652efa8c5@i2se.com> <58772ea3-ae92-2797-75b9-3b4436211390@arm.com> <6012151c-f60e-8ef9-7f8e-4392366836ca@i2se.com> <5cda1c4b-4c32-4509-9b02-62b2c6b50827@app.fastmail.com> <80e1a2e1-c903-87e6-c900-4bd9dd7b8a8a@i2se.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <80e1a2e1-c903-87e6-c900-4bd9dd7b8a8a@i2se.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230517_074529_254988_550BA470 X-CRM114-Status: GOOD ( 22.15 ) 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, May 17, 2023 at 04:35:35PM +0200, Stefan Wahren wrote: > Am 17.05.23 um 12:54 schrieb Arnd Bergmann: > > On Wed, May 17, 2023, at 12:34, Arnd Bergmann wrote: > > > On Wed, May 17, 2023, at 12:24, Stefan Wahren wrote: > > > > Am 17.05.23 um 12:06 schrieb Robin Murphy: > > > > > On 2023-05-17 07:23, Stefan Wahren wrote: > > > > > > I think LPAE doesn't affect it, the configurations that Stefan > > > mentioned were LPAE with VMSPLIT_2G (broken), non-LPAE with > > > VMSPLIT_3G (works) and LPAE with VMSPLIT_3G (works). I would assume > > > that non-LPAE with VMSPLIT_2G or VMSPLIT_3G_OPT is also broken. > > > > > > > This one? > > > > [ 0.000000] software IO TLB: area num 4. > > > > [ 0.000000] software IO TLB: mapped [mem > > > > 0x0000000069e7f000-0x000000006de7f000] (64MB) > > > > > > Indeed, that is clearly above the .dma_zone_size value from > > > the machine descriptor. > > > > It looks like Arm does not set the ARCH_LOW_ADDRESS_LIMIT > > constant for swiotlb, so it gets the default 4GB maximum. > > > > I think this would work on arm, though it's probably not the > > correct fix in general, as I think MAX_DMA_ADDRESS is meant > > to refer to the ISA_DMA_API limit, not the ZONE_DMA limit.: > > > > --- a/include/linux/memblock.h > > +++ b/include/linux/memblock.h > > @@ -394,7 +394,7 @@ static inline int memblock_get_region_node(const struct memblock_region *r) > > #define MEMBLOCK_LOW_LIMIT 0 > > #ifndef ARCH_LOW_ADDRESS_LIMIT > > -#define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL > > +#define ARCH_LOW_ADDRESS_LIMIT MAX_DMA_ADDRESS > > #endif > > phys_addr_t memblock_phys_alloc_range(phys_addr_t size, phys_addr_t align, > > > > Can you give this a try? > > FWIW: Unfortunately this change didn't had any effect. As expected, because MAX_DMA_ADDRESS is an integer virtual address, and ARCH_LOW_ADDRESS_LIMIT wants a physical address. I think we need to define ARCH_LOW_ADDRESS_LIMIT in arch/arm/incude/asm/dma.h as: #ifndef CONFIG_ZONE_DMA ... #else ... extern phys_addr_t arm_dma_limit; #define ARCH_LOW_ADDRESS_LIMIT arm_dma_limit #endif -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel