Re: [PATCH v2] target-arm: Store SPSR_EL1 state in banked_spsr[1] (SPSR_svc)

2015-03-18 Thread Alex Bennée
on the SPSR patch to yourself if you prefer. Yeah I'll re-spin the series hopefully by the end of this week or early next. Thanks, -Christoffer -- Alex Bennée ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman

[PATCH v4 4/5] target-arm: kvm64 fix save/restore of SPSR regs

2015-03-16 Thread Alex Bennée
mapping and also to ensure the most current value of the spsr is updated to the banked registers (relevant for KVM-TCG migration). Signed-off-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 (ajb) - minor tweaks and clarifications v3 - Use

[PATCH v4 1/5] target-arm: kvm: save/restore mp state

2015-03-16 Thread Alex Bennée
changing the serialisation format. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - make mpstate field runtime dependant (kvm_enabled()) - drop initial KVM_CAP_MP_STATE requirement - re-use cpu_powered instead of new field v4 - s/HALTED/STOPPED/ - move code from machine.c to kvm

[PATCH v4 2/5] hw/intc: arm_gic_kvm.c restore config first

2015-03-16 Thread Alex Bennée
As there is logic to deal with the difference between edge and level triggered interrupts in the kernel we must ensure it knows the configuration of the IRQs before we restore the pending state. Signed-off-by: Alex Bennée alex.ben...@linaro.org Acked-by: Christoffer Dall christoffer.d

[PATCH v4 3/5] target-arm: kvm64 sync FP register state

2015-03-16 Thread Alex Bennée
For migration to work we need to sync all of the register state. This is especially noticeable when GCC starts using FP registers as spill registers even with integer programs. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v4: - fixed merge conflicts - rm superfluous reg.id++ diff

Re: [PATCH 5/6] target-arm/kvm64: fix save/restore of SPSR regs

2015-03-09 Thread Alex Bennée
the whole thing is wrapped in if (el 0) -- PMM -- Alex Bennée ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH v2 1/5] arm: KVM: export vcpi-pause state via MP_STATE ioctls

2015-03-09 Thread Alex Bennée
power state via MP_STATE ioctl? On Mon, Mar 02, 2015 at 01:29:00PM +, Alex Bennée wrote: To cleanly restore an SMP VM we need to ensure that the current pause state of each vcpu is correctly recorded. Things could get confused if the CPU starts running after migration restore completes when

Re: [PATCH v2 2/5] arm/arm64: KVM: Implement support for unqueueing active IRQs

2015-03-09 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Mon, Mar 02, 2015 at 01:29:01PM +, Alex Bennée wrote: From: Christoffer Dall christoffer.d...@linaro.org Migrating active interrupts causes the active state to be lost completely. This implements some additional bitmaps to track

Re: [PATCH v2 3/6] hw/char: pl011 don't keep setting the IRQ if nothing changed

2015-03-13 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 12 March 2015 at 15:51, Peter Maydell peter.mayd...@linaro.org wrote: On 4 March 2015 at 14:35, Alex Bennée alex.ben...@linaro.org wrote: While observing KVM traces I can see additional IRQ calls on pretty much every MMIO access which is just

Re: [PATCH v2 1/6] target-arm: kvm: save/restore mp state

2015-03-13 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 4 March 2015 at 14:35, Alex Bennée alex.ben...@linaro.org wrote: This adds the saving and restore of the current Multi-Processing state of the machine. While the KVM_GET/SET_MP_STATE API exposes a number of potential states for x86 we only

[PATCH v3 1/5] arm/arm64: KVM: export VCPU power state via MP_STATE ioctl

2015-03-13 Thread Alex Bennée
to do this. The arm/arm64 interface is a lot simpler as the only valid states are KVM_MP_STATE_RUNNABLE and KVM_MP_STATE_STOPPED. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - use KVM_MP_STATE_STOPPED instead of KVM_MP_STATE_HALTED - reduce textual churn on API document diff --git

[PATCH v3 4/5] arm/arm64: KVM: Fix migration race in the arch timer

2015-03-13 Thread Alex Bennée
the interrupt and mask the timer only then. Signed-off-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 38721d2..eb93240 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -269,7

[PATCH v2 00/10] KVM Guest Debug support for arm64

2015-03-31 Thread Alex Bennée
. The final patch may get dropped before up-streaming but it does provide useful trace points for anyone who want to track what is happening during guest debug. Alex Bennée (10): KVM: add commentary for kvm_debug_exit_arch struct KVM: define common __KVM_GUESTDBG_USE_SW/HW_BP values KVM: arm: guest

