From patchwork Fri Feb 23 16:47:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 129462 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp813986lja; Fri, 23 Feb 2018 08:50:13 -0800 (PST) X-Google-Smtp-Source: AG47ELu/py6alnP3C9/gAr/y0aQyW8uisq1oyPagajKW9IYcMBOraldbrgvAEJ3bIYhXxLRAQUpu X-Received: by 10.107.47.228 with SMTP id v97mr2385482iov.261.1519404613230; Fri, 23 Feb 2018 08:50:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519404613; cv=none; d=google.com; s=arc-20160816; b=ZVK6QEnXiZ9QsSrioPgmcyzIghMxmWkyUG9K3IN/YoPqaM9obMA65D2HebNJQNCsVb jG3auuuWDgQiTYcvhadwidEJ/78oCiQMIvqEKPGT9zgb2U3mGJTJzFM1DRnUhXYMZKJH GEpKlJRvvBRup4x94ZWp/FMgs4zFgBx6nKG2M9JtFqeAQDCAzlV6dWUsy77TGMB+Or64 k2qqAWMBAQq6SF2n6XfxJermWmZ3o3XWgabkEPHbYDd5NjJg12vvVtcX+6TEZIE3Jr8M atk+izTT3BV0lve+4NEu7NZRJWvrDAadhLENZwXfT+LW1phisCsdH48J3JMvs3swYgY3 nKMA== 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=sfF1QR9PmDZoEQAFHv3Kdv9fyWrVm15isFiqZbQIOBk=; b=IepFOMByaJUpGkEjVF9/X0ADt/tbsV5mDms5GvdyogzkbLb0H4Y4wvy5sJu1fYg9nU TEPQxOYUXlbJc3AKw0UvGAY35JYrtChaiQrVhsJDYbOLcG6pCkmUgH20cAVvR/+IK71C ZWZvykDsBCJS1/JuaKprJvwoa5n1Bz5AoutH9wpYBX52Fj/DavVnYC/NEGFGx5H3RRQk V3c+H4Aidwp6BnxsLvCkfHpDZLRYrLw8z5v+SE3Y2SHo5meRdB1uHG8uHFQd7TGxgozT xFfsyf8hKfp966Ug69SEyjHjcv0HYDMB+rsl2ve5jbW9yM/PjZ8jmgNFLcrAjTg6yTIU 4acw== 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 l135si1455377itb.84.2018.02.23.08.50.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 08:50:13 -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 1epGW0-0003Po-6Z; Fri, 23 Feb 2018 16:48:08 +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 1epGVz-0003Pi-Aa for xen-devel@lists.xen.org; Fri, 23 Feb 2018 16:48:07 +0000 X-Inumbo-ID: 33b5e320-18b9-11e8-ba59-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id 33b5e320-18b9-11e8-ba59-bc764e045a96; Fri, 23 Feb 2018 17:47:15 +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 982811529; Fri, 23 Feb 2018 08:48:04 -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 881723F25C; Fri, 23 Feb 2018 08:48:03 -0800 (PST) From: Julien Grall To: xen-devel@lists.xen.org Date: Fri, 23 Feb 2018 16:47:34 +0000 Message-Id: <20180223164753.27311-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 v4 00/19] 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 (19): 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 fixup! 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(-)