From patchwork Thu Feb 15 15:02:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 128467 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1847043ljc; Thu, 15 Feb 2018 07:05:51 -0800 (PST) X-Google-Smtp-Source: AH8x227/x/pSR5Hk0O5h45s4hx+cWEIfQiYT1gtPWFJ/FD98aJpOkuor5C2DPL2sjO0kSyk6Aa4b X-Received: by 10.36.50.1 with SMTP id j1mr3634055ita.149.1518707151298; Thu, 15 Feb 2018 07:05:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518707151; cv=none; d=google.com; s=arc-20160816; b=yXY0OXsBTUZcKG6d4tWjmoYh2Y6L3Z8uyVbS/SNM4KO5RiJyDdZN7E7sZMUW1evGV+ eHt8fwICBtq2UqGRJACHyHgQDk1D2ieuETh0LNVTXRbfKycX+Le6ABH2X8WP6V8hP4Rk bkSVoCdVifUULE+xGGsY2Dn9D7n+CT7oL6000l7eW9L2bczF4NfQV/Z+BJyKRGppY1UV EQeFgFYvGle3e29ddbc5yPMYhUIpCe2uCJgURDNKMTg21fYFJpG3Yb+Uk8QghTrKOV6R RJP6UgkZ6iJ8tlqei8fYlG0a5KgcFvMmDKE8l47UsWpaNvR8/bpnZjBneJG7e/ANUd0H 52zQ== 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=D1fBR+iasKzum9+YFdyxKcUO0I9U8qPYeGnaR0oLXwA=; b=cZeYKbviAbmh9cS2wQJmi1bkMyMmyGYE3BC0uM7D9VVrMNXPhW/BBnKHErzgO+HIl4 bTwqpt4QdC3bgRb6/13H5+pc0Uw+WI96Y7VX0BiurTPO9scqzEuI1vhrf9LTA8cP1IiK y1r6pv8ZAcrWbdlMq5qqaPO3mGnqaw4vgXjn0b1q+WKEnvOmX/U8h6km4g9PdEq4N/Lw QTDqcuL7ebYqdUIwN+h/br4xqryGc+gopcI1frOy81KRsBBSQot/gmRCwk8kpj1by6Nx jehck76PPoZ75vOtKoJ/qfqZ1FMCLuJwovca90LpQCrv4nKfeVW86Nqd8PsyxpI0j3Jf e7KA== 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 p10si2047977ite.104.2018.02.15.07.05.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Feb 2018 07:05:51 -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 1emL41-0001xJ-51; Thu, 15 Feb 2018 15:03:09 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1emL3z-0001wX-94 for xen-devel@lists.xen.org; Thu, 15 Feb 2018 15:03:07 +0000 X-Inumbo-ID: 7e4fe88d-1261-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 7e4fe88d-1261-11e8-b9b1-635ca7ef6cff; Thu, 15 Feb 2018 15:04:17 +0000 (UTC) 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 39A211435; Thu, 15 Feb 2018 07:02:59 -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 296773F41F; Thu, 15 Feb 2018 07:02:58 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 15 Feb 2018 15:02:31 +0000 Message-Id: <20180215150248.28922-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 v3 00/17] 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 (17): 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 | 56 ++++++++++++- xen/arch/arm/cpuerrata.c | 55 +++++++++---- xen/arch/arm/domain_build.c | 1 + xen/arch/arm/psci.c | 48 +++++++++-- xen/arch/arm/vpsci.c | 89 ++++++++++++++++---- 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 | 2 + xen/include/asm-arm/smccc.h | 174 +++++++++++++++++++++++++++++++++++++-- xen/include/asm-arm/vpsci.h | 2 +- 13 files changed, 429 insertions(+), 79 deletions(-)