[PATCH v4 0/3] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2024-06-05 Thread Chao Du
rnel.org/qemu-riscv/20231221094923.7349-1-duc...@eswincomputing.com/ Chao Du (3): target/riscv/kvm: add software breakpoints support target/riscv/kvm: handle the exit with debug reason target/riscv/kvm: define TARGET_KVM_HAVE_GUEST_DEBUG configs/targets/riscv64-softmmu.mak | 1 + target/

[PATCH v4 1/3] target/riscv/kvm: add software breakpoints support

2024-06-05 Thread Chao Du
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 Reviewed-by: Andrew Jones Acked-by: Alistair Francis --- target/riscv/kvm/kvm-cpu.c | 69

[PATCH v4 2/3] target/riscv/kvm: handle the exit with debug reason

2024-06-05 Thread Chao Du
If the breakpoint belongs to the userspace then set the ret value. Signed-off-by: Chao Du Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones Acked-by: Alistair Francis --- target/riscv/kvm/kvm-cpu.c | 20 1 file changed, 20 insertions(+) diff --git a/target

[PATCH v4 3/3] target/riscv/kvm: define TARGET_KVM_HAVE_GUEST_DEBUG

2024-06-05 Thread Chao Du
To enable the KVM GUEST DEBUG for RISC-V at QEMU side. Signed-off-by: Chao Du Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones Acked-by: Alistair Francis --- configs/targets/riscv64-softmmu.mak | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/targets/riscv64

[PATCH v3 0/3] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2024-06-04 Thread Chao Du
//lore.kernel.org/qemu-riscv/20231221094923.7349-1-duc...@eswincomputing.com/ Chao Du (3): target/riscv/kvm: add software breakpoints support target/riscv/kvm: handle the exit with debug reason target/riscv/kvm: define TARGET_KVM_HAVE_GUEST_DEBUG configs/targets/riscv64-softmmu.mak | 1 +

[PATCH v3 1/3] target/riscv/kvm: add software breakpoints support

2024-06-04 Thread Chao Du
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 Reviewed-by: Andrew Jones Acked-by: Alistair Francis --- target/riscv/kvm/kvm-cpu.c | 70

[PATCH v3 2/3] target/riscv/kvm: handle the exit with debug reason

2024-06-04 Thread Chao Du
If the breakpoint belongs to the userspace then set the ret value. Signed-off-by: Chao Du Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones Acked-by: Alistair Francis --- target/riscv/kvm/kvm-cpu.c | 20 1 file changed, 20 insertions(+) diff --git a/target

[PATCH v3 3/3] target/riscv/kvm: define TARGET_KVM_HAVE_GUEST_DEBUG

2024-06-04 Thread Chao Du
To enable the KVM GUEST DEBUG for RISC-V at QEMU side. Signed-off-by: Chao Du Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones Acked-by: Alistair Francis --- configs/targets/riscv64-softmmu.mak | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/targets/riscv64

[PATCH RESEND v2 1/3] target/riscv/kvm: add software breakpoints support

2024-05-28 Thread Chao Du
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 --- target/riscv/kvm/kvm-cpu.c | 69 ++ 1 file changed, 69 insertions

[PATCH RESEND v2 2/3] target/riscv/kvm: handle the exit with debug reason

2024-05-28 Thread Chao Du
If the breakpoint belongs to the userspace then set the ret value. Signed-off-by: Chao Du Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target/riscv/kvm/kvm-cpu.c | 20 1 file changed, 20 insertions(+) diff --git a/target/riscv/kvm/kvm-cpu.c b/target

[PATCH RESEND v2 0/3] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2024-05-28 Thread Chao Du
to-apply.next - use configs/ definition to conditionalize debug support v1 link: https://lore.kernel.org/qemu-riscv/20240527021916.12953-1-duc...@eswincomputing.com/ RFC link: https://lore.kernel.org/qemu-riscv/20231221094923.7349-1-duc...@eswincomputing.com/ Chao Du (3): target/riscv/kvm: add s

[PATCH RESEND v2 3/3] target/riscv/kvm: define TARGET_KVM_HAVE_GUEST_DEBUG

2024-05-28 Thread Chao Du
To enable the KVM GUEST DEBUG for RISC-V at QEMU side. Signed-off-by: Chao Du Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- configs/targets/riscv64-softmmu.mak | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/targets/riscv64-softmmu.mak b/configs/targets

[PATCH v2 3/3] target/riscv/kvm: define TARGET_KVM_HAVE_GUEST_DEBUG

2024-05-28 Thread Chao Du
To enable the KVM GUEST DEBUG for RISC-V at QEMU side. Signed-off-by: Chao Du Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- configs/targets/riscv64-softmmu.mak | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/targets/riscv64-softmmu.mak b/configs/targets

