exec-all.h: Don't use stl_p for patching x86 jumps
PATCH 1/1 exec-all.h: Don't use stl_p for patching x86 jumps
Partial revert of 86360ad71df0070283469b8ae59f33cdd013501d, because get the "wrong" version of stl_p, the one that does byte swapping appropriate for the target.
--- include/exec/exec-all.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/exec/exec-all.h +2 -1
@@ -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__)
Signature · 1 line
1.9.0
Quoted 3 lines · Richard Henderson
Partial revert of
86360ad71df0070283469b8ae59f33cdd013501d, because get the "wrong" version ofstl_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.
thanks
-- PMM
Quoted 8 lines · Peter Maydell
Quoted 3 lines · Richard Henderson
Partial revert of
86360ad71df0070283469b8ae59f33cdd013501d, because get the "wrong" version ofstl_p, the one that does byte swapping appropriate for the target.Whoops. We could alternatively commit the patch renaming the
bswap.hfunctions to use _he_ infixes and then usestl_he_p()here, yes?
Yes.
Quoted 1 line
Probably best to commit this as an immediate fix though.
That's what I was thinking.
r~
Il 13/05/2014 18:10, Peter Maydell ha scritto:
Quoted 8 lines · Richard Henderson
Quoted 3 lines
Partial revert of
86360ad71df0070283469b8ae59f33cdd013501d, because get the "wrong" version ofstl_p, the one that does byte swapping appropriate for the target.Whoops. We could alternatively commit the patch renaming the
bswap.hfunctions to use _he_ infixes and then usestl_he_p()here, yes?
Or use stl_le_p (a bit more readable that _he_).
Paolo
Quoted 1 line · Paolo Bonzini
Or use
stl_le_p(a bit more readable that _he_).
Fair enough. Will re-send.
r~