[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: Mark Cave-Ayland
Subject: Re: [Qemu-devel] [PATCH] target-sparc: fix register corruption in ldstub if there is no write permission
Date: Fri, 24 Jun 2016 17:02:23 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0

On 24/06/16 16:58, Richard Henderson wrote:

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,
+                        tcg_gen_qemu_ld8u(tmp, cpu_addr, dc->mem_idx);
                         r_const = tcg_const_tl(0xff);
                         tcg_gen_qemu_st8(r_const, cpu_addr,
+                        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.


In that case would it make sense to prepend this patch to a v4 respin of your latest SPARC patchset (as tested by Artyom)?



reply via email to

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