qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] exec-all.h: Don't use stl_p for patching x86 jumps
@ 2014-05-13 16:05 Richard Henderson
  2014-05-13 16:10 ` Peter Maydell
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2014-05-13 16:05 UTC (permalink / raw)
  To: qemu-devel; +Cc: Peter Maydell

Partial revert of 86360ad71df0070283469b8ae59f33cdd013501d,
because get the "wrong" version of stl_p, the one that does
byte swapping appropriate for the target.

Cc: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <rth@twiddle.net>
---
 include/exec/exec-all.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 0766e24..2c0c2d5 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -229,7 +229,8 @@ void ppc_tb_set_jmp_target(unsigned long jmp_addr, unsigned long addr);
 static inline void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr)
 {
     /* patch the branch destination */
-    stl_p((void*)jmp_addr, addr - (jmp_addr + 4));
+    int32_t disp = addr - (jmp_addr + 4);
+    memcpy((void*)jmp_addr, &disp, 4);
     /* no need to flush icache explicitly */
 }
 #elif defined(__aarch64__)
-- 
1.9.0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] exec-all.h: Don't use stl_p for patching x86 jumps
  2014-05-13 16:05 [Qemu-devel] [PATCH] exec-all.h: Don't use stl_p for patching x86 jumps Richard Henderson
@ 2014-05-13 16:10 ` Peter Maydell
  2014-05-13 16:19   ` Richard Henderson
  2014-05-13 16:55   ` Paolo Bonzini
  0 siblings, 2 replies; 5+ messages in thread
From: Peter Maydell @ 2014-05-13 16:10 UTC (permalink / raw)
  To: Richard Henderson; +Cc: QEMU Developers

On 13 May 2014 17:05, Richard Henderson <rth@twiddle.net> wrote:
> Partial revert of 86360ad71df0070283469b8ae59f33cdd013501d,
> because get the "wrong" version of stl_p, the one that does
> byte swapping appropriate for the target.

Whoops. We could alternatively commit the patch renaming
the bswap.h functions to use _he_ infixes and then use
stl_he_p() here, yes?

Probably best to commit this as an immediate fix though.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] exec-all.h: Don't use stl_p for patching x86 jumps
  2014-05-13 16:10 ` Peter Maydell
@ 2014-05-13 16:19   ` Richard Henderson
  2014-05-13 16:55   ` Paolo Bonzini
  1 sibling, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2014-05-13 16:19 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU Developers

On 05/13/2014 09:10 AM, Peter Maydell wrote:
> On 13 May 2014 17:05, Richard Henderson <rth@twiddle.net> wrote:
>> Partial revert of 86360ad71df0070283469b8ae59f33cdd013501d,
>> because get the "wrong" version of stl_p, the one that does
>> byte swapping appropriate for the target.
> 
> Whoops. We could alternatively commit the patch renaming
> the bswap.h functions to use _he_ infixes and then use
> stl_he_p() here, yes?

Yes.

> Probably best to commit this as an immediate fix though.

That's what I was thinking.


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] exec-all.h: Don't use stl_p for patching x86 jumps
  2014-05-13 16:10 ` Peter Maydell
  2014-05-13 16:19   ` Richard Henderson
@ 2014-05-13 16:55   ` Paolo Bonzini
  2014-05-13 16:59     ` Richard Henderson
  1 sibling, 1 reply; 5+ messages in thread
From: Paolo Bonzini @ 2014-05-13 16:55 UTC (permalink / raw)
  To: Peter Maydell, Richard Henderson, qemu-devel

Il 13/05/2014 18:10, Peter Maydell ha scritto:
> On 13 May 2014 17:05, Richard Henderson <rth@twiddle.net> wrote:
>> Partial revert of 86360ad71df0070283469b8ae59f33cdd013501d,
>> because get the "wrong" version of stl_p, the one that does
>> byte swapping appropriate for the target.
>
> Whoops. We could alternatively commit the patch renaming
> the bswap.h functions to use _he_ infixes and then use
> stl_he_p() here, yes?

Or use stl_le_p (a bit more readable that _he_).

Paolo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Qemu-devel] [PATCH] exec-all.h: Don't use stl_p for patching x86 jumps
  2014-05-13 16:55   ` Paolo Bonzini
@ 2014-05-13 16:59     ` Richard Henderson
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2014-05-13 16:59 UTC (permalink / raw)
  To: Paolo Bonzini, Peter Maydell, qemu-devel

On 05/13/2014 09:55 AM, Paolo Bonzini wrote:
> Or use stl_le_p (a bit more readable that _he_).

Fair enough.  Will re-send.


r~

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-05-13 16:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-13 16:05 [Qemu-devel] [PATCH] exec-all.h: Don't use stl_p for patching x86 jumps Richard Henderson
2014-05-13 16:10 ` Peter Maydell
2014-05-13 16:19   ` Richard Henderson
2014-05-13 16:55   ` Paolo Bonzini
2014-05-13 16:59     ` Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).