From patchwork Wed Nov 28 16:49:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 152316 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp1321692ljp; Wed, 28 Nov 2018 08:52:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/X8DI5tn7URhRzHPSbGixUuI6IXRx07Da6MMAowkKhUvoQW2bf5AA7pkqkhjTs1OTGNY2V4 X-Received: by 2002:a25:be06:: with SMTP id h6-v6mr30027152ybk.324.1543423959777; Wed, 28 Nov 2018 08:52:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543423959; cv=none; d=google.com; s=arc-20160816; b=xcj8lEHn+ilBf/6K3LFWAPBdt+YDmVSN9GDNoOvL2zyD2mqgYZBIDIYJ+egqYDHV5P cu9TDK9z3QHS9OFIDCQ5R8OjxeCuIFgFQiC0Z3P7sgA3dLXacmBxIRFRpBAcAFerJCr7 2gQUqvgsF51ROIU2F2yEE/StWl+3oHZqszGISWMsGkMz6MGBNUlqOFssmBP6RSKs+zRV UA36EYBtSUXVHgpMlGgSBGSoToq4LTYM57ddI6RWKaCQkS6yO/aETawYRm394gNi4XkE XviPm+bLRnW5czYO2EEO1Pa1Tn/au7yrfF2MCIbC5SQM3KlFMyKZ0EP/JSndvb6lSoPH gSCA== 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=b9qzJibyf1810rNWpyM4ScfMwGYFy01zZ/RqnhLlIDA=; b=cLOse+WNhnBDYTHoR1TbjQ+ZO+KPYaBZ/xrJbbx0Ngl4Uojb/i7tpZjW6HyJPtJlZT KAAGqMAeAwnYnllGIqeabLZ8in+a9xT7rQBIiTykTq7NsPr012FlZvGoBTavRS2Sml30 CpNGRF3bqIsSkD+Tf2Hi7dXqkhxpiGEdMExGfmFDGZbBlnnCRNsE6S6r8XLviYG6/qnI hts2ZAFCHxV7BVzdGIEEpznahacFrBOm9HhNRH5Q1jOMhPVRf7ljF7ajPdZN7mUuCLnf Xev1tKOKA5N9SAGaiBAkFXH61Ub8sHjS3HKkJlZj41amcT6is2OZHLOJk5xqNqxhPNd3 wp1A== 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 f128si5005886ywd.83.2018.11.28.08.52.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Nov 2018 08:52:39 -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 1gS32G-0000xg-JU; Wed, 28 Nov 2018 16:50:00 +0000 Received: from us1-rack-dfw2.inumbo.com ([104.130.134.6]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1gS32E-0000vu-IV for xen-devel@lists.xenproject.org; Wed, 28 Nov 2018 16:49:58 +0000 X-Inumbo-ID: a315d03e-f32d-11e8-9a16-bc764e045a96 Received: from foss.arm.com (unknown [217.140.101.70]) by us1-rack-dfw2.inumbo.com (Halon) with ESMTP id a315d03e-f32d-11e8-9a16-bc764e045a96; Wed, 28 Nov 2018 16:49:57 +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 DA8D6382E; Wed, 28 Nov 2018 08:49:56 -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 EDCDF3F575; Wed, 28 Nov 2018 08:49:55 -0800 (PST) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 28 Nov 2018 16:49:39 +0000 Message-Id: <20181128164939.8329-9-julien.grall@arm.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20181128164939.8329-1-julien.grall@arm.com> References: <20181128164939.8329-1-julien.grall@arm.com> Subject: [Xen-devel] [PATCH for-4.12 8/8] 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: andre.przywara@arm.com, 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 61c64b9816..e7278f2899 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 3a92fd0775..403bfbfcb6 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -122,6 +122,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);