Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4024477ybl; Mon, 3 Feb 2020 11:04:36 -0800 (PST) X-Google-Smtp-Source: APXvYqx1Bw8bi2r9wLxgMSNXuzVHjDo5c+rQlO6zqhPGqobMB2/UmPHQW9z5ENj54TZXhjT+KV8S X-Received: by 2002:a05:6830:1d4c:: with SMTP id p12mr19357513oth.198.1580756676146; Mon, 03 Feb 2020 11:04:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580756676; cv=none; d=google.com; s=arc-20160816; b=gYmSg+dJo2YZTBW9MfIGrbovHGk4gdQJYa5DEol7/iOpUMcx1t7+gi4Swh8cKOg4rR TrGVk/QjxLtJpWf86+auflUN96wKtJHmVVCT7jwXnYz10xc3uERgjC2lOenyfvKGf/3F QKKndhHa+aMIDufwjj76ZoTNP6vrnoBCZuFzriFd80EGtEzcTyB4PryDRgMs+klc97pi MsA9znONMVF2YfK2RB/FXpdFQ9KSbhVCLUxGLxOitr3hGbAvzqdYRSczi2XPqZV3168V 0bC1cshzolxDgO8NzAlLTecmcUBwzvUiFFsIRz5RVZd/TqCaYTuI0acPtn3htMNqLy7h TLog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dnndWr72CDv3nJDBDPshfbOwHaXTuVDc0DVXFhGlJe4=; b=UhkdQFNQe3MvonFeJsm6DLQOvd7gYPLjoKVj7E17Kc7JuLs0Wh2FWJT6LuUqZcYZTQ pwmDPYWXE7T8bMdny6Hso2RadR1xvi/JkzT4sLeMk8Vou5YQ1UVV+gAo/xDPwHmgw0ff z6tQix3hQ2FLD+MpcH8H3Ea9cNLjSbuyEE/2KIeni5EjFlcyE76O3MRy2zo1f8xpKRBr S8fz+y8Y+ZQkag55vtU3agXuJ7UhSC2Mo5NiU83rwINTx4PlpnMjVH8Wj3r8s2oIE+fS T/1eA6lnQilaFnGRlN7w7e7TUmC+8vtlX9dJlqE25KROhlSG0z+Lh3Mibc9OMujhstkd CBhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OPcNxugw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 38si10471665otu.166.2020.02.03.11.04.23; Mon, 03 Feb 2020 11:04:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OPcNxugw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729423AbgBCQ1d (ORCPT + 99 others); Mon, 3 Feb 2020 11:27:33 -0500 Received: from mail.kernel.org ([198.145.29.99]:38816 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729420AbgBCQ1c (ORCPT ); Mon, 3 Feb 2020 11:27:32 -0500 Received: from localhost (unknown [104.132.45.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C9C292051A; Mon, 3 Feb 2020 16:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580747251; bh=xOSw62RuoXWZIX9+LIKWM+wn6MT42/NMjSbT1nptbSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OPcNxugwH5nMMmIUzjoTZ94d3OkxnAYjdTI7l3+o0b/bY094mHIXA5zU8V2ttNkYf 3rwsUntAg21w87SXrYEjlaVlY93TpXOGuBDnlSWTDoivPyjEErH7H8NSfKZ4GSNYbX 5uN75wPcCxURu1u+fbYLi+OrQBrq1Y884hM2VtsU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier , Vladimir Murzin , Russell King , Sasha Levin Subject: [PATCH 4.9 54/68] ARM: 8955/1: virt: Relax arch timer version check during early boot Date: Mon, 3 Feb 2020 16:19:50 +0000 Message-Id: <20200203161913.878648447@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200203161904.705434837@linuxfoundation.org> References: <20200203161904.705434837@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vladimir Murzin [ Upstream commit 6849b5eba1965ceb0cad3a75877ef4569dd3638e ] Updates to the Generic Timer architecture allow ID_PFR1.GenTimer to have values other than 0 or 1 while still preserving backward compatibility. At the moment, Linux is quite strict in the way it handles this field at early boot and will not configure arch timer if it doesn't find the value 1. Since here use ubfx for arch timer version extraction (hyb-stub build with -march=armv7-a, so it is safe) To help backports (even though the code was correct at the time of writing) Fixes: 8ec58be9f3ff ("ARM: virt: arch_timers: enable access to physical timers") Acked-by: Marc Zyngier Signed-off-by: Vladimir Murzin Signed-off-by: Russell King Signed-off-by: Sasha Levin --- arch/arm/kernel/hyp-stub.S | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/arm/kernel/hyp-stub.S b/arch/arm/kernel/hyp-stub.S index f5e5e3e196592..f587681a9553c 100644 --- a/arch/arm/kernel/hyp-stub.S +++ b/arch/arm/kernel/hyp-stub.S @@ -158,10 +158,9 @@ ARM_BE8(orr r7, r7, #(1 << 25)) @ HSCTLR.EE #if !defined(ZIMAGE) && defined(CONFIG_ARM_ARCH_TIMER) @ make CNTP_* and CNTPCT accessible from PL1 mrc p15, 0, r7, c0, c1, 1 @ ID_PFR1 - lsr r7, #16 - and r7, #0xf - cmp r7, #1 - bne 1f + ubfx r7, r7, #16, #4 + teq r7, #0 + beq 1f mrc p15, 4, r7, c14, c1, 0 @ CNTHCTL orr r7, r7, #3 @ PL1PCEN | PL1PCTEN mcr p15, 4, r7, c14, c1, 0 @ CNTHCTL -- 2.20.1