Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp399458pxb; Wed, 3 Mar 2021 06:13:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJySmi1w0pKEF7kqW9HRTWaIUsaojzHIc5PCQ+gr6G09msEmJiDMOqoZcro1JSj4kS43NSYv X-Received: by 2002:a50:b5e4:: with SMTP id a91mr25832843ede.173.1614780784065; Wed, 03 Mar 2021 06:13:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614780784; cv=none; d=google.com; s=arc-20160816; b=AUPqe2AE270mukv0I2Me7tB0CIdPYb3PTSD22XU4IDGtP63FS0dN4inXkWpDvGsg/N AiyaW2rav8h0UIEt3Pd4fHeutRJztmz/y0+gaghsrme+zYFg27pjSn9FR6FqNmO5S/RF IHXdUSPe0wZJyHfCHCFc2PV/Lm1k3Do+9SRSU2nR0WwzRBWKLrqg7hQORabjs+LZaAYS EF9YVuyqAJ+6m2J5shQm/bhqR9v6psEccpChsRfun2Ua/d9N2iFk0NZJpgewXGasfNIC pJ3X7+Z640c4oA4JS+rQmg9YcALv6g9tsps5ijnyPppKVbUofytxnydW3PkIOcVObou3 hgrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=h7cTaZmKT1McMgx/yPh1i2My12OawMfs6blaP+HIQk0=; b=LdBUS2SiPos+p0bbB8MOaxS470+0Y2aN17iIBaiGSfG0NFIHMHejzX4Vta+AEirCs6 EUoG5aUkcfC3rGerrhqc3RFSBCftrzWVEbhlbeQZKgbTxQ2IQPtl2e9WfrYmuzIM5hmR XXjKAaZvBWQ/YZ8lq++vlpdFwiKN91EvFbcFR6j97tvNNamhTeMkYmeTk5AAXWp5jZUr okDrTtmyHHVo35onWvGe1AdfjvJKmrmK2Q8nDCTL8rD1Y739fJeMsP7YnzMUS7EvJMqL PY6bvJSzfzh0ASAz1Rt+LKI/7ukXRvsWaTwt4yHNW0euLP9+tJLuoJLF1aoWqYxvwHJL JcXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Lg01vW6E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si15632164ejy.298.2021.03.03.06.12.18; Wed, 03 Mar 2021 06:13:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Lg01vW6E; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242592AbhCAUrn (ORCPT + 99 others); Mon, 1 Mar 2021 15:47:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:35190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235394AbhCARIe (ORCPT ); Mon, 1 Mar 2021 12:08:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 7329465011; Mon, 1 Mar 2021 16:41:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614616909; bh=vy9dCW6OUUIJWTA/T1lenQztPIGrvEfHvRJkZnWzSHg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Lg01vW6ETuMs1Hv/WMOk9189BeYeuC5pMawi3feOmnKmkPfrd+BLvcYgMymNGscBf C/McDqLmcQedIx4p0RIobAAimbMGWi2sIQo1p1IUnwkgtzz8M22Z3PV3NI7SkuhUdB mkBfNRkV9hbvxMOmveZlmFiC141hieLtZO/ZKqaQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vladimir Murzin , Russell King , Sasha Levin Subject: [PATCH 4.19 137/247] ARM: 9046/1: decompressor: Do not clear SCTLR.nTLSMD for ARMv7+ cores Date: Mon, 1 Mar 2021 17:12:37 +0100 Message-Id: <20210301161038.376613004@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161031.684018251@linuxfoundation.org> References: <20210301161031.684018251@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Murzin [ Upstream commit 2acb909750431030b65a0a2a17fd8afcbd813a84 ] It was observed that decompressor running on hardware implementing ARM v8.2 Load/Store Multiple Atomicity and Ordering Control (LSMAOC), say, as guest, would stuck just after: Uncompressing Linux... done, booting the kernel. The reason is that it clears nTLSMD bit when disabling caches: nTLSMD, bit [3] When ARMv8.2-LSMAOC is implemented: No Trap Load Multiple and Store Multiple to Device-nGRE/Device-nGnRE/Device-nGnRnE memory. 0b0 All memory accesses by A32 and T32 Load Multiple and Store Multiple at EL1 or EL0 that are marked at stage 1 as Device-nGRE/Device-nGnRE/Device-nGnRnE memory are trapped and generate a stage 1 Alignment fault. 0b1 All memory accesses by A32 and T32 Load Multiple and Store Multiple at EL1 or EL0 that are marked at stage 1 as Device-nGRE/Device-nGnRE/Device-nGnRnE memory are not trapped. This bit is permitted to be cached in a TLB. This field resets to 1. Otherwise: Reserved, RES1 So as effect we start getting traps we are not quite ready for. Looking into history it seems that mask used for SCTLR clear came from the similar code for ARMv4, where bit[3] is the enable/disable bit for the write buffer. That not applicable to ARMv7 and onwards, so retire that bit from the masks. Fixes: 7d09e85448dfa78e3e58186c934449aaf6d49b50 ("[ARM] 4393/2: ARMv7: Add uncompressing code for the new CPU Id format") Signed-off-by: Vladimir Murzin Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/boot/compressed/head.S | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index e205bbbe27949..69e661f574a07 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -1090,9 +1090,9 @@ __armv4_mmu_cache_off: __armv7_mmu_cache_off: mrc p15, 0, r0, c1, c0 #ifdef CONFIG_MMU - bic r0, r0, #0x000d + bic r0, r0, #0x0005 #else - bic r0, r0, #0x000c + bic r0, r0, #0x0004 #endif mcr p15, 0, r0, c1, c0 @ turn MMU and cache off mov r12, lr -- 2.27.0