All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] singlestep and sparc32
@ 2010-04-19 14:33 Artyom Tarasenko
  2010-04-19 16:07 ` malc
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Artyom Tarasenko @ 2010-04-19 14:33 UTC (permalink / raw)
  To: qemu-devel, weil, Blue Swirl

is -single-step option supposed to work under qemu-system-sparc? Or is
it only for non-pipelined CPUs?

I get pretty strange results: some addresses seem to be executed
twice, and then qemu hangs on the last nop:

--------------
IN:
0x00000000:  b  0xb788
--------------
IN:
0x00000004:  rd  %psr, %l0
--------------
IN:
0x00000004:  rd  %psr, %l0
--------------
IN:
0x00000008:  nop
--------------
IN:
0x00000008:  nop
--------------
IN:
0x0000000c:  nop
--------------
IN:
0x0000000c:  nop

... skipped ...

IN:
0x7000a58c:  bg  0x7000a588
--------------
IN:
0x7000a590:  nop
--------------
IN:
0x7000a590:  nop
--------------
IN:
0x7000a594:  b  0x7000a570
--------------
IN:
0x7000a594:  b  0x7000a570
--------------
IN:
0x7000a578:  be  0x7000a59c
--------------
IN:
0x7000a580:  stba  %l1, [ %l0 ] #ASI_M_BYPASS
--------------
IN:
0x7000a588:  deccc  %l2
--------------
IN:
0x7000a594:  b  0x7000a570
--------------
IN:
0x7000a590:  nop

^^^^^^^^^^^ That's the end

Without -singlestep it seems to work better:


0x7000a588:  deccc  %l2
0x7000a58c:  bg  0x7000a588
0x7000a590:  nop

--------------
IN:
0x7000a594:  b  0x7000a570
0x7000a598:  inc  %l4

--------------
IN:
0x7000a570:  lduba  [ %l4 ] #ASI_M_KERNELTXT, %l1
0x7000a574:  cmp  %l1, 0xff
0x7000a578:  be  0x7000a59c
... and so on ...


-- 
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/

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

* Re: [Qemu-devel] singlestep and sparc32
  2010-04-19 14:33 [Qemu-devel] singlestep and sparc32 Artyom Tarasenko
@ 2010-04-19 16:07 ` malc
  2010-04-19 16:19 ` [Qemu-devel] " Stefan Weil
  2010-04-19 19:55 ` Blue Swirl
  2 siblings, 0 replies; 5+ messages in thread
From: malc @ 2010-04-19 16:07 UTC (permalink / raw)
  To: Artyom Tarasenko; +Cc: Blue Swirl, qemu-devel

On Mon, 19 Apr 2010, Artyom Tarasenko wrote:

> is -single-step option supposed to work under qemu-system-sparc? Or is
> it only for non-pipelined CPUs?

Eh? Perhaps you meant that it's only for CPUs without delay slots?

> 
> I get pretty strange results: some addresses seem to be executed
> twice, and then qemu hangs on the last nop:
> 
> --------------
> IN:
> 0x00000000:  b  0xb788
> --------------
> IN:
> 0x00000004:  rd  %psr, %l0
> --------------
> IN:
> 0x00000004:  rd  %psr, %l0
> --------------
> IN:
> 0x00000008:  nop
> --------------
> IN:
> 0x00000008:  nop
> --------------
> IN:
> 0x0000000c:  nop
> --------------
> IN:
> 0x0000000c:  nop
> 
> ... skipped ...
> 
> IN:
> 0x7000a58c:  bg  0x7000a588
> --------------
> IN:
> 0x7000a590:  nop
> --------------
> IN:
> 0x7000a590:  nop
> --------------
> IN:
> 0x7000a594:  b  0x7000a570
> --------------
> IN:
> 0x7000a594:  b  0x7000a570
> --------------
> IN:
> 0x7000a578:  be  0x7000a59c
> --------------
> IN:
> 0x7000a580:  stba  %l1, [ %l0 ] #ASI_M_BYPASS
> --------------
> IN:
> 0x7000a588:  deccc  %l2
> --------------
> IN:
> 0x7000a594:  b  0x7000a570
> --------------
> IN:
> 0x7000a590:  nop
> 
> ^^^^^^^^^^^ That's the end
> 
> Without -singlestep it seems to work better:
> 
> 
> 0x7000a588:  deccc  %l2
> 0x7000a58c:  bg  0x7000a588
> 0x7000a590:  nop
> 
> --------------
> IN:
> 0x7000a594:  b  0x7000a570
> 0x7000a598:  inc  %l4
> 
> --------------
> IN:
> 0x7000a570:  lduba  [ %l4 ] #ASI_M_KERNELTXT, %l1
> 0x7000a574:  cmp  %l1, 0xff
> 0x7000a578:  be  0x7000a59c
> ... and so on ...
> 
> 
> 

