From patchwork Mon Jan 28 11:50:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 156715 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3333256jaa; Mon, 28 Jan 2019 03:52:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN7EAXNkfFuKiFirW3g0EwlSEKGvvnMospCno1jWtBRD/kgPvesieSKufdotArflRHO/yP8/ X-Received: by 2002:a81:6e43:: with SMTP id j64mr20790962ywc.171.1548676347074; Mon, 28 Jan 2019 03:52:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548676347; cv=none; d=google.com; s=arc-20160816; b=wOegvHln6PAdldzRvL5NquporHtvyg4QtBorYMHppLGfh1Ov4j3hLL/aRccAy4+7/b PbMnLEmOQ1eKWKowmLA80i5YpGdkTALZZI8rsHcp8KPdNiDZWVFzvo/nhrf3RqEepTHm 98vjk4LzrVfmZemY69fxef7KMtaecydKR4p+wnCukgSLvd1lD0unMwmgnyVAzN39Y1SE ASLDV6Y+iaVocTzOAIAZBmzVt2mWomFdP/27b7MAy3RTUDv7NfYzOFLRIMH3iw/zAT7Z TOagsppN+AFngjDbHKGfsJQr1FXvYooxrktn6raDVshwSL0NsLxvVl3zkN9Op9XcAYcU +25Q== 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:cc :list-subscribe:list-help:list-post:list-unsubscribe:list-id :precedence:subject:references:in-reply-to:message-id:date:to:from; bh=KFRAL5qS8kNnsYO/ZVRTeHQF+qPF5nXDN8AjZFVWLNs=; b=lOOm1qO4wZvmCjQhdD0AYFVdM8RvZYyQo9jR+THkFcGojZHvHXjhnB2DesIsjhQm6z akQR4MsaEJ5+4i43aJcnAUn4emst84EthF9/ZGZFzb+rmkauzx3hTy1DDZzfh6neFoE2 ItNHjgfC9Z0PA24ve6KlaZQ5gzTyzt4rllVnq4xmrChtA3n9Ame5by5UgGVIOhYAlo17 GoAM3MUoVr17Ft4JHUsmEiSgQPq03vkRbdC5TFcjElfYC5os5iZnX+F9pcOooljiT/zA fwBNKCBSjPVVbFcBYkPrRJMDN9NLcYiJmLuC/SaTNHuECrQM+vZXKyYnUI7cg32UjEsa YU4w== 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 63si10638830ybi.465.2019.01.28.03.52.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 28 Jan 2019 03:52: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.89) (envelope-from ) id 1go5R4-00038B-Sl; Mon, 28 Jan 2019 11:50:42 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1go5R3-00037B-C4 for xen-devel@lists.xenproject.org; Mon, 28 Jan 2019 11:50:41 +0000 X-Inumbo-ID: ef5b594a-22f2-11e9-aeee-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id ef5b594a-22f2-11e9-aeee-bc764e045a96; Mon, 28 Jan 2019 11:50:40 +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 45B4B15AD; Mon, 28 Jan 2019 03:50:40 -0800 (PST) Received: from e108454-lin.cambridge.arm.com (e108454-lin.cambridge.arm.com [10.1.196.50]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7CF203F59C; Mon, 28 Jan 2019 03:50:39 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 28 Jan 2019 11:50:26 +0000 Message-Id: <20190128115026.3336-8-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20190128115026.3336-1-julien.grall@arm.com> References: <20190128115026.3336-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.12 v2 7/7] DO NOT APPLY Allow testing the new AT speculate workaround code X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Julien Grall , sstabellini@kernel.org MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Signed-off-by: Julien Grall --- xen/arch/arm/cpuerrata.c | 10 ++++++++++ xen/arch/arm/p2m.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/xen/arch/arm/cpuerrata.c b/xen/arch/arm/cpuerrata.c index 4431b244fd..727c67451d 100644 --- a/xen/arch/arm/cpuerrata.c +++ b/xen/arch/arm/cpuerrata.c @@ -381,6 +381,11 @@ static bool has_ssbd_mitigation(const struct arm_cpu_capabilities *entry) } #endif +static bool has_at_speculate(const struct arm_cpu_capabilities *entry) +{ + return true; +} + #define MIDR_RANGE(model, min, max) \ .matches = is_affected_midr_range, \ .midr_model = model, \ @@ -495,6 +500,11 @@ static const struct arm_cpu_capabilities arm_errata[] = { .capability = ARM64_WORKAROUND_AT_SPECULATE, MIDR_RANGE(MIDR_CORTEX_A76, 0, 2 << MIDR_VARIANT_SHIFT), }, + { + .desc = "AT speculate", + .capability = ARM64_WORKAROUND_AT_SPECULATE, + .matches = has_at_speculate, + }, {}, }; diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index c38bd7e16e..2b25706823 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -124,6 +124,8 @@ void p2m_restore_state(struct vcpu *n) if ( is_idle_vcpu(n) ) return; + ASSERT(READ_SYSREG64(VTTBR_EL2) == (generate_vttbr(INVALID_VMID, empty_root_mfn))); + WRITE_SYSREG(n->arch.sctlr, SCTLR_EL1); WRITE_SYSREG(n->arch.hcr_el2, HCR_EL2);