[PATCH v2 07/10] KVM: arm64: guest debug, add support for single-step

2015-03-31 Thread Alex Bennée
of the guest to single-step itself as we have no easy way of re-entering the guest after the exception has been delivered to the hypervisor. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - Move pstate/mdscr manipulation into C - don't export guest_debug to assembly - add accessor

[PATCH v2 04/10] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-03-31 Thread Alex Bennée
This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Currently any operation flag will return EINVAL. Actual functionality will be added with further patches. Signed-off-by: Alex Bennée alex.ben...@linaro.org. --- v2 - simplified form of the ioctl (stuff will go

[PATCH v2 08/10] KVM: arm64: guest debug, HW assisted debug support

2015-03-31 Thread Alex Bennée
on the address and not the PC we also need to export the value of far_el2 to userspace. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - switched to C setup - replace host debug registers directly into context - minor tweak to api docs - setup right register for debug - add FAR_EL2

[PATCH v2 06/10] KVM: arm64: guest debug, add SW break point support

2015-03-31 Thread Alex Bennée
and the hypervisor needs to start again and deliver the exception to guest. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - update to use new exit struct - tweak for C setup - do our setup in debug_setup/clear code - fixed up comments diff --git a/Documentation/virtual/kvm/api.txt b

[PATCH v2 05/10] KVM: arm: introduce kvm_arch_setup/clear_debug()

2015-03-31 Thread Alex Bennée
of the TDA bit from the hyp code into the C code. Signed-off-by: Alex Bennée alex.ben...@linaro.org create mode 100644 arch/arm64/kvm/debug.c diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 41008cd..8c01c97 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch

[PATCH v2 5/5] arm/arm64: KVM: Keep elrsr/aisr in sync with software model

2015-03-02 Thread Alex Bennée
-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Alex Bennée alex.ben...@linaro.org Acked-by: Marc Zyngier marc.zyng...@arm.com diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 7042251..e2a676e 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h @@ -114,6

Re: [PATCH v2 6/6] target-arm: cpu.h document why env-spsr exists

2015-03-04 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 4 March 2015 at 23:35, Alex Bennée alex.ben...@linaro.org wrote: I was getting very confused about the duplication of state. Perhaps we should just get rid of env-spsr and use helpers that understand the banking? Doesn't seem worth changing

[PATCH v2 1/6] target-arm: kvm: save/restore mp state

2015-03-04 Thread Alex Bennée
changing the serialisation format. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - make mpstate field runtime dependant (kvm_enabled()) - drop initial KVM_CAP_MP_STATE requirement - re-use cpu_powered instead of new field diff --git a/target-arm/machine.c b/target-arm/machine.c index

[PATCH v2 6/6] target-arm: cpu.h document why env-spsr exists

2015-03-04 Thread Alex Bennée
I was getting very confused about the duplication of state. Perhaps we should just get rid of env-spsr and use helpers that understand the banking? Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 11845a6..d7fd13f 100644 --- a/target-arm

[PATCH 5/6] target-arm/kvm64: fix save/restore of SPSR regs

2015-02-25 Thread Alex Bennée
mapping and also to ensure the most current value of the spsr is updated to the banked registers (relevant for KVM-TCG migration). Signed-off-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 (ajb) - minor tweaks and clarifications diff --git

[PATCH 2/6] arm_gic_kvm.c: restore config before pending IRQs

2015-02-25 Thread Alex Bennée
As there is logic to deal with the difference between edge and level triggered interrupts in the kernel we must ensure it knows the configuration of the IRQs before we restore the pending state. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/hw/intc/arm_gic_kvm.c b/hw/intc

[PATCH 5/6] target-arm/kvm64: fix save/restore of SPSR registers

2015-02-25 Thread Alex Bennée
mapping and also to ensure the most current value of the spsr is updated to the banked registers (relevant for KVM-TCG migration). Signed-off-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 (ajb) - minor tweaks and clarifications diff --git

[PATCH 3/6] hw/char/pl011: don't keep setting the IRQ if nothing changed

2015-02-25 Thread Alex Bennée
While observing KVM traces I can see additional IRQ calls on pretty much every MMIO access which is just plain inefficient. Only update the QEMU IRQ level if something has actually changed from last time. Otherwise we may be papering over other failure modes. Signed-off-by: Alex Bennée alex.ben

[PATCH v5 4/6] target-arm: kvm64 sync FP register state

2015-03-23 Thread Alex Bennée
For migration to work we need to sync all of the register state. This is especially noticeable when GCC starts using FP registers as spill registers even with integer programs. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v4: - fixed merge conflicts - rm superfluous reg.id++ v5

[PATCH v5 5/6] target-arm: kvm64 fix save/restore of SPSR regs

2015-03-23 Thread Alex Bennée
of the spsr is updated to the banked registers (relevant for KVM-TCG migration). Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 (ajb) - minor tweaks and clarifications v3 - Use the correct bank index function for setting/getting env-spsr - only deal with spsrs in elevated exception levels

[PATCH v5 2/6] target-arm: kvm: save/restore mp state

2015-03-23 Thread Alex Bennée
changing the serialisation format. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - make mpstate field runtime dependant (kvm_enabled()) - drop initial KVM_CAP_MP_STATE requirement - re-use cpu_powered instead of new field v4 - s/HALTED/STOPPED/ - move code from machine.c to kvm

[PATCH v5 1/6] target-arm: Store SPSR_EL1 state in banked_spsr[1] (SPSR_svc)

2015-03-23 Thread Alex Bennée
From: Peter Maydell peter.mayd...@linaro.org The AArch64 SPSR_EL1 register is architecturally mandated to be mapped to the AArch32 SPSR_svc register. This means its state should live in QEMU's env-banked_spsr[1] field. Correct the various places in the code that incorrectly put it in

Re: [PATCH v2 04/10] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-04-14 Thread Alex Bennée
David Hildenbrand d...@linux.vnet.ibm.com writes: On Tue, Mar 31, 2015 at 04:08:02PM +0100, Alex Bennée wrote: This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Currently any operation flag will return EINVAL. Actual functionality will be added with further

Re: [PATCH v2 3/4] target-arm: kvm - support for single step

2015-04-21 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 31 March 2015 at 16:40, Alex Bennée alex.ben...@linaro.org wrote: This adds support for single-step. There isn't much to do on the QEMU side as after we set-up the request for single step via the debug ioctl it is all handled within

Re: [PATCH v2 06/10] KVM: arm64: guest debug, add SW break point support

2015-04-28 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Apr 28, 2015 at 10:34:12AM +0100, Peter Maydell wrote: On 28 April 2015 at 09:42, Alex Bennée alex.ben...@linaro.org wrote: Peter Maydell peter.mayd...@linaro.org writes: Does the kernel already have a conveniently implemented

Re: [PATCH v2 06/10] KVM: arm64: guest debug, add SW break point support

2015-04-29 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Apr 28, 2015 at 03:37:01PM +0100, Alex Bennée wrote: Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Apr 28, 2015 at 10:34:12AM +0100, Peter Maydell wrote: On 28 April 2015 at 09:42, Alex Bennée alex.ben

Re: [PATCH v2 06/10] KVM: arm64: guest debug, add SW break point support

2015-04-28 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 27 April 2015 at 21:04, Christoffer Dall christoffer.d...@linaro.org wrote: On Thu, Apr 23, 2015 at 03:26:53PM +0100, Alex Bennée wrote: Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Mar 31, 2015 at 04:08:04PM +0100, Alex

Re: [PATCH v2 06/10] KVM: arm64: guest debug, add SW break point support

2015-04-29 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Wed, Apr 29, 2015 at 10:18:18AM +0100, Alex Bennée wrote: Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Apr 28, 2015 at 03:37:01PM +0100, Alex Bennée wrote: Christoffer Dall christoffer.d...@linaro.org writes

[PATCH v3 10/12] KVM: arm64: trap nested debug register access

2015-05-07 Thread Alex Bennée
to go to guest's context There is one register (MDCCINT_EL1) which guest debug doesn't care about so this behaves as before. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - re-factor for better flow and fall through. - much simpler with debug_ptr (use the guest area as before

[PATCH v3 12/12] KVM: arm64: add trace points for guest_debug debug

2015-05-07 Thread Alex Bennée
This includes trace points for: kvm_arch_setup_guest_debug kvm_arch_clear_guest_debug kvm_handle_guest_debug I've also added some generic register setting trace events and also a trace point to dump the array of hardware registers. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3

[PATCH v3 11/12] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG

2015-05-07 Thread Alex Bennée
Finally advertise the KVM capability for SET_GUEST_DEBUG. Once arm support is added this check can be moved to the common kvm_vm_ioctl_check_extension() code. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3: - separated capability check from previous patches - moved into arm64

[PATCH v3 00/12] KVM Guest Debug support for arm64

2015-05-06 Thread Alex Bennée
trace points for anyone who want to track what is happening during guest debug. Alex Bennée (12): KVM: add comments for kvm_debug_exit_arch struct KVM: define common __KVM_GUESTDBG_USE_SW/HW_BP values KVM: arm64: guest debug, define API headers KVM: arm: guest debug, add stub

[PATCH v3 07/12] KVM: arm64: guest debug, add support for single-step

2015-05-06 Thread Alex Bennée
of the guest to single-step itself. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - Move pstate/mdscr manipulation into C - don't export guest_debug to assembly - add accessor for saved_debug regs - tweak save/restore of mdscr_el1 v3 - don't save PC in debug information

[PATCH v3 06/12] KVM: arm64: guest debug, add SW break point support

2015-05-06 Thread Alex Bennée
(e.g. single step or HW assisted breakpoints) will cause an error and the VM to be killed. This is addressed by later patches which add support for the other debug types. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - update to use new exit struct - tweak for C setup - do our setup

[PATCH v3 01/12] KVM: add comments for kvm_debug_exit_arch struct

2015-05-06 Thread Alex Bennée
Bring into line with the comments for the other structures and their KVM_EXIT_* cases. Also update api.txt to reflect use in kvm_run documentation. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com

[PATCH v3 02/12] KVM: define common __KVM_GUESTDBG_USE_SW/HW_BP values

2015-05-06 Thread Alex Bennée
-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Andrew Jones drjo...@redhat.com diff --git a/arch/powerpc/include/uapi/asm/kvm.h b/arch/powerpc/include/uapi/asm/kvm.h index ab4d473..1731569 100644 --- a/arch/powerpc/include/uapi/asm/kvm.h +++ b/arch/powerpc/include/uapi/asm/kvm.h

[PATCH v3 05/12] KVM: arm: introduce kvm_arm_init/setup/clear_debug

2015-05-06 Thread Alex Bennée
the hyp code into the C code which is currently used for the lazy debug register context switch code. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - rename fns from arch-arm - preserve MDCR_EL2.HPMN setting - re-word some of the comments - fix some minor grammar nits - merge

[PATCH v3 04/12] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-05-06 Thread Alex Bennée
This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Any unsupported flag will return -EINVAL. For now, only KVM_GUESTDBG_ENABLE is supported, although it won't have any effects. Signed-off-by: Alex Bennée alex.ben...@linaro.org. --- v2 - simplified form of the ioctl

[PATCH v3 03/12] KVM: arm64: guest debug, define API headers

2015-05-06 Thread Alex Bennée
by the architecture specific control bits of the kvm_guest_debug-control flags in the ioctl structure. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com --- v2 - expose hsr and pc directly

Re: [PATCH v4 03/12] KVM: arm64: guest debug, define API headers

2015-05-15 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 15 May 2015 at 16:14, Alex Bennée alex.ben...@linaro.org wrote: Mark Rutland mark.rutl...@arm.com writes: On Fri, May 15, 2015 at 03:27:06PM +0100, Alex Bennée wrote: +/* + * See v8 ARM ARM D7.3: Debug Registers + * + * The control

Re: [PATCH v4 10/12] KVM: arm64: guest debug, HW assisted debug support

2015-05-15 Thread Alex Bennée
Mark Rutland mark.rutl...@arm.com writes: Hi Alex, On Fri, May 15, 2015 at 03:27:13PM +0100, Alex Bennée wrote: This adds support for userspace to control the HW debug registers for guest debug. In the debug ioctl we copy the IMPDEF defined number of registers into a new register set

[PATCH v4 12/12] KVM: arm64: add trace points for guest_debug debug

2015-05-15 Thread Alex Bennée
This includes trace points for: kvm_arch_setup_guest_debug kvm_arch_clear_guest_debug I've also added some generic register setting trace events and also a trace point to dump the array of hardware registers. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - add trace event

[PATCH v4 11/12] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG

2015-05-15 Thread Alex Bennée
Finally advertise the KVM capability for SET_GUEST_DEBUG. Once arm support is added this check can be moved to the common kvm_vm_ioctl_check_extension() code. Signed-off-by: Alex Bennée alex.ben...@linaro.org Acked-by: Christoffer Dall christoffer.d...@linaro.org --- v3: - separated capability

[PATCH v4 08/12] KVM: arm64: re-factor hyp.S debug register code

2015-05-15 Thread Alex Bennée
. It does however rely on the debug registers being 64 bit aligned (as they happen to be in the hyp ABI). Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3: - return to the patch series - add save and restore targets - change register use and document v4: - keep original setup/restore

[PATCH v4 02/12] KVM: define common KVM_GUESTDBG_USE_SW/HW_BP bits

2015-05-15 Thread Alex Bennée
Currently x86, powerpc and soon arm64 use the same two architecture specific bits for guest debug support for software and hardware breakpoints. This makes the shared values explicit. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Andrew Jones drjo...@redhat.com - v4 - claim

[PATCH v4 09/12] KVM: arm64: introduce vcpu-arch.debug_ptr

2015-05-15 Thread Alex Bennée
entails updating the sys_regs code to access this new structure. Instead of passing a register index we now pass an offset into the kvm_guest_debug_arch structure. We also need to ensure the GET/SET_ONE_REG ioctl operations store the registers in their correct location. Signed-off-by: Alex Bennée

[PATCH v4 06/12] KVM: arm64: guest debug, add SW break point support

2015-05-15 Thread Alex Bennée
(e.g. single step or HW assisted breakpoints) will cause an error and the VM to be killed. This is addressed by later patches which add support for the other debug types. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v2 - update

[PATCH v4 07/12] KVM: arm64: guest debug, add support for single-step

2015-05-15 Thread Alex Bennée
of the guest to single-step itself. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - Move pstate/mdscr manipulation into C - don't export guest_debug to assembly - add accessor for saved_debug regs - tweak save/restore of mdscr_el1 v3 - don't save PC in debug information

[PATCH v4 05/12] KVM: arm: introduce kvm_arm_init/setup/clear_debug

2015-05-15 Thread Alex Bennée
the hyp code into the C code which is currently used for the lazy debug register context switch code. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - rename fns from arch-arm - preserve MDCR_EL2.HPMN setting - re-word some of the comments - fix some minor grammar nits - merge

[PATCH v4 03/12] KVM: arm64: guest debug, define API headers

2015-05-15 Thread Alex Bennée
by the architecture specific control bits of the kvm_guest_debug-control flags in the ioctl structure. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com Acked-by: Christoffer Dall christoffer.d

[PATCH v4 01/12] KVM: add comments for kvm_debug_exit_arch struct

2015-05-15 Thread Alex Bennée
Bring into line with the comments for the other structures and their KVM_EXIT_* cases. Also update api.txt to reflect use in kvm_run documentation. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com

Re: [PATCH v2 09/10] KVM: arm64: trap nested debug register access

2015-04-13 Thread Alex Bennée
Andrew Jones drjo...@redhat.com writes: On Tue, Mar 31, 2015 at 04:08:07PM +0100, Alex Bennée wrote: When we are using the hardware registers for guest debug we need to deal with the guests access to them. There is already a mechanism for dealing with these accesses so we build on top

Re: [PATCH v2 05/10] KVM: arm: introduce kvm_arch_setup/clear_debug()

2015-04-13 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Mar 31, 2015 at 04:08:03PM +0100, Alex Bennée wrote: This is a precursor for later patches which will need to do more to setup debug state before entering the hyp.S switch code. The existing functionality for setting mdcr_el2 has

Re: [PATCH v2 06/10] KVM: arm64: guest debug, add SW break point support

2015-04-02 Thread Alex Bennée
of the breakpoint then we have a guest inserted breakpoint and the hypervisor needs to start again and deliver the exception to guest. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - update to use new exit struct - tweak for C setup - do our setup in debug_setup/clear code - fixed

Re: [PATCH v4 06/12] KVM: arm64: guest debug, add SW break point support

2015-05-20 Thread Alex Bennée
Will Deacon will.dea...@arm.com writes: Hi Alex, On Fri, May 15, 2015 at 03:27:09PM +0100, Alex Bennée wrote: This adds support for SW breakpoints inserted by userspace. We do this by trapping all guest software debug exceptions to the hypervisor (MDCR_EL2.TDE). The exit handler sets

Re: [PATCH v2 04/11] KVM: arm: common infrastructure for handling AArch32 CP14/CP15

2015-06-09 Thread Alex Bennée
, 4, r2, c1, c1, 1 - ldr r3, =(HDCR_TPM|HDCR_TPMCR|HDCR_TDRA|HDCR_TDOSA|HDCR_TDA) + ldr r3, =(HDCR_TPM|HDCR_TPMCR) .if \operation == vmentry orr r2, r2, r3 @ Trap some perfmon accesses .else -- Alex Bennée

Re: [PATCH v2 02/11] KVM: arm: rename pm_fake handler to trap_raz_wi

2015-06-09 Thread Alex Bennée
-by: Zhichao Huang zhichao.hu...@linaro.org Reviewed-by: Alex Bennée alex.ben...@linaro.org --- arch/arm/kvm/coproc.c | 34 -- 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c index 2e12760..9d283d9

Re: [PATCH 02/10] arm/arm64: KVM: Move vgic handling to a non-preemptible section

2015-06-09 Thread Alex Bennée
firing)... Introducing a non-preemptible section in kvm_arch_vcpu_ioctl_run prevents the problem from occuring. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Reviewed-by: Alex Bennée alex.ben...@linaro.org --- arch/arm/kvm/arm.c | 13 + 1 file changed, 13 insertions(+) diff

Re: [PATCH 01/10] arm/arm64: KVM: Fix ordering of timer/GIC on guest entry

2015-06-09 Thread Alex Bennée
); + kvm_timer_sync_hwstate(vcpu); + ret = handle_exit(vcpu, run, ret); } Reviewed-by: Alex Bennée alex.ben...@linaro.org -- Alex Bennée ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo

Re: [PATCH v2 05/11] KVM: arm: check ordering of all system register tables

2015-06-10 Thread Alex Bennée
itself. */ for (i = 0; i ARRAY_SIZE(invariant_cp15); i++) -- Alex Bennée ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH] KVM: arm64: fix misleading comments in save/restore

2015-06-04 Thread Alex Bennée
Marc Zyngier marc.zyng...@arm.com writes: On 04/06/15 11:20, Alex Bennée wrote: Marc Zyngier marc.zyng...@arm.com writes: On 04/06/15 10:34, Christoffer Dall wrote: On Thu, May 28, 2015 at 10:43:06AM +0100, Alex Bennée wrote: The elr_el2 and spsr_el2 registers in fact contain

Re: [PATCH] KVM: arm64: fix misleading comments in save/restore

2015-06-04 Thread Alex Bennée
Marc Zyngier marc.zyng...@arm.com writes: On 04/06/15 10:34, Christoffer Dall wrote: On Thu, May 28, 2015 at 10:43:06AM +0100, Alex Bennée wrote: The elr_el2 and spsr_el2 registers in fact contain the processor state before entry into the hypervisor code. be careful with your use

Re: [PATCH v2 03/11] KVM: arm: enable to use the ARM_DSCR_MDBGEN macro from KVM assembly code

2015-06-09 Thread Alex Bennée
Zhichao Huang zhichao.hu...@linaro.org writes: Add #ifndef __ASSEMBLY__ in hw_breakpoint.h, in order to use the ARM_DSCR_MDBGEN macro from KVM assembly code. Signed-off-by: Zhichao Huang zhichao.hu...@linaro.org Reviewed-by: Alex Bennée alex.ben...@linaro.org --- arch/arm/include/asm

Re: [PATCH 03/10] KVM: arm/arm64: vgic: Convert struct vgic_lr to use bitfields

2015-06-09 Thread Alex Bennée
the irq numbers) - source CPU and HW interrupt can share the same field, as a SGI doesn't have a physical line. Signed-off-by: Marc Zyngier marc.zyng...@arm.com Reviewed-by: Alex Bennée alex.ben...@linaro.org --- include/kvm/arm_vgic.h | 10 +++--- 1 file changed, 7 insertions(+), 3

