[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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



Signed-off-by: Julien Grall <julien.grall@xxxxxxx>
---
 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);
 
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.