From patchwork Thu Aug 1 08:15:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 11070257 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DF82186E for ; Thu, 1 Aug 2019 08:20:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40BAD28481 for ; Thu, 1 Aug 2019 08:20:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 344DB284B5; Thu, 1 Aug 2019 08:20:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C2E5128481 for ; Thu, 1 Aug 2019 08:20:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UbGw2Z0SAnNn5mN3/FzeLpCQGz32aKJ/L+1xY+rI7a4=; b=TB65AeZ3C8LNlG foVaS37w2NDT/B4+cgrOg3VXiadKXHZmHYoiY2sH0OJ38IwlZM4r3kAFy3nPOMrxXEOkk774ZUL7F hTk8nSQi9fcY1/9e3t0/2ms/r3ZHV4ZW+37V/JwbdlyTSOPbnsKfLVbWU1kCmgFXgj7jGuCSHeTlf UMU8HN8okXAieTlYUEX+YIXWX/ciGYYsfXwp4Wv38cYESQ6PIGxZB3BsU/U7yUHwezH/EhClZ9oSc GUHOQxM+jdk0QdoMDN8uK3Q47UmwgUcbu3TrrhyK7dEPnFGFJ/AdG4N08ZqIsR6e/3b7e9lGD6GBf sEdMMRbLTn4UYztQ+SzA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1ht6Jw-00026H-Mt; Thu, 01 Aug 2019 08:20:20 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1ht6JM-0000Dg-M5 for linux-arm-kernel@lists.infradead.org; Thu, 01 Aug 2019 08:19:46 +0000 Received: by mail-pf1-x443.google.com with SMTP id g2so33611356pfq.0 for ; Thu, 01 Aug 2019 01:19:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z7GSqiJ6aBNFVvBBcZiH2v3S1Pbs9vo106t8SFNGIe4=; b=cYaRmjxpRpihR3ST0Z43FI6gGebPhfoWhCbpU+IMiA14zAmRrIrwHkLNPGxQbO3dwQ GKIF1ls+9uq+hNUdROGeAa0AknTV9vYQ5TFKVHdwI/2EmvyukmhMRTDGiva55cX2FenL aGDOJ5qzMHxinEWIcGbZyYj1dw2pxHV/LjncanSzzQL3S6e2pW5AVum+1MNUj63YHMgI N3LCp/eNbnqtm6aGhrAr6JZ+sPtBGtd3EyRopNtHb2rYD6dzl/Nm03uWLQROVJdNpWp7 tXl7No6eYiHWr+8KJFDPN8JbC84yPGs9/3Latvd+MfH6CI93+nX4fYz1N+Wls25RH5UP oHBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=z7GSqiJ6aBNFVvBBcZiH2v3S1Pbs9vo106t8SFNGIe4=; b=ui6XKWEFUdYtmmYvaT14N4JTdsNRecXcYtRy45yPJjE3Wm8OZkfgxWa/KKjZ/Rci0B J99eK9WK2N/7mrbwZ5HUlOzjK9ZrK/tzUsDSYORiddf3KAM6vxfn33lGVPewhcsyTfVh mSc3hm689K8vOeX7cGN7BjN2C50z9lLt2ApzsokQXD3ocva2TKyQ+hucmCf8ZBBsXZVx AZ7eqtCt4TftMeITZIqav9Sl5IkgwWNieDo0F+Gpb0ogZfCjq1a+xrxyZUnJ2jNh8CJJ NgaON3W2ghDdD92GiKI2D2xUJeQZCpAF1+fkTE2tH5FrkPqKSv/mkFos72l5P3HR8GUy PxZQ== X-Gm-Message-State: APjAAAXN3lGEiZ88ZuMfeWr+oSHuqFOod37FEcdm9gMEoNVDbyjRMYrQ 2i/WszXsmDGt5c8FopH6wvxbtw== X-Google-Smtp-Source: APXvYqy+r/ZBXTixIjv/M9S1DYk3sEBpMLeC+4UwOYm9t+/UkhM1ETIyQn3yLY+cECisdJqFRi6T/A== X-Received: by 2002:a62:3c3:: with SMTP id 186mr51852915pfd.21.1564647583498; Thu, 01 Aug 2019 01:19:43 -0700 (PDT) Received: from localhost ([122.172.28.117]) by smtp.gmail.com with ESMTPSA id l1sm91579706pfl.9.2019.08.01.01.19.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 01:19:43 -0700 (PDT) From: Viresh Kumar To: stable@vger.kernel.org Subject: [PATCH ARM32 v4.4 V2 03/47] arm64: KVM: Report SMCCC_ARCH_WORKAROUND_1 BP hardening support Date: Thu, 1 Aug 2019 13:45:47 +0530 Message-Id: <62376918dc348842e21f6eb62235220f53d35cdb.1564646727.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.21.0.rc0.269.g1a574e7a288b In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190801_011944_735279_9FF497D1 X-CRM114-Status: GOOD ( 11.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Julien Thierry , Marc Zyngier , Viresh Kumar , guohanjun@huawei.com, Will Deacon , mark.brown@arm.com, Catalin Marinas , Russell King , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 [ Viresh: Picked on only arm-smccc.h changes ] Signed-off-by: Viresh Kumar --- include/linux/arm-smccc.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/arm-smccc.h b/include/linux/arm-smccc.h index da9f3916f9a9..1f02e4045a9e 100644 --- a/include/linux/arm-smccc.h +++ b/include/linux/arm-smccc.h @@ -73,6 +73,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__ /**