Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4818124iog; Wed, 22 Jun 2022 06:30:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v5asaS6q6DvOrQU5G7JKZL1dubzXGUSzWLPzFlIE0VU1NZZjStCZKTMikFBIPNLkJMudR3 X-Received: by 2002:a63:7e1a:0:b0:40c:c3b9:f97c with SMTP id z26-20020a637e1a000000b0040cc3b9f97cmr3051343pgc.498.1655904636116; Wed, 22 Jun 2022 06:30:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655904636; cv=none; d=google.com; s=arc-20160816; b=RTDFEMdb2XTYMEF9VeHT9Khg6ouc/c5kezcMuv8kHh2io/dBfwikBEmjBUeHk1UZc0 HElk/HQ/h/gG2CrLkFyaInubgGBZAtQFBXYOGl3wt9VQqMj2p2VA7lr1VzAfOJNIDHAZ hpw1Ot9n1F3CjrXxXCKRf0UNN5voe2JZLkey+lWSuRii/UDkPZcZz4q/3lmXHob9fVu0 f/yU2N2pDwvclHc87JUiC/Y+fmhhk4210Vt0ECZM41NJGHiCJcGUBsBjDkTd0WKdxshc N4jPnz7ScYNQhNaPxGYomu3l9BgCXi3tefEY1Iqe12pzZ14Il5jHDdIVgxf2B0TaoIJm QuSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=Qos0wtffPi7SlJmjUa79jVr5513FHGhaJ2VhSYAiOiw=; b=PWfsDph4a1u14oSlA2P0vMLyNRdHfE8b2XaN5I2LtXP6EGbYYpHhAT9CNHe1WZgj+9 0oNDo9ztbRmHG564poQYWHZQAhe6zeBxBPdint0dO+/1cnEZLgQiNP3BP6izWON/PTaA I3ReWwdPtYeESHIpcCxgl3Q3JrKf1XDNo7s2p6t8tQGz/ObOzBRrSJFHUkOOi6yBMeGi yXl8WRywhWOMcIFWXiIxxQC/dgJvAELLNVXluZWXyF9eZ36LG4maRfcJi7vrFeIcO4F/ h0IoKExVkWXHR92j0t1b8lcytWbKnY8bo63zwV99b1TQQsZ5UiF3NgNZwnj3yJvmiB/p YUOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=hADOqLi7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l7-20020a170902f68700b0016360b6cec1si26575545plg.230.2022.06.22.06.30.20; Wed, 22 Jun 2022 06:30:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@kapsi.fi header.s=20161220 header.b=hADOqLi7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355253AbiFVN3Z (ORCPT + 99 others); Wed, 22 Jun 2022 09:29:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231546AbiFVN3O (ORCPT ); Wed, 22 Jun 2022 09:29:14 -0400 Received: from mail.kapsi.fi (mail.kapsi.fi [IPv6:2001:67c:1be8::25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7FC2BCC; Wed, 22 Jun 2022 06:29:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: 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=Qos0wtffPi7SlJmjUa79jVr5513FHGhaJ2VhSYAiOiw=; b=hADOqLi7yR5iFGD8+rNuXfoc2o AnD8wEb6RQ8hL/0sN3gkFdOvUHZR9FvscmweapTKvkA91VCNIo/ukO06jyRN63W/MVuzckR42D/3R yExJEsUO/0d9fhU3YsE83frHdzP2CKi3h757rChcRPORurAyx2PP7jcxLEW/4Qmo5j9a2N9PhskLk J0SSzD+iVBUpmX5gBB9JOhtLG8nnQ6UcvFNmdjDNw4oa0N6NMiyQIveUSTLg9iaVirBh7PC0+0lXM qg56lauwwcPxKN+Pq7RkYyS9el0eDmTLMoyiiJb9qbiIUQXIj9ZJeyMvOBuV77rgmuZFQalluQ60R zSc+S02A==; Received: from [193.209.96.43] (helo=[10.21.26.179]) by mail.kapsi.fi with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1o40Pu-000bYH-7S; Wed, 22 Jun 2022 16:29:09 +0300 Message-ID: <9e80da1f-60e9-5528-3636-6443461fb207@kapsi.fi> Date: Wed, 22 Jun 2022 16:29:03 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 2/2] arm64: tegra: Mark BPMP channels as no-memory-wc Content-Language: en-US To: Thierry Reding , Jonathan Hunter , Greg Kroah-Hartman Cc: Mikko Perttunen , Mian Yousaf Kaukab , linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20220622132300.1746201-1-cyndis@kapsi.fi> <20220622132300.1746201-2-cyndis@kapsi.fi> From: Mikko Perttunen In-Reply-To: <20220622132300.1746201-2-cyndis@kapsi.fi> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 193.209.96.43 X-SA-Exim-Mail-From: cyndis@kapsi.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 22.6.2022 16.23, Mikko Perttunen wrote: > From: Mikko Perttunen > > The Tegra SYSRAM contains regions access to which is restricted to > certain hardware blocks on the system, and speculative accesses to > those will cause issues. > > Patch 'misc: sram: Only map reserved areas in Tegra SYSRAM' attempted > to resolve this by only mapping the regions specified in the device > tree on the assumption that there are no such restricted areas within > the 64K-aligned area of memory that contains the memory we wish to map. > > Turns out this assumption is wrong, as there are such areas above the > 4K pages described in the device trees. As such, we need to use the > bigger hammer that is no-memory-wc, which causes the memory to be > mapped as Device memory to which speculative accesses are disallowed. > > As such, the previous patch in the series, > 'firmware: tegra: bpmp: do only aligned access to IPC memory area', > is required with this patch to make the BPMP driver only issue aligned > memory accesses as those are also required with Device memory. > > Fixes: fec29bf04994 ("misc: sram: Only map reserved areas in Tegra SYSRAM") > Signed-off-by: Mikko Perttunen > --- FWIW, with this, the aforementioned patch to misc/sram is redundant. It doesn't hurt, but doesn't really help either. Whether or not it should be reverted, I have no opinion. Thanks, Mikko > arch/arm64/boot/dts/nvidia/tegra186.dtsi | 1 + > arch/arm64/boot/dts/nvidia/tegra194.dtsi | 1 + > arch/arm64/boot/dts/nvidia/tegra234.dtsi | 1 + > 3 files changed, 3 insertions(+) > > diff --git a/arch/arm64/boot/dts/nvidia/tegra186.dtsi b/arch/arm64/boot/dts/nvidia/tegra186.dtsi > index 0e9afc3e2f26..9eca18b54698 100644 > --- a/arch/arm64/boot/dts/nvidia/tegra186.dtsi > +++ b/arch/arm64/boot/dts/nvidia/tegra186.dtsi > @@ -1820,6 +1820,7 @@ sram@30000000 { > #address-cells = <1>; > #size-cells = <1>; > ranges = <0x0 0x0 0x30000000 0x50000>; > + no-memory-wc; > > cpu_bpmp_tx: sram@4e000 { > reg = <0x4e000 0x1000>; > diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi > index d1f8248c00f4..3fdb0b852718 100644 > --- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi > +++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi > @@ -2684,6 +2684,7 @@ sram@40000000 { > #address-cells = <1>; > #size-cells = <1>; > ranges = <0x0 0x0 0x40000000 0x50000>; > + no-memory-wc; > > cpu_bpmp_tx: sram@4e000 { > reg = <0x4e000 0x1000>; > diff --git a/arch/arm64/boot/dts/nvidia/tegra234.dtsi b/arch/arm64/boot/dts/nvidia/tegra234.dtsi > index cb3af539e477..0213a7e3dad0 100644 > --- a/arch/arm64/boot/dts/nvidia/tegra234.dtsi > +++ b/arch/arm64/boot/dts/nvidia/tegra234.dtsi > @@ -1325,6 +1325,7 @@ sram@40000000 { > #address-cells = <1>; > #size-cells = <1>; > ranges = <0x0 0x0 0x40000000 0x80000>; > + no-memory-wc; > > cpu_bpmp_tx: sram@70000 { > reg = <0x70000 0x1000>;