Re: [PATCH 04/10] KVM: arm/arm64: vgic: Allow HW irq to be encoded in LR

2015-06-09 Thread Alex Bennée
)] = lr_val; } -- Alex Bennée ___ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Re: [PATCH v6 10/12] KVM: arm64: guest debug, HW assisted debug support

2015-06-25 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Thu, Jun 25, 2015 at 07:38:33AM +0100, Alex Bennée wrote: Christoffer Dall christoffer.d...@linaro.org writes: On Fri, Jun 19, 2015 at 01:23:48PM +0100, Alex Bennée wrote: This adds support for userspace to control the HW debug

[PATCH v6 11/12] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG

2015-06-19 Thread Alex Bennée
Finally advertise the KVM capability for SET_GUEST_DEBUG. Once arm support is added this check can be moved to the common kvm_vm_ioctl_check_extension() code. Signed-off-by: Alex Bennée alex.ben...@linaro.org Acked-by: Christoffer Dall christoffer.d...@linaro.org --- v3: - separated capability

[PATCH v6 10/12] KVM: arm64: guest debug, HW assisted debug support

2015-06-19 Thread Alex Bennée
to the KVM_EXTENSION ioctl to allow userspace to query the number of hardware break and watch points available on the host hardware. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - switched to C setup - replace host debug registers directly into context - minor tweak to api docs

