summaryrefslogtreecommitdiffstats
path: root/target-arm/kvm.c
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2015-12-17 13:37:15 +0000
committerTimothy Pearson <tpearson@raptorengineering.com>2019-11-29 19:28:19 -0600
commitd9e01040ab0c4cb6c8c5338cc7826813802ccf0f (patch)
tree69c565747e5f7ac06d095bbc0dd41b37616817b6 /target-arm/kvm.c
parentd2edb638117b7715e417b4da5a4bc93720f9e0f6 (diff)
downloadhqemu-d9e01040ab0c4cb6c8c5338cc7826813802ccf0f.zip
hqemu-d9e01040ab0c4cb6c8c5338cc7826813802ccf0f.tar.gz
target-arm: kvm - add support for HW assisted debug
This adds basic support for HW assisted debug. The ioctl interface to KVM allows us to pass an implementation defined number of break and watch point registers. When KVM_GUESTDBG_USE_HW is specified these debug registers will be installed in place on the world switch into the guest. The hardware is actually capable of more advanced matching but it is unclear if this expressiveness is available via the gdbstub protocol. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 1449599553-24713-5-git-send-email-alex.bennee@linaro.org Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'target-arm/kvm.c')
-rw-r--r--target-arm/kvm.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/target-arm/kvm.c b/target-arm/kvm.c
index 7f44e22..84974bb 100644
--- a/target-arm/kvm.c
+++ b/target-arm/kvm.c
@@ -566,26 +566,12 @@ void kvm_arch_update_guest_debug(CPUState *cs, struct kvm_guest_debug *dbg)
dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_SW_BP;
}
#endif
-}
-
-int kvm_arch_insert_hw_breakpoint(target_ulong addr,
- target_ulong len, int type)
-{
- qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
- return -EINVAL;
-}
-
-int kvm_arch_remove_hw_breakpoint(target_ulong addr,
- target_ulong len, int type)
-{
- qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
- return -EINVAL;
-}
-
-
-void kvm_arch_remove_all_hw_breakpoints(void)
-{
- qemu_log_mask(LOG_UNIMP, "%s: not implemented\n", __func__);
+#ifdef KVM_GUESTDBG_USE_HW
+ if (kvm_arm_hw_debug_active(cs)) {
+ dbg->control |= KVM_GUESTDBG_ENABLE | KVM_GUESTDBG_USE_HW;
+ kvm_arm_copy_hw_debug_data(&dbg->arch);
+ }
+#endif
}
void kvm_arch_init_irq_routing(KVMState *s)
OpenPOWER on IntegriCloud