-- 
mailto:av1474@comtv.ru

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

* [Qemu-devel] Re: singlestep and sparc32
  2010-04-19 14:33 [Qemu-devel] singlestep and sparc32 Artyom Tarasenko
  2010-04-19 16:07 ` malc
@ 2010-04-19 16:19 ` Stefan Weil
  2010-04-19 19:55 ` Blue Swirl
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Weil @ 2010-04-19 16:19 UTC (permalink / raw)
  To: Artyom Tarasenko; +Cc: Blue Swirl, qemu-devel

Artyom Tarasenko schrieb:
> is -single-step option supposed to work under qemu-system-sparc? Or is
> it only for non-pipelined CPUs?
>
> I get pretty strange results: some addresses seem to be executed
> twice, and then qemu hangs on the last nop:
>
> --------------
> IN:
> 0x00000000: b 0xb788
> --------------
> IN:
> 0x00000004: rd %psr, %l0
> --------------
> IN:
> 0x00000004: rd %psr, %l0
> --------------
> IN:
> 0x00000008: nop
> --------------
> IN:
> 0x00000008: nop
> --------------
> IN:
> 0x0000000c: nop
> --------------
> IN:
> 0x0000000c: nop
>
> ... skipped ...
>
> IN:
> 0x7000a58c: bg 0x7000a588
> --------------
> IN:
> 0x7000a590: nop
> --------------
> IN:
> 0x7000a590: nop
> --------------
> IN:
> 0x7000a594: b 0x7000a570
> --------------
> IN:
> 0x7000a594: b 0x7000a570
> --------------
> IN:
> 0x7000a578: be 0x7000a59c
> --------------
> IN:
> 0x7000a580: stba %l1, [ %l0 ] #ASI_M_BYPASS
> --------------
> IN:
> 0x7000a588: deccc %l2
> --------------
> IN:
> 0x7000a594: b 0x7000a570
> --------------
> IN:
> 0x7000a590: nop
>
> ^^^^^^^^^^^ That's the end
>
> Without -singlestep it seems to work better:
>
>
> 0x7000a588: deccc %l2
> 0x7000a58c: bg 0x7000a588
> 0x7000a590: nop
>
> --------------
> IN:
> 0x7000a594: b 0x7000a570
> 0x7000a598: inc %l4
>
> --------------
> IN:
> 0x7000a570: lduba [ %l4 ] #ASI_M_KERNELTXT, %l1
> 0x7000a574: cmp %l1, 0xff
> 0x7000a578: be 0x7000a59c
> ... and so on ...

I use it for x86, mips and powerpc targets.
So pipelined CPUs work at least for some target
architectures, and sparc's singlestep is broken.

Have a look at target-mips/translate.c or
target-ppc/translate.c and compare their handling
of singlestep to the handling in target-sparc/translate.c.
The sparc variant is very simple - too simple, I assume.

Stefan

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

* [Qemu-devel] Re: singlestep and sparc32
  2010-04-19 14:33 [Qemu-devel] singlestep and sparc32 Artyom Tarasenko
  2010-04-19 16:07 ` malc
  2010-04-19 16:19 ` [Qemu-devel] " Stefan Weil
@ 2010-04-19 19:55 ` Blue Swirl
  2010-04-19 20:33   ` Artyom Tarasenko
  2 siblings, 1 reply; 5+ messages in thread
From: Blue Swirl @ 2010-04-19 19:55 UTC (permalink / raw)
  To: Artyom Tarasenko; +Cc: qemu-devel

On 4/19/10, Artyom Tarasenko <atar4qemu@googlemail.com> wrote:
> is -single-step option supposed to work under qemu-system-sparc? Or is
>  it only for non-pipelined CPUs?

I've never used it.

>  I get pretty strange results: some addresses seem to be executed
>  twice, and then qemu hangs on the last nop:

One possibility is that we don't generate any code at all for nops
(sethi x, %g0). If you delete the "if (rd)" check in translate.c:1784,
does it help?

>  --------------
>  IN:
>  0x00000000:  b  0xb788
>  --------------
>  IN:
>  0x00000004:  rd  %psr, %l0
>  --------------
>  IN:
>  0x00000004:  rd  %psr, %l0
>  --------------
>  IN:
>  0x00000008:  nop
>  --------------
>  IN:
>  0x00000008:  nop
>  --------------
>  IN:
>  0x0000000c:  nop
>  --------------
>  IN:
>  0x0000000c:  nop
>
>  ... skipped ...
>
>  IN:
>  0x7000a58c:  bg  0x7000a588
>  --------------
>  IN:
>  0x7000a590:  nop
>  --------------
>  IN:
>  0x7000a590:  nop
>  --------------
>  IN:
>  0x7000a594:  b  0x7000a570
>  --------------
>  IN:
>  0x7000a594:  b  0x7000a570
>  --------------
>  IN:
>  0x7000a578:  be  0x7000a59c
>  --------------
>  IN:
>  0x7000a580:  stba  %l1, [ %l0 ] #ASI_M_BYPASS
>  --------------
>  IN:
>  0x7000a588:  deccc  %l2
>  --------------
>  IN:
>  0x7000a594:  b  0x7000a570
>  --------------
>  IN:
>  0x7000a590:  nop
>
>  ^^^^^^^^^^^ That's the end
>
>  Without -singlestep it seems to work better:
>
>
>  0x7000a588:  deccc  %l2
>  0x7000a58c:  bg  0x7000a588
>  0x7000a590:  nop
>
>  --------------
>  IN:
>  0x7000a594:  b  0x7000a570
>  0x7000a598:  inc  %l4
>
>  --------------
>  IN:
>  0x7000a570:  lduba  [ %l4 ] #ASI_M_KERNELTXT, %l1
>  0x7000a574:  cmp  %l1, 0xff
>  0x7000a578:  be  0x7000a59c
>  ... and so on ...
>
>
>
>  --
>  Regards,
>  Artyom Tarasenko
>
>  solaris/sparc under qemu blog: http://tyom.blogspot.com/
>

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

* [Qemu-devel] Re: singlestep and sparc32
  2010-04-19 19:55 ` Blue Swirl
