From patchwork Mon Feb 5 13:20:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 126869 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp1967501ljc; Mon, 5 Feb 2018 05:22:53 -0800 (PST) X-Google-Smtp-Source: AH8x225+YiYj89CSkufmOpLG1wrNlt+HzVqo/b3INCmBz5G6W021WiPXnlzLgYd9rfdszBtcMukt X-Received: by 10.107.136.68 with SMTP id k65mr56603033iod.145.1517836973489; Mon, 05 Feb 2018 05:22:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517836973; cv=none; d=google.com; s=arc-20160816; b=yBNnfbjuTivxR6xZfXoshXCjTkUDDglqA/vNIbubf1Cxcl+stiJZRPzdIFqjGWAXGh Mg0bv/oUoJ8TUJ9f7HYS0c2qpNtg8vqd3qoqSQXuAasoRn1ymga9AgMiJWOdocQPgInt Bqiv6+J6x23PTETSioMujHNhOMmM+hxfcRT+YrRdbZr44ZJiMPHMhPZG1w+a+oqjgIFT flRqJonMGTsqbzsNa81Yo/2lhpmUaVknNqkXYXuXWPtx9XtWR1pLMVD0Mm5sfOrf2D5F vkjvhRG0D+1V9VudLzzJHwue9M1UD6zXJWrat6LPHTdbSvYvwcDnvYnOpUVDRm0CUluA HrBA== 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=y2T/U5qOzZbyeb56wY2mhN3u/tGewxvddNLxTSrNfLA=; b=P6/w1mSUhuhjIo1EQxGW9Ye9BmmpeO+qsGqrjFqXyhqyc/Zf39c2PQvhRP2UvCroWj iyQVbxQzDeSwdN4BitPYjTjk33jIVRjyD74eUn/HqCV3Qvh4qaMm5SpUEy1rZkzLDc/u T3U/dFW/PomGSqAibLzCLkdX1oxAW+G5401f/X/Bk2KVKSpB2gpMsTT3tpKvpkSHZf1J QB1YdsUO+llQTNkmjIVaZViutujV21h3Myp5kd/eHKr36FjTuhFGyO3zosBFIQXPaigQ Hv3UB5a4IF4vuQTL11MzjnIT1iGzpepJ06YcP4v6jG8tutmUUzgy4iwMOM5IUDZ9SicM oegQ== 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 74si4141302iog.11.2018.02.05.05.22.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Feb 2018 05:22:53 -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 1eigh9-0007Lm-VQ; Mon, 05 Feb 2018 13:20:27 +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 1eigh8-0007Kq-3I for xen-devel@lists.xen.org; Mon, 05 Feb 2018 13:20:26 +0000 X-Inumbo-ID: 6ad8d6d9-0a77-11e8-b9b1-635ca7ef6cff Received: from foss.arm.com (unknown [217.140.101.70]) by us1-amaz-eas1.inumbo.com (Halon) with ESMTP id 6ad8d6d9-0a77-11e8-b9b1-635ca7ef6cff; Mon, 05 Feb 2018 13:21:04 +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 820491529; Mon, 5 Feb 2018 05:20:18 -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 957A93F24D; Mon, 5 Feb 2018 05:20:17 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Mon, 5 Feb 2018 13:20:02 +0000 Message-Id: <20180205132011.27996-1-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 Cc: Julien Grall , sstabellini@kernel.org, andre.przywara@linaro.org Subject: [Xen-devel] [PATCH 0/7] 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 Xen support for the ARM_WORKAROUND_1 function that is used to mitigate CVE-2017-5715 (if such mitigation is available on the hypervisor). 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. Another series will be sent to allow the hypervisor discovering SMCCC 1.1 and use it for the mitigation. This series is based on the "xen/arm: SMCCC fixes and PSCI clean-up" one [3]. Cheers, [1]: https://developer.arm.com/-/media/developer/pdf/ARM%20DEN%200070A%20Firmware%20interfaces%20for%20mitigating%20CVE-2017-5715_V1.0.pdf [2]: https://github.com/ARM-software/arm-trusted-firmware/pull/1240 [3] https://lists.xenproject.org/archives/html/xen-devel/2018-02/msg00117.html Julien Grall (7): xen/arm: vpsci: Remove parameter 'ver' from do_common_cpu 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 tools/libxl/libxl_arm.c | 3 +- xen/arch/arm/arm64/entry.S | 56 +++++++++++++++++++++++++- xen/arch/arm/domain_build.c | 1 + xen/arch/arm/platforms/seattle.c | 4 +- xen/arch/arm/psci.c | 10 ++--- xen/arch/arm/vpsci.c | 85 +++++++++++++++++++++++++++++----------- 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 | 37 ++++++++++++++--- xen/include/asm-arm/vpsci.h | 2 +- 12 files changed, 225 insertions(+), 55 deletions(-)