Re: [PATCH v2 12/12] hw/vmapple/vmapple: Add vmapple machine type

2023-10-12 Thread Francesco Cagnin
Hi Alexander, awesome work, thanks! I don't know if it's the most appropriate fix but to have the patch series working I had to add `select VMAPPLE_VIRTIO_BLK` to `hw/vmapple/Kconfig`: > config VMAPPLE > bool > depends on ARM && HVF > default y if ARM && HVF > imply PCI_DEV

[PATCH v5 2/4] hvf: handle access for more registers

2023-06-01 Thread francesco . cagnin
From: Francesco Cagnin Required for guest debugging. Signed-off-by: Francesco Cagnin --- target/arm/hvf/hvf.c | 213 +++ 1 file changed, 213 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index ad65603445..e221e37055 100644

[PATCH v5 3/4] hvf: add breakpoint handlers

2023-06-01 Thread francesco . cagnin
From: Francesco Cagnin Required for guest debugging. The code has been structured like the KVM counterpart. Signed-off-by: Francesco Cagnin --- accel/hvf/hvf-accel-ops.c | 109 ++ accel/hvf/hvf-all.c | 17 ++ include/sysemu/hvf.h | 22

[PATCH v5 4/4] hvf: add guest debugging handlers for Apple Silicon hosts

2023-06-01 Thread francesco . cagnin
From: Francesco Cagnin Guests can now be debugged through the gdbstub. Support is added for single-stepping, software breakpoints, hardware breakpoints and watchpoints. The code has been structured like the KVM counterpart. While guest debugging is enabled, the guest can still read and write

[PATCH v5 1/4] arm: move KVM breakpoints helpers

2023-06-01 Thread francesco . cagnin
From: Francesco Cagnin These helpers will be also used for HVF. Aside from reformatting a couple of comments for 'checkpatch.pl' and updating meson to compile 'hyp_gdbstub.c', this is just code motion. Signed-off-by: Francesco Cagnin Reviewed-by: Alex Bennée Review

[PATCH v5 0/4] Add gdbstub support to HVF

2023-06-01 Thread francesco . cagnin
From: Francesco Cagnin This patch series aims to add gdbstub support to HVF (the 'QEMU accelerator on macOS that employs Hypervisor.framework') on Apple Silicon hosts. The proposed implementation, structured like the KVM counterpart, handles single-stepping, software breakpoints

Re: [PATCH v4 2/2] hvf: implement guest debugging on Apple Silicon hosts

2023-04-30 Thread Francesco Cagnin
> Other than that, the structure of the patch looks OK, but > I think you need to identify the cause of the problems > with SMP setups that you mention in the cover letter, > since they suggest that there's a bug lurking in here > somewhere. In the current patch, in `hvf_arch_update_guest_debug()`

[PATCH v4 1/2] arm: move KVM breakpoints helpers

2023-04-03 Thread francesco . cagnin
From: Francesco Cagnin These helpers will be also used for HVF. Aside from reformatting a couple of comments for 'checkpatch.pl' and updating meson to compile 'hyp_gdbstub.c', this is just code motion. Signed-off-by: Francesco Cagnin Reviewed-by: Alex Bennée Review

[PATCH v4 2/2] hvf: implement guest debugging on Apple Silicon hosts

2023-04-03 Thread francesco . cagnin
From: Francesco Cagnin Support is added for single-stepping, software breakpoints, hardware breakpoints and watchpoints. The code has been structured like the KVM counterpart (and many parts are basically identical). Guests can be debugged through the gdbstub. While guest debugging is enabled

[PATCH v4 0/2] Add gdbstub support to HVF

2023-04-03 Thread francesco . cagnin
From: Francesco Cagnin This patch series aims to add gdbstub support to HVF (the 'QEMU accelerator on macOS that employs Hypervisor.framework') on Apple Silicon hosts. The proposed implementation, structured like the KVM counterpart, handles single-stepping, software breakpoints

Re: [PATCH v3 1/3] arm: move KVM breakpoints helpers

2023-02-13 Thread Francesco Cagnin
> New files must all start with the usual boilerplate > comment stating the license and copyright. Sorry I didn't > notice this in previous rounds of review. Pardon my naivety, since the new file only contains code from 'target/arm/kvm64.c', should I just copy the license and copyright comments fr

Re: [PATCH v3 0/3] Add gdbstub support to HVF

2023-02-13 Thread Francesco Cagnin
Hi Phil, > Could you share the test-gdbstub.py changes? I've just opened an issue on Gitlab: https://gitlab.com/qemu-project/qemu/-/issues/1489 Thanks, Francesco

Re: [PATCH v3 2/3] hvf: implement guest debugging on Apple Silicon hosts

2023-01-23 Thread Francesco Cagnin
Are you running the Linux guest on multiple cores? If yes, could you check if the issue persists also when using a single core? Thanks, -- Francesco

[PATCH v3 3/3] hvf: handle singlestepping over instructions which trigger a VM exit

2023-01-14 Thread francesco . cagnin
From: Francesco Cagnin Signed-off-by: Francesco Cagnin --- target/arm/hvf/hvf.c | 4 1 file changed, 4 insertions(+) diff --git a/target/arm/hvf/hvf.c b/target/arm/hvf/hvf.c index c63e8da6a5..87c531508e 100644 --- a/target/arm/hvf/hvf.c +++ b/target/arm/hvf/hvf.c @@ -1807,6 +1807,10

[PATCH v3 0/3] Add gdbstub support to HVF

2023-01-14 Thread francesco . cagnin
From: Francesco Cagnin This patch series aims to add gdbstub support to HVF (the 'QEMU accelerator on macOS that employs Hypervisor.framework') on Apple Silicon hosts. The proposed implementation, structured like the KVM counterpart, handles single-stepping, software breakpoints

