target/riscv/kvm: add software breakpoints support
authorChao Du <duchao@eswincomputing.com>
Thu, 6 Jun 2024 01:44:59 +0000 (01:44 +0000)
committerAlistair Francis <alistair.francis@wdc.com>
Wed, 26 Jun 2024 12:45:14 +0000 (22:45 +1000)
commit80b605056d59bb5ee979e2e6ba60528fb3f9eb1b
tree2722b7dae35595044f034b8c61c21fb4f8ef9316
parentf42cdf2ea5b3a1dc369792d7acbf9cd3e5c90815
target/riscv/kvm: add software breakpoints support

This patch implements insert/remove software breakpoint process.

For RISC-V, GDB treats single-step similarly to breakpoint: add a
breakpoint at the next step address, then continue. So this also
works for single-step debugging.

Implement kvm_arch_update_guest_debug(): Set the control flag
when there are active breakpoints. This will help KVM to know
the status in the userspace.

Add some stubs which are necessary for building, and will be
implemented later.

Signed-off-by: Chao Du <duchao@eswincomputing.com>
Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
Acked-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20240606014501.20763-2-duchao@eswincomputing.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
target/riscv/kvm/kvm-cpu.c