KVM: s390: interrupt: Fix single-stepping into program interrupt handlers
authorIlya Leoshkevich <iii@linux.ibm.com>
Tue, 25 Jul 2023 14:37:17 +0000 (16:37 +0200)
committerJanosch Frank <frankja@linux.ibm.com>
Mon, 28 Aug 2023 09:24:19 +0000 (09:24 +0000)
commit74a439ef7b67d89d29ec7485c3aeca20a64449c5
treeaaade94674733cd89121d0fc19e05d22123b3b73
parent16631c42e6ff4f5acf30998fda6c2ea09d1adbfe
KVM: s390: interrupt: Fix single-stepping into program interrupt handlers

Currently, after single-stepping an instruction that generates a
specification exception, GDB ends up on the instruction immediately
following it.

The reason is that vcpu_post_run() injects the interrupt and sets
KVM_GUESTDBG_EXIT_PENDING, causing a KVM_SINGLESTEP exit. The
interrupt is not delivered, however, therefore userspace sees the
address of the next instruction.

Fix by letting the __vcpu_run() loop go into the next iteration,
where vcpu_pre_run() delivers the interrupt and sets
KVM_GUESTDBG_EXIT_PENDING.

Reviewed-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20230725143857.228626-3-iii@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Signed-off-by: Janosch Frank <frankja@linux.ibm.com>
arch/s390/kvm/intercept.c