From 147269ed81d7d27cb1746cb62e8325066ff7a7cd Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sun, 3 Feb 2019 17:34:13 -0500 Subject: [PATCH] target/arm/translate-a64: Don't underdecode system instructions The "system instructions" and "system register move" subcategories of "branches, exception generating and system instructions" for A64 only apply if bits [23:22] are zero; other values are currently unallocated. Correctly UNDEF these unallocated encodings. Backports commit 08d5e3bde6b4ad32996bf69d93aa66ae43d3f3ff from qemu --- qemu/target/arm/translate-a64.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qemu/target/arm/translate-a64.c b/qemu/target/arm/translate-a64.c index 47ba5d49..52b35173 100644 --- a/qemu/target/arm/translate-a64.c +++ b/qemu/target/arm/translate-a64.c @@ -2221,7 +2221,11 @@ static void disas_b_exc_sys(DisasContext *s, uint32_t insn) break; case 0x6a: /* Exception generation / System */ if (insn & (1 << 24)) { - disas_system(s, insn); + if (extract32(insn, 22, 2) == 0) { + disas_system(s, insn); + } else { + unallocated_encoding(s); + } } else { disas_exc(s, insn); }