From patchwork Thu Feb 8 19:21:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 127732 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1793862ljc; Thu, 8 Feb 2018 11:24:28 -0800 (PST) X-Google-Smtp-Source: AH8x227ioP0+DCWVrkEQn26vxMk7UUvA+1/7Apg3v7nqtk2v4gqd1wbEC6qZA+m0h2mslDY0Xi08 X-Received: by 10.107.138.20 with SMTP id m20mr154335iod.192.1518117867951; Thu, 08 Feb 2018 11:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518117867; cv=none; d=google.com; s=arc-20160816; b=A3sP+ObVPaDqmaG044Rbv/8h6xbt9fpG1FVbCZ4+jTxZ+yDiAGwSInUBO97V5Wpe7o KXyiEb/ER6OEqL5rNBV51r4yltwYtmobgYmfxIOwW/xgrX/ixsGCmRNuKrrlavU5VBnJ RS+iWoheML/AX6Hggx6q2sKVvKdT4ocp1BaXGnDM4lYXVXMoQS0nC/BFnYkqRHxE4xPK mmRuPX8U/+qdh9Hq84t77s2DQIgtxsu2eALDGSr46sNuQRQ57gQiyt64iP1mAgJISGxN gCQlmfL3Ovikw3D8oto+5/LYbdpzPTDF9gNNJFzce6WFKTbclW/3jNMHYp2IHU/4PKbp RZ3w== 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=fBE2jNgI49zY3RiIw3yC/ZoYr/QPPi1TsUpWRANz5VU=; b=Ysbb+ff6kltbjSz97fg9FbAGVWfvs99IHVKGJ2aBXZ5ULiDr9b3gbQbhFpfI4lkvLe YLK5yrgRkfBIO0ni2hfv43VlQ7dTknVgXHDtGodNAJgu9LC3IG4lxRa1ItgEej+BA34f 17FUr9gbg6bizhSfJcPTNe0alDpLfe57O1UExIMvEPKGN0Rb2a7Q2gqvUf9AT5LAtk5V 296Ia43de6fVMagccBoYiXLdvYZtSbzZNpvXdvjJqkmwpbtCfCqrPMOB2OMnNIs3y+f2 q6cqx5HEYbyqWAUXGtKMUbk6CzSX8y/iTFRx2ICx7EQThNcvy7TCIODgvV/Ir6YFA4qO olnQ== 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 s76si465066ioe.191.2018.02.08.11.24.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Feb 2018 11:24:27 -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 1ejrm1-0006FJ-5l; Thu, 08 Feb 2018 19:22:21 +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 1ejrlz-0006BR-QO for xen-devel@lists.xen.org; Thu, 08 Feb 2018 19:22:19 +0000 X-Inumbo-ID: 7e022609-0d05-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 7e022609-0d05-11e8-b9b1-635ca7ef6cff; Thu, 08 Feb 2018 19:23:07 +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 6384280D; Thu, 8 Feb 2018 11:22:11 -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 548A03F24D; Thu, 8 Feb 2018 11:22:10 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Thu, 8 Feb 2018 19:21:48 +0000 Message-Id: <20180208192203.9556-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 v2 00/15] 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. This series is based on the "xen/arm: SMCCC fixes and PSCI clean-up" one [3]. 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 (15): 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 tools/libxl/libxl_arm.c | 3 +- xen/arch/arm/arm64/bpi.S | 35 +++----- xen/arch/arm/arm64/entry.S | 56 ++++++++++++- 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 | 90 +++++++++++++++----- 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 | 38 +++++---- xen/include/asm-arm/smccc.h | 174 +++++++++++++++++++++++++++++++++++++-- xen/include/asm-arm/vpsci.h | 2 +- 14 files changed, 453 insertions(+), 107 deletions(-)