qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long
@ 2014-06-27  4:26 Richard Henderson
  2014-06-27  5:49 ` Cedric Le Goater
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Richard Henderson @ 2014-06-27  4:26 UTC (permalink / raw)
  To: qemu-devel; +Cc: tommusta, clg, gkurz

With rt != r0 on loads, we use rt for scratch.  If we need an index
register different from base, we can't use rt, but r0 is usable.

Signed-off-by: Richard Henderson <rth@twiddle.net>
---
This ought to fix the problem that Greg reported.

That we need to use --enable-debug-tcg to see the assert, and that I
didn't previously do testing with that is disappointing.  I'm thinking
that we ought to do something like gcc wrt --enable-checking=release
vs development, so that we can't do normal development withing these
asserts enabled.  More on that later...


r~
---
 tcg/ppc/tcg-target.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
index c83fd9f..dd84e76 100644
--- a/tcg/ppc/tcg-target.c
+++ b/tcg/ppc/tcg-target.c
@@ -805,7 +805,10 @@ static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt,
 
     /* For unaligned, or very large offsets, use the indexed form.  */
     if (offset & align || offset != (int32_t)offset) {
-        tcg_debug_assert(rs != base && (!is_store || rs != rt));
+        if (rs == base) {
+            rs = TCG_REG_R0;
+        }
+        tcg_debug_assert(!is_store || rs != rt);
         tcg_out_movi(s, TCG_TYPE_PTR, rs, orig);
         tcg_out32(s, opx | TAB(rt, base, rs));
         return;
-- 
1.9.3

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

* Re: [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long
  2014-06-27  4:26 [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long Richard Henderson
@ 2014-06-27  5:49 ` Cedric Le Goater
  2014-06-27  8:33 ` Greg Kurz
  2014-06-27 12:45 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Cedric Le Goater @ 2014-06-27  5:49 UTC (permalink / raw)
  To: Richard Henderson, qemu-devel; +Cc: tommusta, gkurz

On 06/27/2014 06:26 AM, Richard Henderson wrote:
> With rt != r0 on loads, we use rt for scratch.  If we need an index
> register different from base, we can't use rt, but r0 is usable.

That fixes the problem : a x86_64 fedora 20 TCG guest now runs under a 
the latest qemu, (trusty ppc64le host)

Thanks, 

C.


Tested-by: Cédric Le Goater <clg@fr.ibm.com>


> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> This ought to fix the problem that Greg reported.
> 
> That we need to use --enable-debug-tcg to see the assert, and that I
> didn't previously do testing with that is disappointing.  I'm thinking
> that we ought to do something like gcc wrt --enable-checking=release
> vs development, so that we can't do normal development withing these
> asserts enabled.  More on that later...
> 
> 
> r~
> ---
>  tcg/ppc/tcg-target.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
> index c83fd9f..dd84e76 100644
> --- a/tcg/ppc/tcg-target.c
> +++ b/tcg/ppc/tcg-target.c
> @@ -805,7 +805,10 @@ static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt,
> 
>      /* For unaligned, or very large offsets, use the indexed form.  */
>      if (offset & align || offset != (int32_t)offset) {
> -        tcg_debug_assert(rs != base && (!is_store || rs != rt));
> +        if (rs == base) {
> +            rs = TCG_REG_R0;
> +        }
> +        tcg_debug_assert(!is_store || rs != rt);
>          tcg_out_movi(s, TCG_TYPE_PTR, rs, orig);
>          tcg_out32(s, opx | TAB(rt, base, rs));
>          return;
> 

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

* Re: [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long
  2014-06-27  4:26 [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long Richard Henderson
  2014-06-27  5:49 ` Cedric Le Goater
@ 2014-06-27  8:33 ` Greg Kurz
  2014-06-27 12:45 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Greg Kurz @ 2014-06-27  8:33 UTC (permalink / raw)
  To: Richard Henderson; +Cc: tommusta, clg, qemu-devel

On Thu, 26 Jun 2014 21:26:00 -0700
Richard Henderson <rth@twiddle.net> wrote:

> With rt != r0 on loads, we use rt for scratch.  If we need an index
> register different from base, we can't use rt, but r0 is usable.
> 
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> This ought to fix the problem that Greg reported.
> 

Thanks Richard !

> That we need to use --enable-debug-tcg to see the assert, and that I
> didn't previously do testing with that is disappointing.  I'm thinking
> that we ought to do something like gcc wrt --enable-checking=release
> vs development, so that we can't do normal development withing these
> asserts enabled.  More on that later...
> 
> 
> r~

Makes sense.

Cheers.

--
Greg

> ---
>  tcg/ppc/tcg-target.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c
> index c83fd9f..dd84e76 100644
> --- a/tcg/ppc/tcg-target.c
> +++ b/tcg/ppc/tcg-target.c
> @@ -805,7 +805,10 @@ static void tcg_out_mem_long(TCGContext *s, int opi, int opx, TCGReg rt,
> 
>      /* For unaligned, or very large offsets, use the indexed form.  */
>      if (offset & align || offset != (int32_t)offset) {
> -        tcg_debug_assert(rs != base && (!is_store || rs != rt));
> +        if (rs == base) {
> +            rs = TCG_REG_R0;
> +        }
> +        tcg_debug_assert(!is_store || rs != rt);
>          tcg_out_movi(s, TCG_TYPE_PTR, rs, orig);
>          tcg_out32(s, opx | TAB(rt, base, rs));
>          return;



-- 
Gregory Kurz                                     kurzgreg@fr.ibm.com
                                                 gkurz@linux.vnet.ibm.com
Software Engineer @ IBM/Meiosys                  http://www.ibm.com
Tel +33 (0)562 165 496

"Anarchy is about taking complete responsibility for yourself."
        Alan Moore.

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

* Re: [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long
  2014-06-27  4:26 [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long Richard Henderson
  2014-06-27  5:49 ` Cedric Le Goater
  2014-06-27  8:33 ` Greg Kurz
@ 2014-06-27 12:45 ` Peter Maydell
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2014-06-27 12:45 UTC (permalink / raw)
  To: Richard Henderson; +Cc: Tom Musta, clg, QEMU Developers, Greg Kurz

On 27 June 2014 05:26, Richard Henderson <rth@twiddle.net> wrote:
> With rt != r0 on loads, we use rt for scratch.  If we need an index
> register different from base, we can't use rt, but r0 is usable.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> This ought to fix the problem that Greg reported.
>
> That we need to use --enable-debug-tcg to see the assert, and that I
> didn't previously do testing with that is disappointing.  I'm thinking
> that we ought to do something like gcc wrt --enable-checking=release
> vs development, so that we can't do normal development withing these
> asserts enabled.  More on that later...
>
>
> r~
> ---
>  tcg/ppc/tcg-target.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)

Thanks; applied to master as a build fix.

-- PMM

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

end of thread, other threads:[~2014-06-27 12:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-27  4:26 [Qemu-devel] [PATCH] tcg/ppc: Fix failure in tcg_out_mem_long Richard Henderson
2014-06-27  5:49 ` Cedric Le Goater
2014-06-27  8:33 ` Greg Kurz
2014-06-27 12:45 ` Peter Maydell

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