diff mbox series

[RFC,2/4] target/riscv/kvm: implement kvm_arch_update_guest_debug()

Message ID 20231221094923.7349-3-duchao@eswincomputing.com
State New
Headers show
Series target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V | expand

Commit Message

Chao Du Dec. 21, 2023, 9:49 a.m. UTC
Set the control flag when there are active breakpoints. This will
help KVM to know the status in the userspace.

Signed-off-by: Chao Du <duchao@eswincomputing.com>
---
 target/riscv/kvm/kvm-cpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c
index e9110006b0..94697b09bb 100644
--- a/target/riscv/kvm/kvm-cpu.c
+++ b/target/riscv/kvm/kvm-cpu.c
@@ -1598,5 +1598,7 @@  void kvm_arch_remove_all_hw_breakpoints(void)
 
 void kvm_arch_update_guest_debug(CPUState *cs, struct kvm_guest_debug *dbg)
 {
-    /* TODO; To be implemented later. */
+    if (kvm_sw_breakpoints_active(cs)) {
+        dbg->control |= KVM_GUESTDBG_ENABLE;
+    }
 }