]> git.karo-electronics.de Git - karo-tx-linux.git/commit
KVM: arm64: guest debug, add support for single-step
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 7 Jul 2015 16:29:58 +0000 (17:29 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 21 Jul 2015 11:47:08 +0000 (12:47 +0100)
commit337b99bf7edfb2044781447e7ca386edb1fdba9d
tree0fb8c4deaaa6dcffa7ce8814b78b8e3d0eb36360
parent4bd611ca60afa155bca25b40312ed61c4d46237f
KVM: arm64: guest debug, add support for single-step

This adds support for single-stepping the guest. To do this we need to
manipulate the guests PSTATE.SS and MDSCR_EL1.SS bits to trigger
stepping. We take care to preserve MDSCR_EL1 and trap access to it to
ensure we don't affect the apparent state of the guest.

As we have to enable trapping of all software debug exceptions we
suppress the ability of the guest to single-step itself. If we didn't we
would have to deal with the exception arriving while the guest was in
kernelspace when the guest is expecting to single-step userspace. This
is something we don't want to unwind in the kernel. Once the host is no
longer debugging the guest its ability to single-step userspace is
restored.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/debug.c
arch/arm64/kvm/guest.c
arch/arm64/kvm/handle_exit.c