[PATCH v3 2/3] hvf: implement guest debugging on Apple Silicon hosts

2023-01-14 Thread francesco . cagnin
From: Francesco Cagnin Support is added for single-stepping, software breakpoints, hardware breakpoints and watchpoints. The code has been structured like the KVM counterpart (and many parts are basically identical). Guests can be debugged through the gdbstub. While guest debugging is enabled

[PATCH v3 1/3] arm: move KVM breakpoints helpers

2023-01-14 Thread francesco . cagnin
From: Francesco Cagnin These helpers will be also used for HVF. Aside from reformatting a couple of comments for 'checkpatch.pl' and updating meson to compile 'hyp_gdbstub.c', this is just code motion. Signed-off-by: Francesco Cagnin --- target/arm

Re: [PATCH v2 2/3] hvf: implement guest debugging on Apple Silicon hosts

2022-12-19 Thread Francesco Cagnin
Hi, indeed, the patch doesn't keep separate copies of debug registers and just directly sets cp15.* values, as I was not aware of the issue—thanks for the detailed explanation. I remain available to implement the required fixes, but I'd need some guidance on how to proceed. Thanks, -- Francesco

[PATCH v2 1/3] arm: move KVM breakpoints helpers

2022-11-16 Thread francesco . cagnin
From: Francesco Cagnin These helpers will be also used for HVF. Aside from reformatting a couple of comments for 'checkpatch.pl' and updating meson to compile 'hyp_gdbstub.c', this is just code motion. Signed-off-by: Francesco Cagnin --- target/arm

[PATCH v2 2/3] hvf: implement guest debugging on Apple Silicon hosts

2022-11-16 Thread francesco . cagnin
From: Francesco Cagnin Support is added for single-stepping, software breakpoints, hardware breakpoints and watchpoints. The code has been structured like the KVM counterpart (and many parts are basically identical). Guests can be debugged through the gdbstub. Signed-off-by: Francesco Cagnin

[PATCH v2 0/3] Add gdbstub support to HVF

2022-11-16 Thread francesco . cagnin
From: Francesco Cagnin This patch series aims to add gdbstub support to HVF (the 'QEMU accelerator on macOS that employs Hypervisor.framework') on Apple Silicon hosts. The proposed implementation, structured like the KVM counterpart, handles single-stepping, software breakpoints

[PATCH v2 3/3] hvf: handle writes of MDSCR_EL1 and DBG*_EL1

2022-11-16 Thread francesco . cagnin
From: Francesco Cagnin This proved to be required when debugging the Linux kernel's initial code, as the Hypervisor framework was triggering 'EC_SYSTEMREGISTERTRAP' VM exits after enabling trap exceptions with 'hv_vcpu_set_trap_debug_exceptions()'. Signed-off-by: Fran

Re: [PATCH 1/3] arm: move KVM breakpoints helpers

2022-11-09 Thread Francesco Cagnin
> I was planning to move hypervisor-specific code to target/arm/$hypervisor/, > but here Francesco wants to re-use the same code > between 2 hypervisors... Maybe move it to target/arm/hyp_gdbstub.c > and let meson add it conditionally? Something like this? -arm_ss.add(when: 'CONFIG_KVM', if_true

Re: [PATCH 2/3] hvf: implement guest debugging on Apple Silicon hosts

2022-11-09 Thread Francesco Cagnin
> In my version, I added the sw breakpoints to `hvf_vcpu_state` so they would > follow each CPU, but it's effectively a copy of the global set of breakpoints. Ah, I missed this field, and it seems the proper one to use. I'll switch to this. > Moving it to `hvf_arch_update_guest_debug` would proba

Re: [PATCH 2/3] hvf: implement guest debugging on Apple Silicon hosts

2022-11-08 Thread Francesco Cagnin
Mads, thanks for the review and feedbacks. I worked on this a few months ago but only managed to have it published now, I'm sorry for work being done twice. I'll add support for SSTEP_NOIRQ as you suggested. For multi-core systems there's no particular issue, just I'm not familiar with all of the

[PATCH 2/3] hvf: implement guest debugging on Apple Silicon hosts

2022-11-04 Thread francesco . cagnin
From: Francesco Cagnin Support is added for single-stepping, software breakpoints, hardware breakpoints and watchpoints. The code has been structured like the KVM counterpart (and many parts are basically identical). Guests can be debugged through the gdbstub. Signed-off-by: Francesco Cagnin

[PATCH 3/3] hvf: handle writes of MDSCR_EL1 and DBG*_EL1

2022-11-04 Thread francesco . cagnin
From: Francesco Cagnin This proved to be required when debugging the Linux kernel's initial code, as the Hypervisor framework was triggering 'EC_SYSTEMREGISTERTRAP' VM exits after enabling trap exceptions with 'hv_vcpu_set_trap_debug_exceptions()'. Signed-off-by: Fran

[PATCH 1/3] arm: move KVM breakpoints helpers

2022-11-04 Thread francesco . cagnin
From: Francesco Cagnin These helpers will be also used for HVF. Aside from reformatting a couple of comments for 'checkpatch.pl', this is just code motion. Signed-off-by: Francesco Cagnin --- target/arm/debug_helper.c | 241 + target/arm/internals.

[PATCH 0/3] Add gdbstub support to HVF

2022-11-04 Thread francesco . cagnin
From: Francesco Cagnin Hello, This patch series aims to add gdbstub support to HVF (the 'QEMU accelerator on macOS that employs Hypervisor.framework') on Apple Silicon hosts. The proposed implementation, structured like the KVM counterpart, handles single-stepping, software b