From patchwork Fri Nov 8 18:49:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 178951 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3161949ilf; Fri, 8 Nov 2019 11:24:01 -0800 (PST) X-Google-Smtp-Source: APXvYqw+ZhUO/ZpiHyrjkwtvZc7YvalnBKfXHsYM9Woj0hgpVuSRvY26sqESaU3ibc/WMiYg2Yvd X-Received: by 2002:a17:906:5859:: with SMTP id h25mr10668273ejs.2.1573241041488; Fri, 08 Nov 2019 11:24:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573241041; cv=none; d=google.com; s=arc-20160816; b=kVqX9E2P7xegRIJ8owAVwr/USc6o6KIoasSHcwhMv/TliheKh00+lRlRWMGsluZ9H7 PvgiisVLUl50SoSKsMoxHEvEfzVs8s7wFX0ppzbyY9EnvV4zZHvFZXzmb6WaniUSQJWw 4pt20ltNIGSEgD3BHhdXmyeuNBdBEwmBEq2mZ56uejNiTiX2Mk4/R7kUIyOwOIZJey57 OlpFeXILOfLwBhQ7YGfsyMh1FJvxVMW0hq8AMs5eAlBUDztc/SnGzSdPtH/DEAip34+9 reDQMmM7Clzxpbsv4AASEflZL9YT+POoekUbJpWh9UgzjKedTeaoT5ZLXEkHvEj7XugZ c8Pw== 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=Re0ICCxZOABeS1fRydp7wQl5vFVi1D2Rycz8MiT/G28=; b=TKp2b7GWu8uBTfGMfzNA4xoFjAdis5EtLeM0e1DcgZiO6AZIxPna9GoWEkUFHViAw2 Hl/zymyOX2s2TWCklR/VCwLCj0CBvsbghnGxCghfrnaXMVna17vTiUpeQ8BJBMLzF2eo nm0L2VeEl/taR9dos9BVC08QezBgOiTd1jMw02XvAqGHo0XBzVJcmj61HUlvkC2sZ2P+ JCRwBJuxgglnOLDUMTN+HkpkytKLybZ8ahc6XNCFvBup1RO/qS/WTjagzjbFTTZ0TiBl 2XJ5vsWWkkN2l2IDS9NqCdFfpeWNEcqL67nxmNLeLV9S2lAEO/Fgq7Jt3a8+NvTACvOn dhCQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=q+OVtS0N; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 cc20si5332705edb.201.2019.11.08.11.24.01; Fri, 08 Nov 2019 11:24:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of stable-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=q+OVtS0N; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388568AbfKHTYA (ORCPT + 14 others); Fri, 8 Nov 2019 14:24:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:49898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732258AbfKHSxT (ORCPT ); Fri, 8 Nov 2019 13:53:19 -0500 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 0CBD0218AE; Fri, 8 Nov 2019 18:53:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573239199; bh=BklGw2CHk0rhA5E7/1cYkeaiRWPgm4YdmDA/LT6GVH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=q+OVtS0NF4D8rr5dZDM1Zj3FRU2NymJ+eWbce0Y3zKzL9Tt1lsJOzEhDwJW4n0O+4 mSX/o6Flm4gUVgwOtU7zwiXhYYyj0S7Gq++nogGII4s6RAAqjVA2kORt0VTIbS6Qtk RgH5eqa7pUZgrY1JGF+dYWc6sN+rRUEiATeJWwjs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Greg Kroah-Hartman , Ard Biesheuvel , Christoffer Dall , Marc Zyngier , Catalin Marinas , Greg Hackmann , Ard Biesheuvel , Mark Rutland Subject: [PATCH 4.4 32/75] arm64: KVM: Report SMCCC_ARCH_WORKAROUND_1 BP hardening support Date: Fri, 8 Nov 2019 19:49:49 +0100 Message-Id: <20191108174741.407382517@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191108174708.135680837@linuxfoundation.org> References: <20191108174708.135680837@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Marc Zyngier commit 6167ec5c9145cdf493722dfd80a5d48bafc4a18a upstream. A new feature of SMCCC 1.1 is that it offers firmware-based CPU workarounds. In particular, SMCCC_ARCH_WORKAROUND_1 provides BP hardening for CVE-2017-5715. If the host has some mitigation for this issue, report that we deal with it using SMCCC_ARCH_WORKAROUND_1, as we apply the host workaround on every guest exit. Tested-by: Ard Biesheuvel Reviewed-by: Christoffer Dall Signed-off-by: Marc Zyngier Signed-off-by: Catalin Marinas [v4.9: account for files moved to virt/ upstream] Signed-off-by: Mark Rutland [v4.9 backport] Tested-by: Greg Hackmann Signed-off-by: Greg Kroah-Hartman [ardb: restrict to include/linux/arm-smccc.h] Signed-off-by: Ard Biesheuvel Signed-off-by: Greg Kroah-Hartman --- include/linux/arm-smccc.h | 5 +++++ 1 file changed, 5 insertions(+) --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -70,6 +70,11 @@ ARM_SMCCC_SMC_32, \ 0, 1) +#define ARM_SMCCC_ARCH_WORKAROUND_1 \ + ARM_SMCCC_CALL_VAL(ARM_SMCCC_FAST_CALL, \ + ARM_SMCCC_SMC_32, \ + 0, 0x8000) + #ifndef __ASSEMBLY__ #include