diff mbox series

[Xen-devel,for-4.12,8/8] DO NOT APPLY Allow testing the new AT speculate workaround code

Message ID 20181128164939.8329-9-julien.grall@arm.com
State Superseded
Headers show
Series xen/arm: Workaround for Cortex-A76 erratum 1165522 | expand

Commit Message

Julien Grall Nov. 28, 2018, 4:49 p.m. UTC
Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/cpuerrata.c | 10 ++++++++++
 xen/arch/arm/p2m.c       |  2 ++
 2 files changed, 12 insertions(+)

Comments

Andrii Anisov Dec. 21, 2018, 2:44 p.m. UTC | #1
I guess this one should not be here.
Andrew Cooper Dec. 21, 2018, 2:47 p.m. UTC | #2
On 21/12/2018 14:44, Andrii Anisov wrote:
> I guess this one should not be here.

Posting patches like this can be useful for people trying to test the
series.

As such, it is worth posting, but the DO NOT APPLY hint is there for
people to realise that is isn't for inclusion generally.

~Andrew
Andrii Anisov Dec. 21, 2018, 2:55 p.m. UTC | #3
On 21.12.18 16:47, Andrew Cooper wrote:
> On 21/12/2018 14:44, Andrii Anisov wrote:
>> I guess this one should not be here.
> 
> Posting patches like this can be useful for people trying to test the
> series.
> 
> As such, it is worth posting, but the DO NOT APPLY hint is there for
> people to realise that is isn't for inclusion generally.

Thank you for the hint.
diff mbox series

Patch

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);