Re: Exposing host debug capabilities to userspace

2014-11-26 Thread Peter Maydell
On 25 November 2014 at 16:50, Paolo Bonzini wrote: > > > On 25/11/2014 17:35, Alexander Graf wrote: >> Unfortunately on ARM you also have a few other constraints - the debug >> register space is partitioned into magic super debug registers at the >> top (with an implementation specific amount) and

Re: Exposing host debug capabilities to userspace

2014-11-26 Thread Alex Bennée
Paolo Bonzini writes: > On 25/11/2014 17:35, Alexander Graf wrote: >> Unfortunately on ARM you also have a few other constraints - the debug >> register space is partitioned into magic super debug registers at the >> top (with an implementation specific amount) and normal debug registers >> in t

Re: Exposing host debug capabilities to userspace

2014-11-25 Thread Paolo Bonzini
On 25/11/2014 17:35, Alexander Graf wrote: > Unfortunately on ARM you also have a few other constraints - the debug > register space is partitioned into magic super debug registers at the > top (with an implementation specific amount) and normal debug registers > in the lower end of the space. D

Re: Exposing host debug capabilities to userspace

2014-11-25 Thread Paolo Bonzini
On 24/11/2014 15:52, Christoffer Dall wrote: > > We had a lenghty IRC discussion on this, for the curious, go read it > here: > http://irclogs.linaro.org/2014/11/24/%23kvm-arm.html Some notes... > chazy but saying that you want to design an ABI that potentially exposes > fewer debug registers

Re: Exposing host debug capabilities to userspace

2014-11-25 Thread Alexander Graf
On 25.11.14 17:21, Paolo Bonzini wrote: > > > On 24/11/2014 14:59, Alex Bennée wrote: >> Alexander Graf pointed out that KVM_CHECK_EXTENSION can return any >> positive number for success. How about using: >> >> max_hw_bps = kvm_check_extension(kvm_state, KVM_CAP_GUEST_DEBUG_HW_BPS); >> max_hw_w

Re: Exposing host debug capabilities to userspace

