summary refs log tree commit diff stats
path: root/linux-user/s390x/cpu_loop.c
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2023-05-11 01:02:12 +0200
committerThomas Huth <thuth@redhat.com>2023-06-05 07:27:23 +0200
commit01b9990a3fb84bb9a14017255ab1a4fa86588215 (patch)
tree327ec7a187145f2b748eccbd6e46cf8c5dcb2211 /linux-user/s390x/cpu_loop.c
parent230976232f4fcdc205d6ec53ec9f3804b28dc1e7 (diff)
downloadfocaccia-qemu-01b9990a3fb84bb9a14017255ab1a4fa86588215.tar.gz
focaccia-qemu-01b9990a3fb84bb9a14017255ab1a4fa86588215.zip
linux-user/s390x: Fix single-stepping SVC
Currently single-stepping SVC executes two instructions. The reason is
that EXCP_DEBUG for the SVC instruction itself is masked by EXCP_SVC.
Fix by re-raising EXCP_DEBUG.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Message-Id: <20230510230213.330134-2-iii@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'linux-user/s390x/cpu_loop.c')
-rw-r--r--linux-user/s390x/cpu_loop.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/linux-user/s390x/cpu_loop.c b/linux-user/s390x/cpu_loop.c
index 285bc60071..8b7ac2879e 100644
--- a/linux-user/s390x/cpu_loop.c
+++ b/linux-user/s390x/cpu_loop.c
@@ -86,6 +86,15 @@ void cpu_loop(CPUS390XState *env)
             } else if (ret != -QEMU_ESIGRETURN) {
                 env->regs[2] = ret;
             }
+
+            if (unlikely(cs->singlestep_enabled)) {
+                /*
+                 * cpu_tb_exec() did not raise EXCP_DEBUG, because it has seen
+                 * that EXCP_SVC was already pending.
+                 */
+                cs->exception_index = EXCP_DEBUG;
+            }
+
             break;
 
         case EXCP_DEBUG: