Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp439717pxb; Wed, 3 Mar 2021 07:06:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhQETsI87LTs56hzrYqa4ReAHKXrAxdW7Dzrdbcn7YjWyPmq+xj0fCEILreI7ytfcOAkLW X-Received: by 2002:a19:6c6:: with SMTP id 189mr16209208lfg.426.1614783970764; Wed, 03 Mar 2021 07:06:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614783970; cv=none; d=google.com; s=arc-20160816; b=q+cYhx4T+IdOBNmMw8difZ/WQuXSRH9oxbrRgmiNNMCr53L8z+fCW6jC1U1++2HL1H gOdanRm1W4pLSnh1caG9wLNV51BtxeaOSSMGO4k9DywIu9hYvHId3VKiCceGyst/ZQ5G PsMhXeKwKDTuguh418Nx7n4CmG5GK8abqZUZotYi4tEJZna2kWvee0CAbfdm758uP2OK m9oTIvW1mjqmqpOZFZxeW4etfjWi7sYoCF3fREQq1N3Hjl21LX75iFW8wsH4i1uhqNQF OcRDispz3El+2VdfM4A2Tq/YpOLWM4RDjb4T0ZEDanoRZfQeFW17wQyryBj4fBTg96fZ MndA== 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=aVd1Wypu5jVdKbvX5Kiy1S7Ir/Ym33/C9/oLzTPcEe8=; b=c9eMMrHmbNGaCkkfgAUKdLsDGlOBfLOXiP4QWiHbU8o+m6zMO1EwOcmEhH2gh0dvXg CJUmfiX1M4IkA5EjE6xfVYTMcXDQTjvNrC03F7zvzjmRs9+uWGJVj3IEaVEVGvzndu0A 4AHRBGiM5c8+anqnOjik4NWK4uBCjku9wmQ+fUcWBiuMERYAjH9jFeNvUTMY26GU43HJ 4A1dcrOoA2J4A+r0CCKDFmasKGcXiQSJEKatxqYlfaiDR4lV+7pvtDNRZhhZx1D0QCmI 6e7YWnvS4PCa23o8Loq8cmBtaHbT03JjsoqDQQ2a0Iqo7mua544BhIOGzk9Kvmtqn7dK Yt4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ctRb2iOQ; 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 f19si4564292edx.438.2021.03.03.07.05.16; Wed, 03 Mar 2021 07:06:10 -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=ctRb2iOQ; 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 S245495AbhCAWfT (ORCPT + 99 others); Mon, 1 Mar 2021 17:35:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:57964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237680AbhCARh4 (ORCPT ); Mon, 1 Mar 2021 12:37:56 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D7557650BC; Mon, 1 Mar 2021 16:55:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614617711; bh=BKgtbJ0Fx5qD69eqpuLORGDbXLwqz+1z7NJuD9XFzAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ctRb2iOQmGvaFESEcu9EKtLwT+0p+6JVPqSu5CgswGAveUrwxQO+MgyLMc9N5Oz7Z pjwAavHkLZdQ+FwqdsvUpvUjtY96zTplAVPMCROsR9zrS7kyfHvtrq3XRODTyHtFaY aW1wQITTgzkKWhp1+0FC14z7Y/Pvdyk1x8riD8Ic= 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 5.4 170/340] ARM: 9046/1: decompressor: Do not clear SCTLR.nTLSMD for ARMv7+ cores Date: Mon, 1 Mar 2021 17:11:54 +0100 Message-Id: <20210301161056.667580356@linuxfoundation.org> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210301161048.294656001@linuxfoundation.org> References: <20210301161048.294656001@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 93dffed0ac6e0..cbe126297f549 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -1142,9 +1142,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