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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 0DFB9C7618E for ; Mon, 29 Jul 2019 19:50:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D57322054F for ; Mon, 29 Jul 2019 19:50:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429848; bh=xHRtyLYIyNDPifgkcbUKFdk8gN2kucNNVgwC5pjLSqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=XvukLECsytKMdjOJ5zSC0H8z8dBtYarUIcPjlex1O3i+Vy6zYu3zlcRCGD0wECJvJ iKQRGfaqmo3HsOoEJewH8oEbVcGL4lEC7Ii37xB1/OdVYpmofBJuuKMwp5iAktmRiB /x9csU16hA+CUPoLn9Ae9cCUuw/cVwHwB2C+CKuM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390221AbfG2Tur (ORCPT ); Mon, 29 Jul 2019 15:50:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:41828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390003AbfG2Tur (ORCPT ); Mon, 29 Jul 2019 15:50:47 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 15B5C2054F; Mon, 29 Jul 2019 19:50:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429846; bh=xHRtyLYIyNDPifgkcbUKFdk8gN2kucNNVgwC5pjLSqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ch+YbIFHdIJTsBZZFoxTstNkRLOoUPaPBP1rrqML3l7xcBrFDleJc/IKg66aa8I8M c8+tjv4TkGnG24kJfGHQQFHnzDzZ9Igxmd5bZBMxAy9DHaXnph19HrZq48hNNLOtUR 07CC/XUo6Fi/KeYgVRhobAiL/ElZ016mjkUrvipY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julien Thierry , James Morse , Marc Zyngier , Sasha Levin Subject: [PATCH 5.2 112/215] arm64: assembler: Switch ESB-instruction with a vanilla nop if !ARM64_HAS_RAS Date: Mon, 29 Jul 2019 21:21:48 +0200 Message-Id: <20190729190758.376366301@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org [ 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