]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: arm64: guest debug, add SW break point support
authorAlex Bennée <alex.bennee@linaro.org>
Tue, 7 Jul 2015 16:29:57 +0000 (17:29 +0100)
committerMarc Zyngier <marc.zyngier@arm.com>
Tue, 21 Jul 2015 11:47:08 +0000 (12:47 +0100)
commitb5bffce24a267a479bd15ed66e61c55b026d5491
treef90c63e79179c6ce52a2dee5f7e05a14e7d9ce62
parenta12b7a6530bb8c9958aa0a92ac3a4a26471e1249
KVM: arm64: guest debug, add SW break point support

This adds support for SW breakpoints inserted by userspace.

We do this by trapping all guest software debug exceptions to the
hypervisor (MDCR_EL2.TDE). The exit handler sets an exit reason of
KVM_EXIT_DEBUG with the kvm_debug_exit_arch structure holding the
exception syndrome information.

It will be up to userspace to extract the PC (via GET_ONE_REG) and
determine if the debug event was for a breakpoint it inserted. If not
userspace will need to re-inject the correct exception restart the
hypervisor to deliver the debug exception to the guest.

Any other guest software debug exception (e.g. single step or HW
assisted breakpoints) will cause an error and the VM to be killed. This
is addressed by later patches which add support for the other debug
types.

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>
Documentation/virtual/kvm/api.txt
arch/arm64/kvm/debug.c
arch/arm64/kvm/guest.c
arch/arm64/kvm/handle_exit.c