From patchwork Sun Oct 27 21:01:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 177870 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp2543970ill; Sun, 27 Oct 2019 14:24:43 -0700 (PDT) X-Google-Smtp-Source: APXvYqzUhU7dk47Bl72KeuOt58eZgYbl0KhuaL8dqep89dOcJD3Yau2GsmVzcfKYz1zSl9Fh9Oqv X-Received: by 2002:a50:fc0a:: with SMTP id i10mr16011590edr.94.1572211483654; Sun, 27 Oct 2019 14:24:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572211483; cv=none; d=google.com; s=arc-20160816; b=TVpqAP6WJ0xnDrR/f8TaiSDOeBdV5Zoj8o/YVwsoib5z1NQWOgPKBkuLPNhKAOz/vG FlIpg4QwMqAxOvl/fdB6Q7ib8fXCI93fF3Sh1ip5rhJ+L159JZTxP23VXvwuW2jOBpbM F/QOKjPYvOY42Xc8BG448gLM2OeBlxLADUbL8ARAmHnzVP2pgHJcME4fBLF5j5rYoApN uHGvDUmyORbNLMEklAAdz46yrDkdtXlxOGNM3Su2Accovj+dhI1F6B5FJjvfQFsFvl6s gVD1ePYfUkn5qNJpEGJcs+iclpDOOwd07q8ZvzHGW7yGN18qAlQTR2/GPvcnkTAvBwOh r3ng== 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=OXPH+2R4cnX6Mgyg/80yTGSWGBB7VatrqWM3uoyD82E=; b=jSsaMegVIJl6KABFNd6ebKeUtTu3neOOmCUm7UvHGZLd+omx1/sMIHuO7Dgv/mRsuq 0kGFOAIWnv5sqUUO8a77cq+vmOmxKQEeh2/ZPuCUZqA4quRXjG9UrR1QtFMo5RH/iQYT O+XBPPyK3mEQ9Wy7hIDlHBZq7sfn9vSHft11Si8Wa54IHWsEi3Z5mqdV4uyss82eOiSg fbbyVdUSQpXvObf5oEI7Ta12eLZz/uQpuOksh/nOIiR9XPByFLBJccX1i9GEjJllAtTn WcZcGKbGBd0KCu0EZHt7ygs3XbQ+9nkSVmer+WhCtzXAE6OyNUIATmI3iUqhw4nsd4tB dk0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NDDWs4cf; 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 r15si5014787eji.5.2019.10.27.14.24.43; Sun, 27 Oct 2019 14:24:43 -0700 (PDT) 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=NDDWs4cf; 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 S1732570AbfJ0VYm (ORCPT + 26 others); Sun, 27 Oct 2019 17:24:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:46272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732551AbfJ0VYh (ORCPT ); Sun, 27 Oct 2019 17:24:37 -0400 Received: from localhost (100.50.158.77.rev.sfr.net [77.158.50.100]) (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 46F7421726; Sun, 27 Oct 2019 21:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572211476; bh=eZoloxqdOk1QAe0B1QKXUmeKMwxEs0Risk93QpxCdxc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NDDWs4cfB/oAxFCL1ivWbpOzN8ebQ6LbAhl9bqRqVbnALplVLmHJuEInjUkvvKPv+ hskdKBBuZTnMczxjdkp9e9L2ehibEXX6ifMtsX9MqTsC7QMthKXrZUQ/MpZg6zXeBj wCk2TFuxyMx94nN+8WDyLeTj5QdVmwuHOHd6cdic= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier , Will Deacon Subject: [PATCH 5.3 164/197] arm64: Avoid Cavium TX2 erratum 219 when switching TTBR Date: Sun, 27 Oct 2019 22:01:22 +0100 Message-Id: <20191027203402.902355511@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191027203351.684916567@linuxfoundation.org> References: <20191027203351.684916567@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marc Zyngier commit 9405447ef79bc93101373e130f72e9e6cbf17dbb upstream. As a PRFM instruction racing against a TTBR update can have undesirable effects on TX2, NOP-out such PRFM on cores that are affected by the TX2-219 erratum. Cc: Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon Signed-off-by: Greg Kroah-Hartman --- arch/arm64/include/asm/cpucaps.h | 3 ++- arch/arm64/kernel/cpu_errata.c | 5 +++++ arch/arm64/kernel/entry.S | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) --- a/arch/arm64/include/asm/cpucaps.h +++ b/arch/arm64/include/asm/cpucaps.h @@ -53,7 +53,8 @@ #define ARM64_HAS_DCPODP 43 #define ARM64_WORKAROUND_1463225 44 #define ARM64_WORKAROUND_CAVIUM_TX2_219_TVM 45 +#define ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM 46 -#define ARM64_NCAPS 46 +#define ARM64_NCAPS 47 #endif /* __ASM_CPUCAPS_H */ --- a/arch/arm64/kernel/cpu_errata.c +++ b/arch/arm64/kernel/cpu_errata.c @@ -851,6 +851,11 @@ const struct arm64_cpu_capabilities arm6 .type = ARM64_CPUCAP_LOCAL_CPU_ERRATUM, .matches = has_cortex_a76_erratum_1463225, }, + { + .desc = "Cavium ThunderX2 erratum 219 (PRFM removal)", + .capability = ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM, + ERRATA_MIDR_RANGE_LIST(tx2_family_cpus), + }, #endif { } --- a/arch/arm64/kernel/entry.S +++ b/arch/arm64/kernel/entry.S @@ -1070,7 +1070,9 @@ alternative_insn isb, nop, ARM64_WORKARO #else ldr x30, =vectors #endif +alternative_if_not ARM64_WORKAROUND_CAVIUM_TX2_219_PRFM prfm plil1strm, [x30, #(1b - tramp_vectors)] +alternative_else_nop_endif msr vbar_el1, x30 add x30, x30, #(1b - tramp_vectors) isb