@@ -7,6 +7,7 @@ subdir-$(CONFIG_ACPI) += acpi
obj-$(CONFIG_ALTERNATIVE) += alternative.o
obj-y += bootfdt.o
obj-y += cpu.o
+obj-y += cpuerrata.o
obj-y += cpufeature.o
obj-y += decode.o
obj-y += device.o
new file mode 100644
@@ -0,0 +1,34 @@
+#include <xen/config.h>
+#include <asm/cpufeature.h>
+#include <asm/cpuerrata.h>
+
+#define MIDR_RANGE(model, min, max) \
+ .matches = is_affected_midr_range, \
+ .midr_model = model, \
+ .midr_range_min = min, \
+ .midr_range_max = max
+
+static bool_t __maybe_unused
+is_affected_midr_range(const struct arm_cpu_capabilities *entry)
+{
+ return MIDR_IS_CPU_MODEL_RANGE(boot_cpu_data.midr.bits, entry->midr_model,
+ entry->midr_range_min,
+ entry->midr_range_max);
+}
+
+static const struct arm_cpu_capabilities arm_errata[] = {
+ {},
+};
+
+void check_local_cpu_errata(void)
+{
+ update_cpu_capabilities(arm_errata, "enabled workaround for");
+}
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
@@ -43,6 +43,7 @@
#include <asm/current.h>
#include <asm/setup.h>
#include <asm/gic.h>
+#include <asm/cpuerrata.h>
#include <asm/cpufeature.h>
#include <asm/platform.h>
#include <asm/procinfo.h>
@@ -171,6 +172,8 @@ static void __init processor_id(void)
}
processor_setup();
+
+ check_local_cpu_errata();
}
void dt_unreserved_regions(paddr_t s, paddr_t e,
@@ -29,6 +29,7 @@
#include <xen/timer.h>
#include <xen/irq.h>
#include <xen/console.h>
+#include <asm/cpuerrata.h>
#include <asm/gic.h>
#include <asm/psci.h>
#include <asm/acpi.h>
@@ -316,6 +317,8 @@ void start_secondary(unsigned long boot_phys_offset,
local_irq_enable();
local_abort_enable();
+ check_local_cpu_errata();
+
printk(XENLOG_DEBUG "CPU %u booted.\n", smp_processor_id());
startup_cpu_idle_loop();
new file mode 100644
@@ -0,0 +1,14 @@
+#ifndef __ARM_CPUERRATA_H
+#define __ARM_CPUERRATA_H
+
+void check_local_cpu_errata(void);
+
+#endif /* __ARM_CPUERRATA_H */
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
@@ -66,6 +66,12 @@ struct arm_cpu_capabilities {
const char *desc;
u16 capability;
bool_t (*matches)(const struct arm_cpu_capabilities *);
+ union {
+ struct { /* To be used for eratum handling only */
+ u32 midr_model;
+ u32 midr_range_min, midr_range_max;
+ };
+ };
};
void update_cpu_capabilities(const struct arm_cpu_capabilities *caps,