Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3799839ybi; Mon, 29 Jul 2019 12:52:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqx5aq7A2L40Tb9PEStNBBAHH+EPpbOtJyGXTyvqFlH91MxS/3s1KYePpvXxNLw3ftbx3CJN X-Received: by 2002:a17:90a:7d09:: with SMTP id g9mr111253717pjl.38.1564429950222; Mon, 29 Jul 2019 12:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429950; cv=none; d=google.com; s=arc-20160816; b=bjqH7kMcQgJMUgNX3BADCwMtziXG+JMldF4NdUtMPa+Egv46thX+3n3QZb/i9yPgjD mz1EznzsIcOHzIAgDS5zan7b+n0sPiS/6o7ueo/eteCOW0taOObpknptvwj6g3gaI/2d 1wFDN+qzOB4zJnRf2pGk5g1JVyADV0okoLyWYWtTYny8/2idWrBs+17LbOhcRXM5HwZr Ezp2Bzm/vMR3fLhKDt8j1zKKeYA0W8QLD5WVkjYiRvijKsOZhIJvRNJq6s0RG5QS/Y0d JK1JLSNE4h4SoMUyn+r4+8XBDe+JZCDb3kMBYxAEXJRYuk9sagfGpLtBuRC1NRmpLNPT CXSA== 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=6++J95CLnJKAU0QoBPVFAfAkbsvWJBFmcESt2tLJitk=; b=hKB4k/EgrZwUQIvR+9jTv8eHNtZ+SWodf/6W9ixjSrdDAUF49kxPBZE1cRr3/uYY3y ecI5Uf/TWIMR0SriW+0AtU8JkDSL3HKIrFO0/6Bi9trrjKYkuBbdRyStNI9uVgDWlwnE 55s0AS2SH+EZ46Dm6bSBg6psw3PAOoBbFhfb4DxKETpf0LLT0jcrLohVEpoICSdsIkfK BWY73r8XIfOwx9Gwv54J9sqk0HcJcCnUn1Pbb1tOUsz8pTVepB6Is0DrHSJSSI1XlAu8 kDZr1LFuKuJnHqUQyzdFKaV+3EuXtvaOq992dqTywzwJL2KtlJAtC3uvAyYfHHAuS0kD mpUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ch+YbIFH; 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 u20si25368918plq.421.2019.07.29.12.52.15; Mon, 29 Jul 2019 12:52:30 -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=ch+YbIFH; 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 S2390707AbfG2Tut (ORCPT + 99 others); Mon, 29 Jul 2019 15:50:49 -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: 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 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