From 3664e1ab8a9fb25f182e3b819f57f12b10466fcf Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Sat, 17 Feb 2018 19:23:12 -0500 Subject: [PATCH] sparc: allow CASA with ASI 0xa from user space LEON3 allows the CASA instruction to be used from user space if the ASI is set to 0xa (user data). Backports commit bd4e097a8e30bb63ed7f46553b13f60809c30ac3 from qemu --- qemu/target-sparc/translate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/qemu/target-sparc/translate.c b/qemu/target-sparc/translate.c index a5b39c70..c43bd661 100644 --- a/qemu/target-sparc/translate.c +++ b/qemu/target-sparc/translate.c @@ -5248,7 +5248,8 @@ static void disas_sparc_insn(DisasContext * dc, unsigned int insn, bool hook_ins if (IS_IMM) { goto illegal_insn; } - if (!supervisor(dc)) { + /* LEON3 allows CASA from user space with ASI 0xa */ + if ((GET_FIELD(insn, 19, 26) != 0xa) && !supervisor(dc)) { goto priv_insn; } #endif