[PATCH v6 12/12] KVM: arm64: add trace points for guest_debug debug

2015-06-19 Thread Alex Bennée
This includes trace points for: kvm_arch_setup_guest_debug kvm_arch_clear_guest_debug I've also added some generic register setting trace events and also a trace point to dump the array of hardware registers. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - add trace event

[PATCH v6 07/12] KVM: arm64: guest debug, add support for single-step

2015-06-19 Thread Alex Bennée
. Once the host is no longer debugging the guest its ability to single-step userspace is restored. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v2 - Move pstate/mdscr manipulation into C - don't export guest_debug to assembly

[PATCH v6 08/12] KVM: arm64: re-factor hyp.S debug register code

2015-06-19 Thread Alex Bennée
. It does however rely on the debug registers being 64 bit aligned (as they happen to be in the hyp ABI). Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3: - return to the patch series - add save and restore targets - change register use and document v4: - keep original setup/restore

[PATCH v6 01/12] KVM: add comments for kvm_debug_exit_arch struct

2015-06-19 Thread Alex Bennée
Bring into line with the comments for the other structures and their KVM_EXIT_* cases. Also update api.txt to reflect use in kvm_run documentation. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com

[PATCH v6 06/12] KVM: arm64: guest debug, add SW break point support

2015-06-19 Thread Alex Bennée
(e.g. single step or HW assisted breakpoints) will cause an error and the VM to be killed. This is addressed by later patches which add support for the other debug types. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v2 - update

