All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] linux-user/s390x: Fix single-stepping SVC
@ 2023-05-10 23:02 Ilya Leoshkevich
  2023-05-10 23:02 ` [PATCH 1/2] " Ilya Leoshkevich
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Ilya Leoshkevich @ 2023-05-10 23:02 UTC (permalink / raw)
  To: Laurent Vivier, Richard Henderson, David Hildenbrand, Thomas Huth
  Cc: qemu-devel, qemu-s390x, Ilya Leoshkevich

Hi,

I noticed that single-stepping SVC runs two instructions instead of
one. The reason is that EXCP_SVC masks EXCP_DEBUG.
Patch 1 fixes this problem, patch 2 adds a test.

Btw, there is at least one more problem in that area, namely
single-stepping instructions that cause e.g. SIGILL. Using the
existing signals-s390x test as an example:

    (gdb) x/i $pc
    => 0x1001740 <illegal_op>:      .long   0x000007fe

    (gdb) si
    Program received signal SIGILL, Illegal instruction.
    (gdb) x/i $pc
    => 0x1001742 <after_illegal_op>:        br      %r14
    # So far so good.

    (gdb) si
    (gdb) x/i $pc
    => 0x10017b6 <handle_signal+6>: lay     %r15,-344(%r15)
    # Missed the first signal handler instruction!

I'm not sure what to do about it - the trivial fix to add
gdb_handlesig(cpu, 0) to the end of handle_pending_signal() caused GDB
to hang, and I haven't looked further yet.

Best regards,
Ilya

Ilya Leoshkevich (2):
  linux-user/s390x: Fix single-stepping SVC
  tests/tcg/s390x: Test single-stepping SVC

 linux-user/s390x/cpu_loop.c         |  9 ++++
 tests/tcg/s390x/Makefile.target     | 11 ++++-
 tests/tcg/s390x/gdbstub/test-svc.py | 64 +++++++++++++++++++++++++++++
 tests/tcg/s390x/hello-s390x-asm.S   | 20 +++++++++
 4 files changed, 103 insertions(+), 1 deletion(-)
 create mode 100644 tests/tcg/s390x/gdbstub/test-svc.py
 create mode 100644 tests/tcg/s390x/hello-s390x-asm.S

-- 
2.40.1



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

end of thread, other threads:[~2023-07-07  8:37 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-10 23:02 [PATCH 0/2] linux-user/s390x: Fix single-stepping SVC Ilya Leoshkevich
2023-05-10 23:02 ` [PATCH 1/2] " Ilya Leoshkevich
2023-05-11 10:55   ` Michael Tokarev
2023-05-11 11:20     ` Ilya Leoshkevich
2023-05-11 12:32       ` Michael Tokarev
2023-05-11 13:45         ` Ilya Leoshkevich
2023-05-11 13:50           ` Michael Tokarev
2023-05-10 23:02 ` [PATCH 2/2] tests/tcg/s390x: Test " Ilya Leoshkevich
2023-05-11 10:51   ` Alex Bennée
2023-07-07  8:37   ` Thomas Huth
2023-05-31 14:37 ` [PATCH 0/2] linux-user/s390x: Fix " Thomas Huth

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.