2014-11-25 Thread Paolo Bonzini
On 24/11/2014 14:59, Alex Bennée wrote: > Alexander Graf pointed out that KVM_CHECK_EXTENSION can return any > positive number for success. How about using: > > max_hw_bps = kvm_check_extension(kvm_state, KVM_CAP_GUEST_DEBUG_HW_BPS); > max_hw_wps = kvm_check_extension(kvm_state, KVM_CAP_GUEST_DE

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Christoffer Dall
On Mon, Nov 24, 2014 at 03:07:35PM +0100, Alexander Graf wrote: > > > On 24.11.14 14:10, Christoffer Dall wrote: > > On Mon, Nov 24, 2014 at 1:56 PM, Alexander Graf wrote: > >> > >> > >> On 24.11.14 13:53, Christoffer Dall wrote: > >>> On Mon, Nov 24, 2014 at 1:51 PM, Alexander Graf wrote: > >>

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alexander Graf
On 24.11.14 14:10, Christoffer Dall wrote: > On Mon, Nov 24, 2014 at 1:56 PM, Alexander Graf wrote: >> >> >> On 24.11.14 13:53, Christoffer Dall wrote: >>> On Mon, Nov 24, 2014 at 1:51 PM, Alexander Graf wrote: On 24.11.14 13:44, Peter Maydell wrote: > On 24 November 2014 at

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alex Bennée
Alex Bennée writes: > Alex Bennée writes: > >> Hi, >> >> I've almost finished the ARMv8 guest debug support but I have one >> problem left to solve. userspace needs to know how many hardware debug >> registers are available for GDB to use. This information is available >> from the ID_AA64DFR0_

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Christoffer Dall
On Mon, Nov 24, 2014 at 1:56 PM, Alexander Graf wrote: > > > On 24.11.14 13:53, Christoffer Dall wrote: >> On Mon, Nov 24, 2014 at 1:51 PM, Alexander Graf wrote: >>> >>> >>> On 24.11.14 13:44, Peter Maydell wrote: On 24 November 2014 at 12:41, Alexander Graf wrote: >> Am 24.11.2014 um 1

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alexander Graf
On 24.11.14 13:53, Christoffer Dall wrote: > On Mon, Nov 24, 2014 at 1:51 PM, Alexander Graf wrote: >> >> >> On 24.11.14 13:44, Peter Maydell wrote: >>> On 24 November 2014 at 12:41, Alexander Graf wrote: > Am 24.11.2014 um 13:32 schrieb Peter Maydell : > Yes, but we don't want to know

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Christoffer Dall
On Mon, Nov 24, 2014 at 1:53 PM, Alex Bennée wrote: > > Alexander Graf writes: > >>> Am 24.11.2014 um 13:32 schrieb Peter Maydell : >>> On 24 November 2014 at 12:26, Alexander Graf wrote: On 24.11.14 12:35, Alex Bennée wrote: >> * KVM ioctl GET_ONE_REG(ID_AA64DFR0_EL1) > Nope,

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Christoffer Dall
On Mon, Nov 24, 2014 at 1:51 PM, Alexander Graf wrote: > > > On 24.11.14 13:44, Peter Maydell wrote: >> On 24 November 2014 at 12:41, Alexander Graf wrote: Am 24.11.2014 um 13:32 schrieb Peter Maydell : Yes, but we don't want to know about properties of the guest vCPU. In an ideal

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alex Bennée
Alexander Graf writes: >> Am 24.11.2014 um 13:32 schrieb Peter Maydell : >> >>> On 24 November 2014 at 12:26, Alexander Graf wrote: >>> On 24.11.14 12:35, Alex Bennée wrote: > * KVM ioctl GET_ONE_REG(ID_AA64DFR0_EL1) Nope, guest state API >>> >>> What's the problem with using ONE_REG

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alexander Graf
On 24.11.14 13:44, Peter Maydell wrote: > On 24 November 2014 at 12:41, Alexander Graf wrote: >>> Am 24.11.2014 um 13:32 schrieb Peter Maydell : >>> Yes, but we don't want to know about properties of the guest >>> vCPU. In an ideal world QEMU could reserve say half the debug >>> registers for de

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Peter Maydell
On 24 November 2014 at 12:41, Alexander Graf wrote: >> Am 24.11.2014 um 13:32 schrieb Peter Maydell : >> Yes, but we don't want to know about properties of the guest >> vCPU. In an ideal world QEMU could reserve say half the debug >> registers for debugging the VM on startup and have KVM expose >>

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alexander Graf
> Am 24.11.2014 um 13:32 schrieb Peter Maydell : > >> On 24 November 2014 at 12:26, Alexander Graf wrote: >> On 24.11.14 12:35, Alex Bennée wrote: * KVM ioctl GET_ONE_REG(ID_AA64DFR0_EL1) >>> Nope, guest state API >> >> What's the problem with using ONE_REG for this? After all, the total

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Peter Maydell
On 24 November 2014 at 12:26, Alexander Graf wrote: > On 24.11.14 12:35, Alex Bennée wrote: >>> * KVM ioctl GET_ONE_REG(ID_AA64DFR0_EL1) >> Nope, guest state API > > What's the problem with using ONE_REG for this? After all, the total > number of available guest debug register is a guest vcpu prop

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alexander Graf
On 24.11.14 12:35, Alex Bennée wrote: > > Fixed CC:kvmarm, Added: Alexander Graf, Fixed: my From: > > Replying to myself with additional information on each option > > Alex Bennée writes: > >> Hi, >> >> I've almost finished the ARMv8 guest debug support but I have one >> problem left to solv

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Christoffer Dall
On Mon, Nov 24, 2014 at 12:21 PM, Peter Maydell wrote: > On 24 November 2014 at 11:16, Alex Bennée > > wrote: > > ^^^ :-) > >> Alex Bennée writes: >>> * KVM ioctl KVM_GET_DEBUGREGS >>> >>> This is currently x86 only and looks like it's more aimed at debug >>> registers than capability stuff. Als

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alex Bennée
Fixed CC:kvmarm, Added: Alexander Graf, Fixed: my From: Replying to myself with additional information on each option Alex Bennée writes: > Hi, > > I've almost finished the ARMv8 guest debug support but I have one > problem left to solve. userspace needs to know how many hardware debug > regis

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Peter Maydell
On 24 November 2014 at 11:16, Alex Bennée wrote: ^^^ :-) > Alex Bennée writes: >> * KVM ioctl KVM_GET_DEBUGREGS >> >> This is currently x86 only and looks like it's more aimed at debug >> registers than capability stuff. Also I'm not sure what the state of >> this ioctl is compared to KVM_SET_G

Re: Exposing host debug capabilities to userspace

2014-11-21 Thread Alex Bennée
Christoffer Dall writes: > On Thu, Nov 20, 2014 at 04:55:14PM +, Alex Bennée wrote: >> >> * ptrace(PTRACE_GETREGSET, NT_ARM_HW_WATCH) >> >> This is used by GDB to access the host details in debug-monitors. >> However the ptrace API really wants you to attach to a process before >> calling

Re: Exposing host debug capabilities to userspace

2014-11-21 Thread Alex Bennée
Christoffer Dall writes: > On Thu, Nov 20, 2014 at 04:55:14PM +, Alex Bennée wrote: >> Hi, >> >> I've almost finished the ARMv8 guest debug support but I have one >> problem left to solve. userspace needs to know how many hardware debug >> registers are available for GDB to use. >> * KVM io

Re: Exposing host debug capabilities to userspace

2014-11-21 Thread Christoffer Dall
On Thu, Nov 20, 2014 at 04:55:14PM +, Alex Bennée wrote: > Hi, > > I've almost finished the ARMv8 guest debug support but I have one > problem left to solve. userspace needs to know how many hardware debug > registers are available for GDB to use. This information is available > from the ID_AA

Exposing host debug capabilities to userspace

2014-11-20 Thread Alex Bennée
Hi, I've almost finished the ARMv8 guest debug support but I have one problem left to solve. userspace needs to know how many hardware debug registers are available for GDB to use. This information is available from the ID_AA64DFR0_EL1 register. Currently I abuse GET_ONE_REG to fetch it's value ho