[PATCH v6 02/12] KVM: arm64: fix misleading comments in save/restore

2015-06-19 Thread Alex Bennée
The elr_el2 and spsr_el2 registers in fact contain the processor state before entry into the hypervisor code. In the case of guest state it could be in either el0 or el1. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- arch/arm64/kvm/hyp.S | 8 1 file changed, 4 insertions(+), 4

[PATCH v6 04/12] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-06-19 Thread Alex Bennée
This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Any unsupported flag will return -EINVAL. For now, only KVM_GUESTDBG_ENABLE is supported, although it won't have any effects. Signed-off-by: Alex Bennée alex.ben...@linaro.org. Reviewed-by: Christoffer Dall christoffer.d

[PATCH v6 00/12] KVM Guest Debug support for arm64

2015-06-19 Thread Alex Bennée
-v6 Alex Bennée (12): KVM: add comments for kvm_debug_exit_arch struct KVM: arm64: fix misleading comments in save/restore KVM: arm64: guest debug, define API headers KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl KVM: arm: introduce kvm_arm_init/setup/clear_debug KVM: arm64

[PATCH v2] KVM: arm64: fix misleading comments in save/restore

2015-06-04 Thread Alex Bennée
The elr_el2 and spsr_el2 registers in fact contain the processor state before entry into EL2. In the case of guest state it could be in either el0 or el1. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - s/hypervisor code/EL2/ - comment: pc/pstate before entering/on return from el2

