tcg/ppc: Do not overwrite lower address word on Darwin and AIX
RFC 1/1 tcg/ppc: Do not overwrite lower address word on Darwin and AIX
For targets where TARGET_LONG_BITS != 32, i.e. 64-bit guests, addr_reg is moved to r4. For hosts with TCG_TARGET_CALL_ALIGN_ARGS either data_reg2 or data_reg or a masked version thereof would overwrite r4. Place it in r5 instead, matching TCG_TARGET_CALL_ALIGN_ARGS hosts.
This might explain crashes observed on Darwin/ppc but not on ppc64.
--- tcg/ppc/tcg-target.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)
tcg/ppc/tcg-target.c +0 -4
@@ -816,11 +816,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)#else tcg_out_mov (s,TCG_TYPE_I32 ,3 , addr_reg2);tcg_out_mov (s,TCG_TYPE_I32 ,4 , addr_reg); -#ifdef TCG_TARGET_CALL_ALIGN_ARGS ir =5 ; -#else - ir =4 ; -#endif #endif switch (opc) {
Signature · 1 line
1.7.7
Quoted 19 lines · Andreas F?rber
For targets where
TARGET_LONG_BITS!= 32, i.e. 64-bit guests,addr_regis moved to r4. For hosts withTCG_TARGET_CALL_ALIGN_ARGSeitherdata_reg2ordata_regor a masked version thereof would overwrite r4. Place it in r5 instead, matchingTCG_TARGET_CALL_ALIGN_ARGShosts.This might explain crashes observed on Darwin/ppc but not on ppc64.
Signed-off-by Andreas F?rber <[email protected]>--- tcg/ppc/tcg-target.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)tcg/ppc/tcg-target.c +0
-0@@ -816,11 +816,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)#else
tcg/ppc/tcg-target.c static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc) · line 822
Quoted 10 lines
tcg/ppc/tcg-target.c +0
-4tcg_out_mov (s,TCG_TYPE_I32 ,3 , addr_reg2);tcg_out_mov (s,TCG_TYPE_I32 ,4 , addr_reg); -#ifdef TCG_TARGET_CALL_ALIGN_ARGS ir =5 ; -#else - ir =4 ; -#endif #endif switch (opc) {
Right you are.
Signature · 1 line
mailto:[email protected]
Am 06.05.2012 21:38, schrieb Andreas Färber:
Quoted 2 lines
For targets where
TARGET_LONG_BITS!= 32, i.e. 64-bit guests,addr_regis moved to r4. For hosts withTCG_TARGET_CALL_ALIGN_ARGS
Er, obviously I meant "without". :)
/-F
Quoted 26 lines
either
data_reg2ordata_regor a masked version thereof would overwrite r4. Place it in r5 instead, matchingTCG_TARGET_CALL_ALIGN_ARGShosts.This might explain crashes observed on Darwin/ppc but not on ppc64.
Signed-off-by Andreas Färber <[email protected]>--- tcg/ppc/tcg-target.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)tcg/ppc/tcg-target.c +0
-4@@ -816,11 +816,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)#else tcg_out_mov (s,TCG_TYPE_I32 ,3 , addr_reg2);tcg_out_mov (s,TCG_TYPE_I32 ,4 , addr_reg); -#ifdef TCG_TARGET_CALL_ALIGN_ARGS ir =5 ; -#else - ir =4 ; -#endif #endif switch (opc) {
Am 06.05.2012 22:01, schrieb malc:
Quoted 29 lines · Andreas F?rber
Quoted 28 lines
For targets where
TARGET_LONG_BITS!= 32, i.e. 64-bit guests,addr_regis moved to r4. For hosts [without]TCG_TARGET_CALL_ALIGN_ARGSeitherdata_reg2ordata_regor a masked version thereof would overwrite r4. Place it in r5 instead, matchingTCG_TARGET_CALL_ALIGN_ARGShosts.This might explain crashes observed on Darwin/ppc but not on ppc64.
Signed-off-by Andreas F?rber <[email protected]>--- tcg/ppc/tcg-target.c | 4 ---- 1 files changed, 0 insertions(+), 4 deletions(-)tcg/ppc/tcg-target.c +0
-4@@ -816,11 +816,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)#else tcg_out_mov (s,TCG_TYPE_I32 ,3 , addr_reg2);tcg_out_mov (s,TCG_TYPE_I32 ,4 , addr_reg); -#ifdef TCG_TARGET_CALL_ALIGN_ARGS ir =5 ; -#else - ir =4 ; -#endif #endif
Quoted 4 lines
tcg/ppc/tcg-target.c static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc) · line 822
Quoted 2 lines
tcg/ppc/tcg-target.c +0
-0switch (opc) {Right you are.
Confirmed with qemu-system-x86_64 on Darwin/ppc - hangs without, works with patch. Thanks for making me aware of that line of code. :)
I'll have a suggestion how to simplify your updated patch and will resubmit fixed as [PATCH] series after testing. Hoping you can get a non-Umlaut-broken version from Patchwork. ;)
Cheers,
Andreas