From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 928F5C76196 for ; Fri, 19 Jul 2019 04:05:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 633AA218A3 for ; Fri, 19 Jul 2019 04:05:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563509137; bh=yqqCcOc5tlU7mVg6u/TI4ybIZ826IuIwo+1iHic5ebk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=T4qHjgwWH8z2tsb0OiotfsGj5RqhZNT/ji0+aXd52+HGAQCdiHzwGYMw0V8ANul9j v8TxcUt/URkRMegnUClPswheP7YotXLtO7OTUFsKSjIZUIbqMbemHF4S7jk2mdtY4D XtAD1IZFqddWbXRANmGjvUKgT7AL0+VQIsWjqwlk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731760AbfGSEFg (ORCPT ); Fri, 19 Jul 2019 00:05:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:38110 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729943AbfGSEFe (ORCPT ); Fri, 19 Jul 2019 00:05:34 -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 B9C902189F; Fri, 19 Jul 2019 04:05:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563509133; bh=yqqCcOc5tlU7mVg6u/TI4ybIZ826IuIwo+1iHic5ebk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YgTHHcBqHkrd8c07QiC5Ju6u8PBY++ahGvosX3O6zGWoPpGjeuTu0zdCQBU9JAAqP RsHBD9OxHCW7huEVuSfDhRPtcWpiTUMqce6ET07NOW5DItABvAp7LQBcVY1684OWYC ICsR5NpTWEsYAWTuPW6Nk3KoFE95/vbpzKhALjaE= 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.1 088/141] arm64: assembler: Switch ESB-instruction with a vanilla nop if !ARM64_HAS_RAS Date: Fri, 19 Jul 2019 00:01:53 -0400 Message-Id: <20190719040246.15945-88-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719040246.15945-1-sashal@kernel.org> References: <20190719040246.15945-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 c5308d01e228..9155ce473fa7 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -107,7 +107,11 @@ * RAS Error Synchronization barrier */ .macro esb +#ifdef CONFIG_ARM64_RAS_EXTN hint #16 +#else + nop +#endif .endm /* -- 2.20.1