[PATCH v5 09/12] KVM: arm64: introduce vcpu-arch.debug_ptr

2015-05-29 Thread Alex Bennée
entails updating the sys_regs code to access this new structure. Instead of passing a register index we now pass an offset into the kvm_guest_debug_arch structure. We also need to ensure the GET/SET_ONE_REG ioctl operations store the registers in their correct location. Signed-off-by: Alex Bennée

[PATCH v5 01/12] KVM: add comments for kvm_debug_exit_arch struct

2015-05-29 Thread Alex Bennée
Bring into line with the comments for the other structures and their KVM_EXIT_* cases. Also update api.txt to reflect use in kvm_run documentation. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: David Hildenbrand d...@linux.vnet.ibm.com Reviewed-by: Andrew Jones drjo...@redhat.com

[PATCH v5 05/12] KVM: arm: introduce kvm_arm_init/setup/clear_debug

2015-05-29 Thread Alex Bennée
the hyp code into the C code which is currently used for the lazy debug register context switch code. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - rename fns from arch-arm - preserve MDCR_EL2.HPMN setting - re-word some of the comments - fix some minor grammar nits - merge

[PATCH v5 10/12] KVM: arm64: guest debug, HW assisted debug support

2015-05-29 Thread Alex Bennée
to the KVM_EXTENSION ioctl to allow userspace to query the number of hardware break and watch points available on the host hardware. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - switched to C setup - replace host debug registers directly into context - minor tweak to api docs

