Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3100777ybi; Thu, 18 Jul 2019 21:02:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqwrUio1gj/NoxcIxurxi4JpzND/evFV8H9oej1zMV7Q0Q2kWfTcigws+yNf1yHQdteP83xs X-Received: by 2002:a17:902:aa95:: with SMTP id d21mr52131589plr.185.1563508975314; Thu, 18 Jul 2019 21:02:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563508975; cv=none; d=google.com; s=arc-20160816; b=NirV+PXAZ0rEsYX5TSLDPRS+nvyTy7aHfyVy29S0yGnOjOcDtYFFmCCG08wmXajobu sO2jrHXxJZL+e20wXn7eeg/xCyoQXMlzO9vbe7dSFvesJe/+2VY3/ynkzjABp6i7P82m eaA9kcp8AzwNodlUojb8DUIHKDau8yS5gN+46srRuQ+2Tf9Jn4VDViGt6vFjiO207Qjf SJKTkHR77VqCglCZ9DnayASdtjaMsYrr2kfjPAAvI/HltsQRmHKoKn3JZPi3zQyhYFAB ds35Mxv1WmftyVEnIDXwhFHFxtCNyI6ClsAZ5tUZlhqrXDDXtZTPanXeP0yhlwXG3z+T mn5Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/J34jls4ONo3B5CBf1DAfdJhDKmKlqBOTb+iqumGqSQ=; b=Q08dA/GOBtPcXMxHPjiXnTEvp/I91tnhVPfdmt+fbX6L4Kx0w8wW3Gazfom9v742ix qjUh6+toyPg2rtD4ANApvXreWPuJ5l44sALpyyK15PCb1Ip1OEKND86/3vQkV9dZw8s5 DFdJpvBc4TaOG22Rc5CZU2QpHK40rdh6Sm04cFUi+O/qPhqr/AXJvTXBJYix4CnUX4pk nhxheg1gdoKwpLgB1cD2KV6DV90TF0kHHweQ8d+eeTjThz4U/Bw8ZMpNYpUVcym3kD1t lot/RKl0OKcc8fGNZTRM9HpbUWY0CsJCpbjkpskTie6XYjnjStUjtvjbcNYeyLYMLQp7 muEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jckTg3Mm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si2203985pls.69.2019.07.18.21.02.39; Thu, 18 Jul 2019 21:02:55 -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=jckTg3Mm; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729158AbfGSEAk (ORCPT + 99 others); Fri, 19 Jul 2019 00:00:40 -0400 Received: from mail.kernel.org ([198.145.29.99]:60402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729079AbfGSEAd (ORCPT ); Fri, 19 Jul 2019 00:00:33 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BD6C721852; Fri, 19 Jul 2019 04:00:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508832; bh=tZ8sBwu7/Pn4WLf4hymHgONnvNj/gFVPXWjKYdjIz4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jckTg3MmKiARJvvKkfXmy11IWuQNcKM4CKhAabGfm4e+v7WInOAx2UEx43w70OX4C JyYAZ8wQfVloonNZzRj/UGZVaMM87L3ho0gJJ1VqMphHuNH2twizzy5t6xfiltq5qs YijX52g6BYiXcf8TkMc+TCPtEklDffQbZld2I+R4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: James Morse , Julien Thierry , Marc Zyngier , Sasha Levin Subject: [PATCH AUTOSEL 5.2 114/171] arm64: assembler: Switch ESB-instruction with a vanilla nop if !ARM64_HAS_RAS Date: Thu, 18 Jul 2019 23:55:45 -0400 Message-Id: <20190719035643.14300-114-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: James Morse [ Upstream commit 2b68a2a963a157f024c67c0697b16f5f792c8a35 ] The ESB-instruction is a nop on CPUs that don't implement the RAS extensions. This lets us use it in places like the vectors without having to use alternatives. If someone disables CONFIG_ARM64_RAS_EXTN, this instruction still has its RAS extensions behaviour, but we no longer read DISR_EL1 as this register does depend on alternatives. This could go wrong if we want to synchronize an SError from a KVM guest. On a CPU that has the RAS extensions, but the KConfig option was disabled, we consume the pending SError with no chance of ever reading it. Hide the ESB-instruction behind the CONFIG_ARM64_RAS_EXTN option, outputting a regular nop if the feature has been disabled. Reported-by: Julien Thierry Signed-off-by: James Morse Signed-off-by: Marc Zyngier Signed-off-by: Sasha Levin --- arch/arm64/include/asm/assembler.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 570d195a184d..e3a15c751b13 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -96,7 +96,11 @@ * RAS Error Synchronization barrier */ .macro esb +#ifdef CONFIG_ARM64_RAS_EXTN hint #16 +#else + nop +#endif .endm /* -- 2.20.1