@ 2010-04-19 20:33   ` Artyom Tarasenko
  0 siblings, 0 replies; 5+ messages in thread
From: Artyom Tarasenko @ 2010-04-19 20:33 UTC (permalink / raw)
  To: Blue Swirl; +Cc: qemu-devel

2010/4/19 Blue Swirl <blauwirbel@gmail.com>:
> On 4/19/10, Artyom Tarasenko <atar4qemu@googlemail.com> wrote:
>> is -single-step option supposed to work under qemu-system-sparc? Or is
>>  it only for non-pipelined CPUs?
>
> I've never used it.

is there another way to reduce a translation block? -icount 1 doesn't
make a difference.

>>  I get pretty strange results: some addresses seem to be executed
>>  twice, and then qemu hangs on the last nop:
>
> One possibility is that we don't generate any code at all for nops
> (sethi x, %g0). If you delete the "if (rd)" check in translate.c:1784,
> does it help?

Seems to make no difference at all.

>>  --------------
>>  IN:
>>  0x00000000:  b  0xb788
>>  --------------
>>  IN:
>>  0x00000004:  rd  %psr, %l0
>>  --------------
>>  IN:
>>  0x00000004:  rd  %psr, %l0
>>  --------------
>>  IN:
>>  0x00000008:  nop
>>  --------------
>>  IN:
>>  0x00000008:  nop
>>  --------------
>>  IN:
>>  0x0000000c:  nop
>>  --------------
>>  IN:
>>  0x0000000c:  nop
>>
>>  ... skipped ...
>>
>>  IN:
>>  0x7000a58c:  bg  0x7000a588
>>  --------------
>>  IN:
>>  0x7000a590:  nop
>>  --------------
>>  IN:
>>  0x7000a590:  nop
>>  --------------
>>  IN:
>>  0x7000a594:  b  0x7000a570
>>  --------------
>>  IN:
>>  0x7000a594:  b  0x7000a570
>>  --------------
>>  IN:
>>  0x7000a578:  be  0x7000a59c
>>  --------------
>>  IN:
>>  0x7000a580:  stba  %l1, [ %l0 ] #ASI_M_BYPASS
>>  --------------
>>  IN:
>>  0x7000a588:  deccc  %l2
>>  --------------
>>  IN:
>>  0x7000a594:  b  0x7000a570
>>  --------------
>>  IN:
>>  0x7000a590:  nop
>>
>>  ^^^^^^^^^^^ That's the end
>>
>>  Without -singlestep it seems to work better:
>>
>>
>>  0x7000a588:  deccc  %l2
>>  0x7000a58c:  bg  0x7000a588
>>  0x7000a590:  nop
>>
>>  --------------
>>  IN:
>>  0x7000a594:  b  0x7000a570
>>  0x7000a598:  inc  %l4
>>
>>  --------------
>>  IN:
>>  0x7000a570:  lduba  [ %l4 ] #ASI_M_KERNELTXT, %l1
>>  0x7000a574:  cmp  %l1, 0xff
>>  0x7000a578:  be  0x7000a59c
>>  ... and so on ...


-- 
Regards,
Artyom Tarasenko

solaris/sparc under qemu blog: http://tyom.blogspot.com/

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

end of thread, other threads:[~2010-04-19 20:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-19 14:33 [Qemu-devel] singlestep and sparc32 Artyom Tarasenko
2010-04-19 16:07 ` malc
2010-04-19 16:19 ` [Qemu-devel] " Stefan Weil
2010-04-19 19:55 ` Blue Swirl
2010-04-19 20:33   ` Artyom Tarasenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.