[PATCH v2 0/3] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2024-05-28 Thread Chao Du
v1 link: https://lore.kernel.org/qemu-riscv/20240527021916.12953-1-duc...@eswincomputing.com/ RFC link: https://lore.kernel.org/qemu-riscv/20231221094923.7349-1-duc...@eswincomputing.com/ Chao Du (3): target/riscv/kvm: add software breakpoints support target/riscv/kvm: handle the exit with debug

[PATCH v2 1/3] target/riscv/kvm: add software breakpoints support

2024-05-28 Thread Chao Du
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 --- target/riscv/kvm/kvm-cpu.c | 69 ++ 1 file changed, 69 insertions

[PATCH v2 2/3] target/riscv/kvm: handle the exit with debug reason

2024-05-28 Thread Chao Du
If the breakpoint belongs to the userspace then set the ret value. Signed-off-by: Chao Du Reviewed-by: Daniel Henrique Barboza Reviewed-by: Andrew Jones --- target/riscv/kvm/kvm-cpu.c | 20 1 file changed, 20 insertions(+) diff --git a/target/riscv/kvm/kvm-cpu.c b/target

Re: [PATCH v1 1/4] target/riscv/kvm: add software breakpoints support

2024-05-27 Thread Chao Du
On 2024-05-27 23:41, Andrew Jones wrote: > On Mon, May 27, 2024 at 02:19:13AM GMT, Chao Du wrote: > > This patch implements insert/remove software breakpoint process: > > > > Add an input parameter for kvm_arch_insert_sw_breakpoint() and > > kvm_arch_remove_sw_brea

[PATCH v1 0/4] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2024-05-26 Thread Chao Du
gger, need to be re-injected to the guest. Changes from RFC->v1: - Rebased on riscv-to-apply.next - use configs/ definition to conditionalize debug support RFC link: https://lore.kernel.org/qemu-riscv/20231221094923.7349-1-duc...@eswincomputing.com/ Chao Du (4): target/riscv/kvm: add softwar

[PATCH v1 3/4] target/riscv/kvm: handle the exit with debug reason

2024-05-26 Thread Chao Du
If the breakpoint belongs to the userspace then set the ret value. Signed-off-by: Chao Du --- target/riscv/kvm/kvm-cpu.c | 20 1 file changed, 20 insertions(+) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 0bc3348b91..0c45e520b2 100644 --- a

[PATCH v1 2/4] target/riscv/kvm: implement kvm_arch_update_guest_debug()

2024-05-26 Thread Chao Du
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 --- target/riscv/kvm/kvm-cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c

[PATCH v1 4/4] target/riscv/kvm: define TARGET_KVM_HAVE_GUEST_DEBUG

2024-05-26 Thread Chao Du
To enable the KVM GUEST DEBUG for RISC-V at QEMU side. Signed-off-by: Chao Du --- configs/targets/riscv64-softmmu.mak | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/targets/riscv64-softmmu.mak b/configs/targets/riscv64-softmmu.mak index 7c0e7eeb42..f938cc1ee6 100644 --- a/configs

[PATCH v1 1/4] target/riscv/kvm: add software breakpoints support

2024-05-26 Thread Chao Du
: Chao Du --- accel/kvm/kvm-all.c| 8 ++-- include/sysemu/kvm.h | 6 ++- target/arm/kvm.c | 6 ++- target/i386/kvm/kvm.c | 6 ++- target/mips/kvm.c | 6 ++- target/ppc/kvm.c | 6 ++- target/riscv/kvm/kvm-cpu.c | 79

Re: [RFC PATCH 1/4] target/riscv/kvm: add software breakpoints support

