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=-10.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, 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 0BBDEC2BB40 for ; Thu, 17 Dec 2020 12:45:02 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 A45D123884 for ; Thu, 17 Dec 2020 12:45:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A45D123884 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=dn1kkqxvOg8AqBJos7jomg+TcAsQ7/4JxI6Ro1jIarA=; b=ADlNP4GAq5bKGCzMVfHvcKaeZ nCrV9DXVpJHrsRcgPqt3ScskmISXW1emOTFXn9ftMrq2ROn3MuIzM32KaMXdUD2Ux93py307xfgUn BxkRRlgahl6o3oCO418/F+/LgzX5nBTNzBWHh+Mt6BNIWi0k8ablaMpf7a/4f/PMOwZ5p79WBflQc wCajrget0Wg0CxeyCepZBJc2CTYGR3sWJCvqE/aJweHF9DKmEpk8YPrYZ4/Z/OOdPtM49vd6Y4F9c o51j78LkvDdBU4hbrP8ZpDOSKlsHqYoz45Hn3Tad/03fx2H3XXF/0o4nRTHzu/8U9m/iLR5SMTDdu 7JyjLS4dA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpsd1-00079w-Gy; Thu, 17 Dec 2020 12:43:31 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kpscy-00079b-O6 for linux-arm-kernel@lists.infradead.org; Thu, 17 Dec 2020 12:43:29 +0000 Date: Thu, 17 Dec 2020 12:43:23 +0000 From: Catalin Marinas To: Nicolas Saenz Julienne Subject: Re: [PATCH] arm64: Kconfig: select ZONE_DMA Message-ID: <20201217124323.GB15336@gaia> References: <20201217080802.29023-1-peng.fan@oss.nxp.com> <93832374535cb46419e921f5ee02ecabfe2cc83d.camel@suse.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <93832374535cb46419e921f5ee02ecabfe2cc83d.camel@suse.de> 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-20201217_074328_882758_C5830C6E X-CRM114-Status: GOOD ( 16.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peng Fan , will@kernel.org, "Peng Fan \(OSS\)" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org 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, Dec 17, 2020 at 09:44:31AM +0100, Nicolas Saenz Julienne wrote: > On Thu, 2020-12-17 at 16:08 +0800, Peng Fan (OSS) wrote: > > From: Peng Fan > > > > ZONE_DMA should not be disabled, otherwise arm64_dma_phys_limit is > > left uninitialized and cause swiotlb have IO TLB above 4GB which > > might crash some platforms Actually, arm64_dma_phys_limit would be zero-initialised. The ARCH_LOW_ADDRESS_LIMIT becomes ~0UL, hence it covers the whole address space. > > Signed-off-by: Peng Fan > > --- > > > > Not sure whether need to address code to initialize the variables or > > force select ZONE_DMA > > What is the cause for the swiotlb related crashes? I assume it's DMA into an > address too high for the bus, but it might be something else. I think that's the case, swiotlb is not within the low 32-bit of the address space. > I figure you have a setup with ZONE_DMA32, ZONE_NORMAL and !ZONE_DMA. > > First of all, I'd suggest you try arm64's defaults (all zones enabled), the > series I mention above should fix most of the issues we've had with > ZONE_DMA/ZONE_DMA32 in the past. We now parse DT/ACPI and only create two > distinct DMA zones if really needed. Otherwise ZONE_DMA spans the whole 32 bit > address space. > > That said, IMO we're not doing the right thing in the !ZONE_DMA && ZONE_DMA32 > case, and this should fix it (I didn't test it): > > - #define ARCH_LOW_ADDRESS_LIMIT (arm64_dma_phys_limit - 1) > + #define ARCH_LOW_ADDRESS_LIMIT (arm64_dma_phys_limit ? : arm64_dma32_phys_limit) Does this limit need to be inclusive? -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel