@@ -36,6 +36,7 @@
#include <asm/cpregs.h>
#include <asm/psci.h>
+#include "decode.h"
#include "io.h"
#include "vtimer.h"
#include <asm/gic.h>
@@ -1336,6 +1337,20 @@ static void do_trap_data_abort_guest(struct cpu_user_regs *regs,
if ( !dabt.valid )
goto bad_data_abort;
+ /*
+ * Erratum 766422: Thumb store translation fault to Hypervisor may
+ * not have correct HSR Rt value.
+ */
+ if ( cpu_has_erratum_766422() && (regs->cpsr & PSR_THUMB) && dabt.write )
+ {
+ rc = decode_instruction(regs, &info.dabt);
+ if ( rc )
+ {
+ gdprintk(XENLOG_ERR, "Unable to decode instruction\n");
+ goto bad_data_abort;
+ }
+ }
+
if (handle_mmio(&info))
{
advance_pc(regs, hsr);
@@ -111,6 +111,10 @@ struct cpu_user_regs
#define READ_SYSREG(R...) READ_SYSREG32(R)
#define WRITE_SYSREG(V, R...) WRITE_SYSREG32(V, R)
+/* Erratum 766422: only Cortex A15 r0p4 is affected */
+#define cpu_has_erratum_766422() \
+ (unlikely(current_cpu_data.midr.bits == 0x410fc0f4))
+
#endif /* __ASSEMBLY__ */
#endif /* __ASM_ARM_ARM32_PROCESSOR_H */
@@ -104,6 +104,8 @@ struct cpu_user_regs
#define READ_SYSREG(name) READ_SYSREG64(name)
#define WRITE_SYSREG(v, name) WRITE_SYSREG64(v, name)
+#define cpu_has_erratum_766422() 0
+
#endif /* __ASSEMBLY__ */
#endif /* __ASM_ARM_ARM64_PROCESSOR_H */