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.4 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable 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 087DEC4338F for ; Fri, 30 Jul 2021 14:44:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E42BB61059 for ; Fri, 30 Jul 2021 14:44:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239154AbhG3Oo0 (ORCPT ); Fri, 30 Jul 2021 10:44:26 -0400 Received: from foss.arm.com ([217.140.110.172]:43018 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239095AbhG3OoU (ORCPT ); Fri, 30 Jul 2021 10:44:20 -0400 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 809526D; Fri, 30 Jul 2021 07:44:15 -0700 (PDT) Received: from [10.57.36.146] (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE9F33F70D; Fri, 30 Jul 2021 07:44:13 -0700 (PDT) Subject: Re: [PATCH 2/2] arm64: dts: juno: Enable more SMMUs To: Anders Roxell Cc: sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, liviu.dudau@arm.com, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, arnd@arndb.de, lkft-triage@lists.linaro.org, Linux Kernel Functional Testing References: <720d0a9a42e33148fcac45cd39a727093a32bf32.1614965598.git.robin.murphy@arm.com> <0a1d437d-9ea0-de83-3c19-e07f560ad37c@arm.com> <20210730143431.GB1517404@mutt> From: Robin Murphy Message-ID: <8b358507-dbdf-b05b-c1da-2ec9903a2912@arm.com> Date: Fri, 30 Jul 2021 15:44:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210730143431.GB1517404@mutt> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-07-30 15:34, Anders Roxell wrote: > On 2021-07-30 13:17, Robin Murphy wrote: >> On 2021-07-30 12:35, Anders Roxell wrote: >>> From: Robin Murphy >>> >>>> Now that PCI inbound window restrictions are handled generically between >>>> the of_pci resource parsing and the IOMMU layer, and described in the >>>> Juno DT, we can finally enable the PCIe SMMU without the risk of DMA >>>> mappings inadvertently allocating unusable addresses. >>>> >>>> Similarly, the relevant support for IOMMU mappings for peripheral >>>> transfers has been hooked up in the pl330 driver for ages, so we can >>>> happily enable the DMA SMMU without that breaking anything either. >>>> >>>> Signed-off-by: Robin Murphy >>> >>> When we build a kernel with 64k page size and run the ltp syscalls we >>> sporadically see a kernel crash while doing a mkfs on a connected SATA >>> drive. This is happening every third test run on any juno-r2 device in >>> the lab with the same kernel image (stable-rc 5.13.y, mainline and next) >>> with gcc-11. >> >> Hmm, I guess 64K pages might make a difference in that we'll chew through >> IOVA space a lot faster with small mappings... >> >> I'll have to try to reproduce this locally, since the interesting thing >> would be knowing what DMA address it was trying to use that went wrong, but >> IOMMU tracepoints and/or dma-debug are going to generate an crazy amount of >> data to sift through and try to correlate - having done it before it's not >> something I'd readily ask someone else to do for me :) >> >> On a hunch, though, does it make any difference if you remove the first >> entry from the PCIe "dma-ranges" (the 0x2c1c0000 one)? > > I did this change, and run the job 7 times and could not reproduce the > issue. Thanks! And hold that thought; if it works then I suspect it probably is the best fix, but I'll double-check and write it up properly next week. Cheers, Robin. > diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi > index 8e7a66943b01..d3148730e951 100644 > --- a/arch/arm64/boot/dts/arm/juno-base.dtsi > +++ b/arch/arm64/boot/dts/arm/juno-base.dtsi > @@ -545,8 +545,7 @@ pcie_ctlr: pcie@40000000 { > <0x02000000 0x00 0x50000000 0x00 0x50000000 0x0 0x08000000>, > <0x42000000 0x40 0x00000000 0x40 0x00000000 0x1 0x00000000>; > /* Standard AXI Translation entries as programmed by EDK2 */ > - dma-ranges = <0x02000000 0x0 0x2c1c0000 0x0 0x2c1c0000 0x0 0x00040000>, > - <0x02000000 0x0 0x80000000 0x0 0x80000000 0x0 0x80000000>, > + dma-ranges = <0x02000000 0x0 0x80000000 0x0 0x80000000 0x0 0x80000000>, > <0x43000000 0x8 0x00000000 0x8 0x00000000 0x2 0x00000000>; > #interrupt-cells = <1>; > interrupt-map-mask = <0 0 0 7>; > > > Cheers, > Anders > 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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable 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 93175C4338F for ; Fri, 30 Jul 2021 14:46:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 5B55360C40 for ; Fri, 30 Jul 2021 14:46:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 5B55360C40 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=/ekp34H6ca8F7LhSFSD8WNix+CPXsFSnvbUN5jYhwok=; b=qWFTsz5sUdbwHl2sxrt3GZyTwi aK8BJDSlaSOZijfnAsgfOD1eCHi9sRBYTCOJgFbBFTtSgpVDxwarMbBUW5rZfAB5FrPIfB4NZS2/r mNnVMbHE18SzE6wRVCZzENITJgVZy1khYEEjO/R6c640rNFl76r6bMEWeP/S/+2zapVyfM1Beb/Nw 7Z3lQLJTwadzPZPDd18LvQ+SQ/v049pb7/Y7/T8Ekm6UsI6vyRpgwJzUCy7sL7qbxLV0WMzpFdjQe bIO2vVlKm2UhSfjcArd0ja+jmcooPTyNvYaTaX2qgDImR0MbI4Trvspc0ic5rLUhlJLuaRWb5dLPK Q0DrxzCA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9TkM-0090xn-68; Fri, 30 Jul 2021 14:44:22 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m9TkH-0090w2-KM for linux-arm-kernel@lists.infradead.org; Fri, 30 Jul 2021 14:44:19 +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 809526D; Fri, 30 Jul 2021 07:44:15 -0700 (PDT) Received: from [10.57.36.146] (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AE9F33F70D; Fri, 30 Jul 2021 07:44:13 -0700 (PDT) Subject: Re: [PATCH 2/2] arm64: dts: juno: Enable more SMMUs To: Anders Roxell Cc: sudeep.holla@arm.com, lorenzo.pieralisi@arm.com, liviu.dudau@arm.com, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, sashal@kernel.org, arnd@arndb.de, lkft-triage@lists.linaro.org, Linux Kernel Functional Testing References: <720d0a9a42e33148fcac45cd39a727093a32bf32.1614965598.git.robin.murphy@arm.com> <0a1d437d-9ea0-de83-3c19-e07f560ad37c@arm.com> <20210730143431.GB1517404@mutt> From: Robin Murphy Message-ID: <8b358507-dbdf-b05b-c1da-2ec9903a2912@arm.com> Date: Fri, 30 Jul 2021 15:44:07 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210730143431.GB1517404@mutt> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210730_074417_827617_B046534C X-CRM114-Status: GOOD ( 22.27 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-07-30 15:34, Anders Roxell wrote: > On 2021-07-30 13:17, Robin Murphy wrote: >> On 2021-07-30 12:35, Anders Roxell wrote: >>> From: Robin Murphy >>> >>>> Now that PCI inbound window restrictions are handled generically between >>>> the of_pci resource parsing and the IOMMU layer, and described in the >>>> Juno DT, we can finally enable the PCIe SMMU without the risk of DMA >>>> mappings inadvertently allocating unusable addresses. >>>> >>>> Similarly, the relevant support for IOMMU mappings for peripheral >>>> transfers has been hooked up in the pl330 driver for ages, so we can >>>> happily enable the DMA SMMU without that breaking anything either. >>>> >>>> Signed-off-by: Robin Murphy >>> >>> When we build a kernel with 64k page size and run the ltp syscalls we >>> sporadically see a kernel crash while doing a mkfs on a connected SATA >>> drive. This is happening every third test run on any juno-r2 device in >>> the lab with the same kernel image (stable-rc 5.13.y, mainline and next) >>> with gcc-11. >> >> Hmm, I guess 64K pages might make a difference in that we'll chew through >> IOVA space a lot faster with small mappings... >> >> I'll have to try to reproduce this locally, since the interesting thing >> would be knowing what DMA address it was trying to use that went wrong, but >> IOMMU tracepoints and/or dma-debug are going to generate an crazy amount of >> data to sift through and try to correlate - having done it before it's not >> something I'd readily ask someone else to do for me :) >> >> On a hunch, though, does it make any difference if you remove the first >> entry from the PCIe "dma-ranges" (the 0x2c1c0000 one)? > > I did this change, and run the job 7 times and could not reproduce the > issue. Thanks! And hold that thought; if it works then I suspect it probably is the best fix, but I'll double-check and write it up properly next week. Cheers, Robin. > diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi > index 8e7a66943b01..d3148730e951 100644 > --- a/arch/arm64/boot/dts/arm/juno-base.dtsi > +++ b/arch/arm64/boot/dts/arm/juno-base.dtsi > @@ -545,8 +545,7 @@ pcie_ctlr: pcie@40000000 { > <0x02000000 0x00 0x50000000 0x00 0x50000000 0x0 0x08000000>, > <0x42000000 0x40 0x00000000 0x40 0x00000000 0x1 0x00000000>; > /* Standard AXI Translation entries as programmed by EDK2 */ > - dma-ranges = <0x02000000 0x0 0x2c1c0000 0x0 0x2c1c0000 0x0 0x00040000>, > - <0x02000000 0x0 0x80000000 0x0 0x80000000 0x0 0x80000000>, > + dma-ranges = <0x02000000 0x0 0x80000000 0x0 0x80000000 0x0 0x80000000>, > <0x43000000 0x8 0x00000000 0x8 0x00000000 0x2 0x00000000>; > #interrupt-cells = <1>; > interrupt-map-mask = <0 0 0 7>; > > > Cheers, > Anders > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel