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 A37FAEB64D7 for ; Fri, 16 Jun 2023 14:54:43 +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=I9Jsu4O+8OOmsH13PY37VbmB6tkQns5aijoWc74TKbA=; b=KESjzDFzJeV+jj Aq+Tjf05DIsZ/Q4JjFYkiSkBSzSGCOxzPKaGOQtFqpG03MQPpodZH4bwFyYqzFxWUqxJ0YbL4ySF3 quEh5LvzEAvv2P89K6gX9tGVHOUc8LvPxWyqnrjggjHjnqoAz4ykM9EoQf7mFSpqpgD3ghUMpeiqg ppyvXV8m5QwoH0nREwVeEVG4JP2ks/6aWqZH9IzTQFILuhBrLYgyw0lrCpDxErJaXJtvu+IDr4Na5 v3E0mByRlstFJ9A0nLfg27t55yy/RJ1LOlhK9P1dM8yvTNM7EPiUBpgc+8xwDd/RRNj7EAOACjmsd wOXV4uwGf6NkgNFuthvQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qAAqB-000rv5-0u; Fri, 16 Jun 2023 14:54:19 +0000 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.169]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qAAq7-000ru4-2P for linux-arm-kernel@lists.infradead.org; Fri, 16 Jun 2023 14:54:17 +0000 ARC-Seal: i=1; a=rsa-sha256; t=1686927250; cv=none; d=strato.com; s=strato-dkim-0002; b=KGkoAUAKeMtiRBHVomx2iWOqlEDsXi0cSjrFNf+LsOCs1wXYKi/BYdHwuyDBjmwcTc rj3cruwD7eEp22/9acWr0IRg8X83RcwmgDD29sfEaKhuKhOsdNI6HStAmLQS9p5JEOms tA085JRZcrlj1lI/q7HT1cueuC6LOjD+y0IP7yLoRnjRNjCmcmjdgjdhODrmN9cGo/U8 4GkTHD4NqcdISWLoZgdGghrx57UwSdRkSni4FGrnwV2KjLnh/+1O5rDiJKTpJof/2qHJ HuZhbN9O0H67iCUEatgZodYQt83yp4wHen92lvfKRv7yCq5m8wwHMUGs5SLzyShS3Lsa 8QUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1686927250; s=strato-dkim-0002; d=strato.com; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=CovIgCHeF0fMuwJihtOV1zblRbWNaXqCptxNFr1SbO8=; b=MvxaxHqptbHO5z4fRe/eq1Oavixy9RumPWI1w16fgP698bw0xVFY9LsmgWbAydRHUB XW4PeLE6uFa73/RTxQQwkb10T5ZZ4SrYnbwFuM8f0yFGnLksfF9S2bjX/X0Oj/hTWM00 3dcFg4VqtJJLwpIggI73vf2qLsVyN7arg7919EqXWoBbDx5JiVrZJfFS3qbmFyQi9w5X VZew28S/AXrSM7GEUr9I0bMviXLzRC/4YEZl88JsIMe1niVOqulz2jg+jG2IpWE63nAJ pkOzpJXhqL4dWMlB0dMM1wudiRis2XfE41vSoGhlw23Sx64Dzt0BHNcDSGROC9XruWJ9 0l7A== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo02 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1686927250; s=strato-dkim-0002; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=CovIgCHeF0fMuwJihtOV1zblRbWNaXqCptxNFr1SbO8=; b=NzPhoOj1mlA1aThMZ4IIPGuanB+Yj3cmkW+pgpE6O4BeuiUSj0kvAm9EaRn9oVsN0Q 5KYTxKhCr0JSe8s7wNaAcLiHO5QCsyjosFjtjv/LIvy1HeQY1peGcryKfdOuze1hgE58 nsRIcwvTVEiXhSjpbHBQhevVblgIMhj18t9Pbgas6QXUlcgPGyq8zb1yDlO6q/FyNoQZ +6MfQiFBIl6sZ7TWxKfiRJo5tDIDxUwZxUlUWHQ6zknA7qUqZ+xUdQp+XDPGDF8l5B73 OmEj0f0QnDGgB7E7TeqPP41jBTNiAyCpXDoycOQ2Ln1SMG3UQS+3WI3jL4guWGf+yLpc 6QjQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1686927250; s=strato-dkim-0003; d=gerhold.net; h=In-Reply-To:References:Message-ID:Subject:Cc:To:From:Date:Cc:Date: From:Subject:Sender; bh=CovIgCHeF0fMuwJihtOV1zblRbWNaXqCptxNFr1SbO8=; b=Zkx1xt2T3doGB6GlxCwLHaKDZDGpC4Kb/WZ2WhNNIKNVhO48qpnoho811c1c2ExC6M k9QJvX5el2RmT6PXGRCA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVOQ/OcYgojyw4j34+u261EJF5OxJD4peA8pqP1A==" Received: from gerhold.net by smtp.strato.de (RZmta 49.6.0 DYNA|AUTH) with ESMTPSA id D0d0a8z5GEs971L (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 16 Jun 2023 16:54:09 +0200 (CEST) Date: Fri, 16 Jun 2023 16:54:03 +0200 From: Stephan Gerhold To: Konrad Dybcio Cc: Douglas Anderson , andersson@kernel.org, Manivannan Sadhasivam , konrad.dybcio@somainline.org, sumit.semwal@linaro.org, Will Deacon , amit.pundir@linaro.org, Sibi Sankar , linux-arm-msm@vger.kernel.org, Stephen Boyd , linux-arm-kernel@lists.infradead.org, Andy Gross , Conor Dooley , Krzysztof Kozlowski , Rob Clark , Rob Herring , cros-qcom-dts-watchers@chromium.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Nikita Travkin Subject: Re: [PATCH] arm64: dts: qcom: sc7180: Mark SCM as dma-coherent for trogdor Message-ID: References: <20230615145253.1.Ic62daa649b47b656b313551d646c4de9a7da4bd4@changeid> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230616_075416_200694_89B16518 X-CRM114-Status: GOOD ( 22.14 ) 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 Fri, Jun 16, 2023 at 01:20:09PM +0200, Konrad Dybcio wrote: > On 16.06.2023 09:10, Stephan Gerhold wrote: > > On Thu, Jun 15, 2023 at 02:52:54PM -0700, Douglas Anderson wrote: > >> Trogdor devices use firmware backed by TF-A instead of Qualcomm's > >> normal TZ. On TF-A we end up mapping memory as cachable. Specifically, > >> you can see in Trogdor's TF-A code [1] in qti_sip_mem_assign() that we > >> call qti_mmap_add_dynamic_region() with MT_RO_DATA. This translates > >> down to MT_MEMORY instead of MT_NON_CACHEABLE or MT_DEVICE. > >> > >> **Apparently Qualcomm's normal TZ implementation maps the memory as > >> non-cachable.** > > > > Are you sure about this? From the discussion in the chat the conclusion > > was that we can check easily for TF-A, but we have absolutely no idea > > what Qualcomm's firmware implementation does. It might be "broken" the > > same way and we just have not noticed it yet. > Nikita (+CC) was able to boot Venus (which uses that memory reservation > call, I believe) on next-20230615 with a WP firmware, so it should be okay.. Unfortunately we cannot draw any conclusions from a working case. Doug mentioned this happens only with CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y [1]. But even with that in theory there could be side effects that invalidate or evict the cache line, making it look like it's described correctly but it will just explode at some later point. It's more reliable to draw conclusions from a failing case: I asked Nikita to test with "dma-coherent" added to SCM on the WoA firmware. This fails with similar errors Doug had without the property ("Assign memory protection call failed -22"). Clearly the firmware did not read the proper values were just written into the cache. So it's indeed reasonable to assume that Qcom's implementation maps the memory as non-cacheable. Feel free to disregard my original comment then and keep the sentence. :) Thanks, Stephan [1]: https://lore.kernel.org/linux-arm-msm/20230614165904.1.I279773c37e2c1ed8fbb622ca6d1397aea0023526@changeid/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel