[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] target-sparc: fix register corruption in ldstub

From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH] target-sparc: fix register corruption in ldstub if there is no write permission
Date: Fri, 24 Jun 2016 08:58:58 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 06/24/2016 05:34 AM, Artyom Tarasenko wrote:
Signed-off-by: Artyom Tarasenko <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 5111cf0..065326c 100644
--- a/target-sparc/translate.c
+++ b/target-sparc/translate.c
@@ -5187,12 +5187,15 @@ printf("ops, illegal rdhpr\n");
                 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(tmp);

ldstub_asi has the same problem on mainline.

It looks like I fixed that one on my sparc branch though.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]