qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [RFC] tcg/ppc: Do not overwrite lower address word on Darwin and AIX
@ 2012-05-06 19:38 Andreas Färber
  2012-05-06 20:01 ` malc
  2012-05-06 20:03 ` Andreas Färber
  0 siblings, 2 replies; 4+ messages in thread
From: Andreas Färber @ 2012-05-06 19:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Andreas Färber, qemu-ppc

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.

Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 tcg/ppc/tcg-target.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
index dc40716..4b85c89 100644
--- a/tcg/ppc/tcg-target.c
+++ b/tcg/ppc/tcg-target.c
@@ -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) {
-- 
1.7.7

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

* Re: [Qemu-devel] [RFC] tcg/ppc: Do not overwrite lower address word on Darwin and AIX
  2012-05-06 19:38 [Qemu-devel] [RFC] tcg/ppc: Do not overwrite lower address word on Darwin and AIX Andreas Färber
@ 2012-05-06 20:01 ` malc
  2012-05-06 20:33   ` Andreas Färber
  2012-05-06 20:03 ` Andreas Färber
  1 sibling, 1 reply; 4+ messages in thread
From: malc @ 2012-05-06 20:01 UTC (permalink / raw)
  To: Andreas Färber; +Cc: qemu-ppc, qemu-devel

On Sun, 6 May 2012, Andreas F?rber wrote:

> 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.
> 
> Signed-off-by: Andreas F?rber <andreas.faerber@web.de>
> ---
>  tcg/ppc/tcg-target.c |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
> index dc40716..4b85c89 100644
> --- a/tcg/ppc/tcg-target.c
> +++ b/tcg/ppc/tcg-target.c
> @@ -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) {
> 

Right you are.

-- 
mailto:av1474@comtv.ru

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

* Re: [Qemu-devel] [RFC] tcg/ppc: Do not overwrite lower address word on Darwin and AIX
  2012-05-06 19:38 [Qemu-devel] [RFC] tcg/ppc: Do not overwrite lower address word on Darwin and AIX Andreas Färber
  2012-05-06 20:01 ` malc
@ 2012-05-06 20:03 ` Andreas Färber
  1 sibling, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2012-05-06 20:03 UTC (permalink / raw)
  To: malc; +Cc: qemu-ppc, qemu-devel

Am 06.05.2012 21:38, schrieb Andreas Färber:
> 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

Er, obviously I meant "without". :)

/-F

> 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.
> 
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>
> ---
>  tcg/ppc/tcg-target.c |    4 ----
>  1 files changed, 0 insertions(+), 4 deletions(-)
> 
> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
> index dc40716..4b85c89 100644
> --- a/tcg/ppc/tcg-target.c
> +++ b/tcg/ppc/tcg-target.c
> @@ -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) {

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

* Re: [Qemu-devel] [RFC] tcg/ppc: Do not overwrite lower address word on Darwin and AIX
  2012-05-06 20:01 ` malc
@ 2012-05-06 20:33   ` Andreas Färber
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Färber @ 2012-05-06 20:33 UTC (permalink / raw)
  To: malc; +Cc: qemu-ppc, qemu-devel

Am 06.05.2012 22:01, schrieb malc:
> On Sun, 6 May 2012, Andreas F?rber wrote:
> 
>> For targets where TARGET_LONG_BITS != 32, i.e. 64-bit guests,
>> addr_reg is moved to r4. For hosts [without] 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.
>>
>> Signed-off-by: Andreas F?rber <andreas.faerber@web.de>
>> ---
>>  tcg/ppc/tcg-target.c |    4 ----
>>  1 files changed, 0 insertions(+), 4 deletions(-)
>>
>> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
>> index dc40716..4b85c89 100644
>> --- a/tcg/ppc/tcg-target.c
>> +++ b/tcg/ppc/tcg-target.c
>> @@ -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) {
>>
> 
> 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

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

end of thread, other threads:[~2012-05-06 20:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-06 19:38 [Qemu-devel] [RFC] tcg/ppc: Do not overwrite lower address word on Darwin and AIX Andreas Färber
2012-05-06 20:01 ` malc
2012-05-06 20:33   ` Andreas Färber
2012-05-06 20:03 ` Andreas Färber

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).