[PATCH v5 12/12] KVM: arm64: add trace points for guest_debug debug

2015-05-29 Thread Alex Bennée
This includes trace points for: kvm_arch_setup_guest_debug kvm_arch_clear_guest_debug I've also added some generic register setting trace events and also a trace point to dump the array of hardware registers. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - add trace event

[PATCH v5 11/12] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG

2015-05-29 Thread Alex Bennée
Finally advertise the KVM capability for SET_GUEST_DEBUG. Once arm support is added this check can be moved to the common kvm_vm_ioctl_check_extension() code. Signed-off-by: Alex Bennée alex.ben...@linaro.org Acked-by: Christoffer Dall christoffer.d...@linaro.org --- v3: - separated capability

[PATCH v5 00/12] KVM Guest Debug support for arm64

2015-05-29 Thread Alex Bennée
. However this would be a bunch of potentially hairy new code so I've left this as an exercise for a future patch series. https://github.com/stsquad/qemu branch: kvm/guest-debug-v5 Alex Bennée (12): KVM: add comments for kvm_debug_exit_arch struct KVM: arm64: fix misleading comments in save/restore

[PATCH v5 04/12] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-05-29 Thread Alex Bennée
This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Any unsupported flag will return -EINVAL. For now, only KVM_GUESTDBG_ENABLE is supported, although it won't have any effects. Signed-off-by: Alex Bennée alex.ben...@linaro.org. Reviewed-by: Christoffer Dall christoffer.d

