Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp4081688ybi; Mon, 29 Jul 2019 18:51:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqy438ow8XKUMikJAtzNWQ6s3FAkLjsL/v36VFpGA1ydglueLOjcDTslnf+0vpqIDbxdaLiP X-Received: by 2002:a63:ed50:: with SMTP id m16mr50425235pgk.209.1564451501568; Mon, 29 Jul 2019 18:51:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564451501; cv=none; d=google.com; s=arc-20160816; b=QWNTQ1bLRSqCOKRvc/y6+FUPbccGeYxjTkmV/MmKUsPtWJwdHmTYvRns8SkFn3wDaY gqjFu9Hf01HioHF5N052nM9SdP9j4tNzacIWn7PCZSli2gDQUQLYD6vmpPu/0wznQnw3 SID/bHSbCFsJ7AF6G0siHgUYoLyFEuBiqYhOGJuEx9/yTs/paLsnAG+uTQLVxk/gMetz 2+Fa8SD01p5SVKcZkDRYbqMiL2fguKoBJIRssCVPb8xUFDSawe+CD0az7Mr4QKXlAqe2 5Yvoi607ypmzStBvIfM4lpOrW1NywUQY3DOotAeSw1nDwPwoDHc05L2ksqIUSp+8BuV4 LhEQ== 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=7DIFO+/HZtNdODcastolwI0MWJdCABpZ8FMfLdMmEr4=; b=SVig7DI1KbL7EJYjHzPufPkIFLHv2w+V6Bl2Ww/teW7xzRBtPUDhz7VzhTN3hcNsTG diJVBptfE1dfswtB1ljPSyhTH635zvL0SHvHpJEBPJi7GTCkhVwGaj+gnJCkqdrLDINq jXIZdx/K7BFvc6JPOQMrKTx+xFyqXdW8FLspgFiEK2/h+hHznT/PokFNBgNkuRcF3JcR LVP9tKchd1EEkId6D5CPiAq9cLg80qPbEAfTXFmqZKnIpEZD5UftjE9CSJKIafszup+U nVhSyzpJNvwgNCEhIKK5fG4fGI4yXm7X6hln4UeqY3T/aXxQlIG2GSptbbNvySJyYwBH qeBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I1R5DrQV; 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 i4si25195231pgj.558.2019.07.29.18.51.26; Mon, 29 Jul 2019 18:51:41 -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=I1R5DrQV; 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 S2389460AbfG2TmJ (ORCPT + 99 others); Mon, 29 Jul 2019 15:42:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:57734 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729370AbfG2TmG (ORCPT ); Mon, 29 Jul 2019 15:42:06 -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 DF0222171F; Mon, 29 Jul 2019 19:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429326; bh=Pc4AGbWAnFsdeRUAkr5mSLk9VgIA/HBJyrByJg+IG1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I1R5DrQVvoJi1iIip6RGRe0y+k6hsQWSa7ajqlFMXVSZEuWd37tm8JHQMH3gz7vNl rZYORuVRImJfet+fRCtvMB021TTKDBcnKXPnvKEuoKA6LZc5aRsb1tyLgm8pICW5uy ZW899NuQzUN25We6fOT0h13kecVmprUfpw2uxIi8= 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 4.19 061/113] arm64: assembler: Switch ESB-instruction with a vanilla nop if !ARM64_HAS_RAS Date: Mon, 29 Jul 2019 21:22:28 +0200 Message-Id: <20190729190710.058948087@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190655.455345569@linuxfoundation.org> References: <20190729190655.455345569@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 [ 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 f90f5d83b228..5a97ac853168 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -112,7 +112,11 @@ * RAS Error Synchronization barrier */ .macro esb +#ifdef CONFIG_ARM64_RAS_EXTN hint #16 +#else + nop +#endif .endm /* -- 2.20.1