2024-05-26 Thread Chao Du
On 2024-05-25 00:11, Paolo Bonzini wrote: > > On Tue, Apr 16, 2024 at 11:23 AM Daniel Henrique Barboza > wrote: > > > +int kvm_arch_insert_sw_breakpoint(CPUState *cs, struct kvm_sw_breakpoint > > > *bp, > > > + vaddr len) > > > +{ > > > +if (len != 4 && len

Re: [RFC PATCH 0/4] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2024-05-20 Thread Chao Du
Hi Paolo, As Daniel suggested, could you please take a look at this series ? Thanks, Chao On 2024-04-16 17:25, Daniel Henrique Barboza wrote: > > On 4/9/24 06:43, Chao Du wrote: > > Hi Daniel and all, > > > > The KVM patches have been reviewd and are in the queue. >

Re: [RFC PATCH 1/4] target/riscv/kvm: add software breakpoints support

2024-04-18 Thread Chao Du
On 2024-04-16 17:23, Daniel Henrique Barboza wrote: > > On 12/21/23 06:49, Chao Du wrote: > > This patch implements insert/remove software breakpoint process: > > > > Add an input parameter for kvm_arch_insert_sw_breakpoint() and > > kvm_arch_remove_sw_b

Re: [RFC PATCH 0/4] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2024-04-14 Thread Chao Du
Gentle ping... On 2024-04-09 17:43, Chao Du wrote: > > Hi Daniel and all, > > The KVM patches have been reviewd and are in the queue. > https://lore.kernel.org/all/20240402062628.5425-1-duc...@eswincomputing.com/ > > Could you please review in the QEMU side ? > Then I

Re: [RFC PATCH 0/4] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2024-04-09 Thread Chao Du
uc...@eswincomputing.com/ > > > Thanks, > > Daniel > > On 12/21/23 06:49, Chao Du wrote: > > This series implements QEMU KVM Guest Debug on RISC-V. Currently, we can > > debug RISC-V KVM guest from the host side, with software breakpoints. > > > > A br

[RFC PATCH 0/4] target/riscv/kvm: QEMU support for KVM Guest Debug on RISC-V

2023-12-21 Thread Chao Du
based on QEMU 8.2.0-rc4 and is also available at: https://github.com/Du-Chao/qemu/tree/riscv_gd_sw This is dependent on KVM side changes: https://github.com/Du-Chao/linux/tree/riscv_gd_sw Chao Du (4): target/riscv/kvm: add software breakpoints support target/riscv/kvm: implement

[RFC PATCH 4/4] linux-headers: enable KVM GUEST DEBUG for RISC-V

2023-12-21 Thread Chao Du
Synchronize the kvm.h file which enables KVM GUEST DEBUG at QEMU side. Signed-off-by: Chao Du --- linux-headers/asm-riscv/kvm.h | 1 + 1 file changed, 1 insertion(+) diff --git a/linux-headers/asm-riscv/kvm.h b/linux-headers/asm-riscv/kvm.h index 992c5e4071..72942a7aaf 100644 --- a/linux

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

2023-12-21 Thread Chao Du
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 --- target/riscv/kvm/kvm-cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c

[RFC PATCH 1/4] target/riscv/kvm: add software breakpoints support

2023-12-21 Thread Chao Du
-off-by: Chao Du --- accel/kvm/kvm-all.c| 8 ++-- include/sysemu/kvm.h | 6 ++- target/arm/kvm64.c | 6 ++- target/i386/kvm/kvm.c | 6 ++- target/mips/kvm.c | 6 ++- target/ppc/kvm.c | 6 ++- target/riscv/kvm/kvm-cpu.c | 79

[RFC PATCH 3/4] target/riscv/kvm: handle the exit with debug reason

2023-12-21 Thread Chao Du
If the breakpoint belongs to the userspace then set the ret value. Signed-off-by: Chao Du --- target/riscv/kvm/kvm-cpu.c | 20 1 file changed, 20 insertions(+) diff --git a/target/riscv/kvm/kvm-cpu.c b/target/riscv/kvm/kvm-cpu.c index 94697b09bb..b1aed78780 100644 --- a

Re: [PATCH] target/arm: kvm64: remove a redundant KVM_CAP_SET_GUEST_DEBUG probe

2023-11-22 Thread Chao Du
Hi, Kindly ping. :) Thanks, Chao > -Original Messages-From:"Chao Du" Sent > Time:2023-10-25 15:07:26 (Wednesday)To:qemu-devel@nongnu.org, > qemu-arm@nongnu.orgCc:Subject:[PATCH] target/arm: kvm64: remove a redundant > KVM_CAP_SET_GUEST_DEBUG probe > > Th

[PATCH] target/arm: kvm64: remove a redundant KVM_CAP_SET_GUEST_DEBUG probe

2023-10-25 Thread Chao Du
The KVM_CAP_SET_GUEST_DEBUG is probed during kvm_init(). gdbserver will fail to start if the CAP is not supported. So no need to make another probe here, like other targets. Signed-off-by: Chao Du --- target/arm/kvm64.c | 28 +++- 1 file changed, 7 insertions(+), 21

[PATCH] target/arm: kvm64: remove a redundant KVM_CAP_SET_GUEST_DEBUG probe

2023-10-25 Thread Chao Du
The KVM_CAP_SET_GUEST_DEBUG is probed during kvm_init(). gdbserver will fail to start if the CAP is not supported. So no need to make another probe here, like other targets. Signed-off-by: Chao Du --- target/arm/kvm64.c | 28 +++- 1 file changed, 7 insertions(+), 21