[PATCH v5 07/12] KVM: arm64: guest debug, add support for single-step

2015-05-29 Thread Alex Bennée
of the guest to single-step itself. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - Move pstate/mdscr manipulation into C - don't export guest_debug to assembly - add accessor for saved_debug regs - tweak save/restore of mdscr_el1 v3 - don't save PC in debug information

[PATCH v5 02/12] KVM: arm64: fix misleading comments in save/restore

2015-05-29 Thread Alex Bennée
The elr_el2 and spsr_el2 registers in fact contain the processor state before entry into the hypervisor code. In the case of guest state it could be in either el0 or el1. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- arch/arm64/kvm/hyp.S | 8 1 file changed, 4 insertions(+), 4

[PATCH v5 06/12] KVM: arm64: guest debug, add SW break point support

2015-05-29 Thread Alex Bennée
(e.g. single step or HW assisted breakpoints) will cause an error and the VM to be killed. This is addressed by later patches which add support for the other debug types. Signed-off-by: Alex Bennée alex.ben...@linaro.org Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v2 - update

[PATCH v5 3/6] target-arm: kvm - implement software breakpoints

2015-05-29 Thread Alex Bennée
to userspace. Signed-off-by: Alex Bennée alex.ben...@linaro.org -- v2 - handle debug exit with new hsr exception info - add verbosity to UNIMP message v3 - sync with kvm_cpu_synchronize_state() before checking PC. - use internals.h defines - use env-pc - use proper format types --- target-arm

[PATCH v5 1/6] linux-headers: sync from my kernel tree (DEV)

2015-05-29 Thread Alex Bennée
I assume I'll properly merge the KVM Headers direct from Linux when the kernel side is upstream. These headers came from: https://git.linaro.org/people/alex.bennee/linux.git/shortlog/refs/heads/guest-debug/4.1-rc5-v5 Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - update ABI

[PATCH v5 2/6] target-arm: kvm64: introduce kvm_arm_init_debug()

2015-05-29 Thread Alex Bennée
As we haven't always had guest debug support we need to probe for it. Additionally we don't do this in the start-up capability code so we don't fall over on old kernels. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- target-arm/kvm64.c | 18 ++ 1 file changed, 18

[PATCH v5 0/6] QEMU support for KVM Guest Debug on arm64

2015-05-29 Thread Alex Bennée
and can be found at: https://github.com/stsquad/qemu branch: kvm/guest-debug-v5 The kernel patches for this series are based off a v4.1-rc5-v5 and can be found at: https://git.linaro.org/people/alex.bennee/linux.git branch: guest-debug/4.1-rc5-v5 Alex Bennée (6): linux-headers: sync from my kernel

  1   2   3   4   5   >