[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH] target-sparc: fix register corruption in ldstub if
From: |
Mark Cave-Ayland |
Subject: |
[Qemu-stable] [PATCH] target-sparc: fix register corruption in ldstub if there is no write permission |
Date: |
Fri, 24 Jun 2016 18:22:02 +0100 |
From: Artyom Tarasenko <address@hidden>
Signed-off-by: Artyom Tarasenko <address@hidden>
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Mark Cave-Ayland <address@hidden>
---
target-sparc/translate.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/target-sparc/translate.c b/target-sparc/translate.c
index afd46b8..0f4faf7 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -4679,12 +4679,15 @@ static void disas_sparc_insn(DisasContext * dc,
unsigned int insn)
case 0xd: /* ldstub -- XXX: should be atomically */
{
TCGv r_const;
+ TCGv tmp = tcg_temp_new();
gen_address_mask(dc, cpu_addr);
- tcg_gen_qemu_ld8u(cpu_val, cpu_addr, dc->mem_idx);
+ tcg_gen_qemu_ld8u(tmp, cpu_addr, dc->mem_idx);
r_const = tcg_const_tl(0xff);
tcg_gen_qemu_st8(r_const, cpu_addr, dc->mem_idx);
+ tcg_gen_mov_tl(cpu_val, tmp);
tcg_temp_free(r_const);
+ tcg_temp_free(tmp);
}
break;
case 0x0f:
--
1.7.10.4
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-stable] [PATCH] target-sparc: fix register corruption in ldstub if there is no write permission,
Mark Cave-Ayland <=