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 387B9C4332F for ; Mon, 14 Nov 2022 14:12:22 +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=YhBncQ2p+x4lwJpJ9HAbUrVV5aUJ1UWbP/sg7icQlzw=; b=phl0Vqy2tMM0/8 KauP0ys8mMHmAFlCi5HSa1roWXCImJkD0pNOlhAPVZs3FbP7kuDk4EUCUbNOeSJx/HSQ2tG9PQuc4 2n4PMtR5jthnxWvXwgB88143Nm/Nt0iioMqFla4I/d6c5ZWqe1U2b8PUSjhfyRnxxXH9hsLa7vcbT rhYnoshfhoKR6UROanItAksy6JDcm11fufH5+IjCnVXjld+wsV2nE1WWMv4DVOFI8K12TAufVuE7a eHIrNM1jIUheaE5FWI035l9Gb2K7KA38H9NLUDRpObmadzzI8vz/JUG14sLsMPGqmpRiFyQ1Hptag hAWGSfjahKNhVjS/xSSQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouaBE-001aU6-0N; Mon, 14 Nov 2022 14:11:20 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ouaBB-001aTI-4b for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2022 14:11:18 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 94007611D1; Mon, 14 Nov 2022 14:11:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 35A8EC433D6; Mon, 14 Nov 2022 14:11:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668435076; bh=R4w9DILmxJRYx6Loru62AND9DGI5a9aHJHQSFYiQLKo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JyYtRwg41NC23yLj85GG3+t1EJwqSNTBQeSXgrDEJkWe+wwS2McNV9xBUFc6sdwfw 0UC5OGNPnXRmaQGoOOQJN/DHTsl2FdKY+r1Me2fQXz+wsQjb4VtTq3mftsrHdVj2Ui znqIEEWLrUZGVV+YHuCKi7lNffizgN4xsNf2Hi3xnW86ErVi6NLTQc14JV+p6EWKxf Y6vOHagJ+lEifEvIvn+BG91jPEvvF+HYCSq2aV0aZIqLMBDE+tIUoaCppGo6ldpvXh a9ZP1K98pE1BEUaalvISh7Soa3/bA1Yvbu/Qq5p20Dc4NkhA6ZXPMZbTadLRfvIXDo AvLBMmgTGIhNg== Date: Mon, 14 Nov 2022 14:11:10 +0000 From: Will Deacon To: Manivannan Sadhasivam Cc: catalin.marinas@arm.com, robin.murphy@arm.com, amit.pundir@linaro.org, andersson@kernel.org, quic_sibis@quicinc.com, sumit.semwal@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Revert "arm64: dma: Drop cache invalidation from arch_dma_prep_coherent()" Message-ID: <20221114141109.GG30263@willie-the-truck> References: <20221114110329.68413-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20221114110329.68413-1-manivannan.sadhasivam@linaro.org> 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-20221114_061117_240066_4B29EB44 X-CRM114-Status: GOOD ( 19.09 ) 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 Mon, Nov 14, 2022 at 04:33:29PM +0530, Manivannan Sadhasivam wrote: > This reverts commit c44094eee32f32f175aadc0efcac449d99b1bbf7. > > As reported by Amit [1], dropping cache invalidation from > arch_dma_prep_coherent() triggers a crash on the Qualcomm SM8250 platform > (most probably on other Qcom platforms too). The reason is, Qcom > qcom_q6v5_mss driver copies the firmware metadata and shares it with modem > for validation. The modem has a secure block (XPU) that will trigger a > whole system crash if the shared memory is accessed by the CPU while modem > is poking at it. > > To avoid this issue, the qcom_q6v5_mss driver allocates a chunk of memory > with no kernel mapping, vmap's it, copies the firmware metadata and > unvmap's it. Finally the address is then shared with modem for metadata > validation [2]. > > Now because of the removal of cache invalidation from > arch_dma_prep_coherent(), there will be cache lines associated with this > memory even after sharing with modem. So when the CPU accesses it, the XPU > violation gets triggered. This last past is a non-sequitur: the buffer is no longer mapped on the CPU side, so how would the CPU access it? As I just replied to Amit, we need more information about what this "access" is and how it is being detected. Will _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel