From patchwork Fri Feb 23 18:57:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129493 Delivered-To: patch@linaro.org Received: by 10.80.172.228 with SMTP id x91csp984863edc; Fri, 23 Feb 2018 11:00:01 -0800 (PST) X-Google-Smtp-Source: AG47ELuIU0d3FoDf6AFznDgKVIFX3LGhyKKCLNu1kUAef7IlVO6s10kD0aQBgYXrPwbJTPxEffSy X-Received: by 10.36.213.212 with SMTP id a203mr3415547itg.86.1519412401673; Fri, 23 Feb 2018 11:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519412401; cv=none; d=google.com; s=arc-20160816; b=cLx0hcz8uEOOq0S/1SK2epOqTkvAWCB2Fo5AgoafkinN1oC1qlYzWktgy46t83hfxq TdwiGZzvWyUJfFDOTtLeOHpMVL/Yfq/Xgt+aRYlqQu8TxOneyXmdHDb7OyMvmjFoS+3c hJDMv8jAYxV2e0Q/2zaNvaZsqjq3qjtd50Gpmzx4nKMyCGsFFADxnO7pI5qjThfOUSpW Cx2pOOiujsKv6QfpthIkd+cOqugysgCiT4O8inHv6dPHRl67hg03GJnW27BZOavrJsIQ 14tFztZiL1XvSIEXwz3oHd9zY2IdBYTcRta50GtXU5aSzNeyJHn65QE1FwQaChRb/u6W RXAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:cc:message-id:date:to:from :arc-authentication-results; bh=6dxfhbljD//LU5zu6FYRchrBPviqAkZn2IE4zT+lbLk=; b=OuRwr7vsdfnm9nXgiZfppkhXA0KRWaq7WiKgYEUatq0hnsOXaclDMG4X15cv7saQ95 4n0jzYCwZS+UZT5hBcIg39cz0J6gkNXpbiMOwJs0ki659yJVnP/a8VF8PTd+37kyZ24c lWMrxCVMy1JXoCc6BejNG0T2vZXjWiwMv7kwpjrLkyFYNy5YdfGWXrzOKf/vK+sxKWRZ wVzu50SZz6C3aZazpAjHUgI6ouaQg8D+OK0ZGClriDYS6R1lpKUIlflHkJOcIEN2OlOy XTZrFSvJdJCtDYUzX+b0LVwN9xuW1V/wL+jmrtHuKVlmmQ62iuX1yDpFHfoWHhdDAe+z x/KQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id w5si1555014ith.111.2018.02.23.11.00.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 11:00:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epIXL-0002oe-37; Fri, 23 Feb 2018 18:57:39 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1epIXJ-0002oS-IF for xen-devel@lists.xen.org; Fri, 23 Feb 2018 18:57:37 +0000 X-Inumbo-ID: 4b9df0a8-18cb-11e8-ba59-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 4b9df0a8-18cb-11e8-ba59-bc764e045a96; Fri, 23 Feb 2018 19:56:46 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 40ECA80D; Fri, 23 Feb 2018 10:57:36 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.206.53]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 318923F25C; Fri, 23 Feb 2018 10:57:35 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 23 Feb 2018 18:57:11 +0000 Message-Id: <20180223185729.8780-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Cc: Julien Grall , sstabellini@kernel.org, volodymyr_babchuk@epam.com, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH v5 00/18] xen/arm: PSCI 1.1 and SMCCC-1.1 support and XSA-254 variant 2 update X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi all, Arm has recently published a SMC Calling Convention (SMCCC) specification update [1] that provides an optimised calling convention and optional, discoverable support for mitigating CVE-2017-5715 (XSA-254 variant 2). ARM Trusted Firmware (ATF) has already gained such an implementation[2]. This series addresses a few things: - It provides a Xen implementation of PSCI v1.0, which is a prerequisite for being able to discover SMCCC v1.1. - It allows Xen to advertise SMCCC v1.1 - It implements guest support for the ARM_WORKAROUND_1 function that is used to mitigate CVE-2017-5715 (if such mitigation is available on the hypervisor). - It adds Xen support for branch predictor hardening via ARM_WORKAROUND_1 if the firmware supports it. This method is intended to fully replace the initial PSCI_GET_VERSION approach. Although PSCI_GET_VERSION still works, it has an obvious overhead and is called on some of the hottest paths. We expect ARCH_WORKAROUND_1 to be much faster. Cheers, [1] https://developer.arm.com/support/security-update/downloads [2] https://github.com/ARM-software/arm-trusted-firmware/pull/1240 [3] https://lists.xen.org/archives/html/xen-devel/2018-02/msg00447.html Julien Grall (18): xen/arm: psci: Rework the PSCI definitions xen/arm: vpsci: Add support for PSCI 1.1 xen/arm: vsmc: Implement SMCCC 1.1 xen/arm: vsmc: Implement SMCCC_ARCH_WORKAROUND_1 BP hardening support xen/arm: Adapt smccc.h to be able to use it in assembly code xen/arm64: Implement a fast path for handling SMCCC_ARCH_WORKAROUND_1 xen/arm64: Print a per-CPU message with the BP hardening method used xen/arm: smccc: Add macros SMCCC_VERSION, SMCCC_VERSION_{MINOR, MAJOR} xen/arm: psci: Detect SMCCC version xen/arm: smccc: Implement SMCCC v1.1 inline primitive xen/arm64: Add ARM_SMCCC_ARCH_WORKAROUND_1 BP hardening support xen/arm64: Kill PSCI_GET_VERSION as a variant-2 workaround xen/arm: vpsci: Remove parameter 'ver' from do_common_cpu xen/arm: psci: Consolidate PSCI version print xen/arm: psci: Prefix with static any functions not exported xen/arm: vpsci: Update the return type for MIGRATE_INFO_TYPE xen/arm: vpsci: Introduce and use PSCI_INVALID_ADDRESS xen/arm: vpsci: Rework the logic to start AArch32 vCPU in Thumb mode tools/libxl/libxl_arm.c | 3 +- xen/arch/arm/arm64/bpi.S | 34 +++----- xen/arch/arm/arm64/entry.S | 59 ++++++++++++- xen/arch/arm/cpuerrata.c | 55 +++++++++---- xen/arch/arm/domain_build.c | 1 + xen/arch/arm/platforms/seattle.c | 4 +- xen/arch/arm/psci.c | 58 +++++++++---- xen/arch/arm/vpsci.c | 111 ++++++++++++++++++------- xen/arch/arm/vsmc.c | 41 +++++++++ xen/include/asm-arm/perfc_defn.h | 1 + xen/include/asm-arm/processor.h | 2 + xen/include/asm-arm/psci.h | 39 +++++---- xen/include/asm-arm/smccc.h | 174 +++++++++++++++++++++++++++++++++++++-- xen/include/asm-arm/vpsci.h | 2 +- 14 files changed, 471 insertions(+), 113 deletions(-)