[PATCH] arm64: KVM: export demux regids as KVM_REG_ARM64

2014-07-01 Thread Alex Bennée
... (i.e KVM_REG_ARM64). Signed-off-by: Alex Bennée alex.ben...@linaro.org Acked-by: Christoffer Dall christoffer.d...@linaro.org --- arch/arm64/kvm/sys_regs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index 0324458

[PATCH] arm64: KVM: allow export and import of generic timer regs

2014-07-04 Thread Alex Bennée
to be in the common include/kvm/arm_arch_timer.h headers. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- arch/arm/include/asm/kvm_host.h | 3 -- arch/arm/kvm/guest.c| 10 -- arch/arm64/kvm/guest.c | 68 - include/kvm/arm_arch_timer.h

[PATCH] arm64: KVM: export current vcpu-pause state via pseudo regs

2014-07-09 Thread Alex Bennée
only 1 bit used) via the GET/SET_ONE_REG logic to pass the state between KVM and the VM controller (e.g. QEMU). Signed-off-by: Alex Bennée alex.ben...@linaro.org --- arch/arm64/include/uapi/asm/kvm.h | 8 + arch/arm64/kvm/guest.c| 61 ++- 2 files

[PATCH v2 09/10] target-arm/kvm.c: better error reporting

2014-07-10 Thread Alex Bennée
From: Alex Bennée a...@bennee.com When we have a problem syncing CP registers between kvm-qemu it's a lot more useful to have the names of the registers in the log than just a random abort() and core dump. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - less verbose log message

[PATCH v2 10/10] target-arm/kvm: make reg sync code common between kvm32/64

2014-07-10 Thread Alex Bennée
). This list may well have more registers than are known by the TCG emulation which is not necessarily a problem but it does stop us from migrating between KVM and TCG hosted guests. I've added some additional checking to report those registers under -d unimp. Signed-off-by: Alex Bennée alex.ben

Re: [PATCH] arm64: KVM: export current vcpu-pause state via pseudo regs

2014-07-31 Thread Alex Bennée
Christoffer Dall writes: On Wed, Jul 09, 2014 at 02:55:12PM +0100, 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] arm64: KVM: export current vcpu-pause state via pseudo regs

2014-08-01 Thread Alex Bennée
Christoffer Dall writes: On Thu, Jul 31, 2014 at 04:14:51PM +0100, Alex Bennée wrote: Christoffer Dall writes: On Wed, Jul 09, 2014 at 02:55:12PM +0100, 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

Re: [PATCH] arm64: KVM: export current vcpu-pause state via pseudo regs

2014-08-01 Thread Alex Bennée
(*wq, !vcpu-arch.pause). -- Alex Bennée -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] arm64: KVM: export current vcpu-pause state via pseudo regs

2014-08-04 Thread Alex Bennée
Christoffer Dall writes: On Thu, Jul 31, 2014 at 07:21:44PM +0200, Paolo Bonzini wrote: Il 31/07/2014 19:04, Peter Maydell ha scritto: On 31 July 2014 17:57, Paolo Bonzini pbonz...@redhat.com wrote: Il 09/07/2014 15:55, Alex Bennée ha scritto: snip No, it's not. It's just the state

[PATCH 2/2] KVM: fix api documentation of KVM_GET_EMULATED_CPUID

2014-09-09 Thread Alex Bennée
It looks like when this was initially merged it got accidentally included in the following section. I've just moved it back in the correct section and re-numbered it as other ioctls have been added since. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/Documentation/virtual/kvm

[PATCH 0/2] KVM API documentation patches

2014-09-09 Thread Alex Bennée
implementations who I hope can sanity check the write-up. The second is a trivial formatting fix for what looks like a minor merge trip-up. Alex Bennée (2): KVM: document KVM_SET_GUEST_DEBUG api KVM: fix api documentation of KVM_GET_EMULATED_CPUID Documentation/virtual/kvm/api.txt | 184

[PATCH 1/2] KVM: document KVM_SET_GUEST_DEBUG api

2014-09-09 Thread Alex Bennée
In preparation for working on the ARM implementation I noticed the debug interface was missing from the API document. I've pieced together the expected behaviour from the code and commit messages written it up as best I can. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git

Re: [PATCH 0/2] KVM API documentation patches

2014-09-15 Thread Alex Bennée
Christoffer Dall writes: On Wed, Sep 10, 2014 at 11:34:53AM +0200, Paolo Bonzini wrote: Il 09/09/2014 18:27, Alex Bennée ha scritto: Hi, I'm preparing to add ARM KVM GDB support and I went to read the API documentation and found it surprisingly mute on the subject ;-) The first

Exposing host debug capabilities to userspace

2014-11-20 Thread Alex Bennée
valued feedback ;-) -- Alex Bennée -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Exposing host debug capabilities to userspace

2014-11-21 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org 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

Re: Exposing host debug capabilities to userspace

2014-11-21 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Thu, Nov 20, 2014 at 04:55:14PM +, Alex Bennée wrote: snip * 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

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 alex.ben...@linaro.org 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

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alex Bennée
Alexander Graf ag...@suse.de writes: Am 24.11.2014 um 13:32 schrieb Peter Maydell peter.mayd...@linaro.org: On 24 November 2014 at 12:26, Alexander Graf ag...@suse.de 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

Re: Exposing host debug capabilities to userspace

2014-11-24 Thread Alex Bennée
Alex Bennée alex.ben...@linaro.org writes: snip Alex Bennée alex.ben...@linaro.org 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

[PATCH 0/7] KVM Guest Debug support for arm64

2014-11-25 Thread Alex Bennée
in with the formatting of the rest of the file. Alex Bennée (7): KVM: add commentary for kvm_debug_exit_arch struct KVM: arm: guest debug, define API headers KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl KVM: arm64: guest debug, add SW break point support KVM: arm64: guest debug, add

[PATCH 1/7] KVM: add commentary for kvm_debug_exit_arch struct

2014-11-25 Thread Alex Bennée
Bring into line with the commentary for the other structures and their KVM_EXIT_* cases. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 6076882..523f476 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h

[PATCH 7/7] KVM: arm64: guest debug, HW assisted debug support

2014-11-25 Thread Alex Bennée
on the host hardware. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 9383359..5e8c673 100644 --- a/Documentation/virtual/kvm/api.txt +++ b/Documentation/virtual/kvm/api.txt @@ -2593,7 +2593,7 @@ The top 16 bits

[PATCH 4/7] KVM: arm64: guest debug, add SW break point support

2014-11-25 Thread Alex Bennée
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 diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index 2c6386e..9383359 100644 --- a/Documentation/virtual/kvm

[PATCH 3/7] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2014-11-25 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. diff --git a/Documentation/virtual/kvm/api.txt b/Documentation

[PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-25 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 diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index 8e38878..de2450c 100644 --- a/arch/arm64/include/uapi/asm/kvm.h

[PATCH 5/7] KVM: arm64: guest debug, add support for single-step

2014-11-25 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 diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 48d26bb..a76daae 100644 --- a/arch/arm/kvm/arm.c +++ b

[PATCH 6/7] KVM: arm64: re-factor hyp.S debug register code

2014-11-25 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 diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index c0bc218..b38ce3d 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S

Re: Exposing host debug capabilities to userspace

2014-11-26 Thread Alex Bennée
capability to be used across any other architectures that need to expose this information compared to the many PPC specific capabilities. Perhaps a KVM_ARCH_EXTENSION ioctl would be more useful in reducing the growth of the space? Paolo -- Alex Bennée -- To unsubscribe from this list: send

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Alex Bennée
the exit handlers as they all pretty much do the same thing (save for the exit/syndrome related info). Again I was keeping things nicely separated in case any particular exception needed excessive special case handling. Would you like those changes? Paolo -- Alex Bennée -- To unsubscribe from

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Alex Bennée
Andrew Jones drjo...@redhat.com writes: On Tue, Nov 25, 2014 at 04:10:00PM +, Alex Bennée wrote: This commit defines the API headers for guest debugging. There are two architecture specific debug structures: snip +/* Architecture related debug defines - upper 16 bits

Re: [PATCH 3/7] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2014-11-26 Thread Alex Bennée
Andrew Jones drjo...@redhat.com writes: On Tue, Nov 25, 2014 at 04:10:01PM +, 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 patches

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-11-26 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 25 November 2014 at 16:10, Alex Bennée alex.ben...@linaro.org wrote: +/* Exit types which define why we did a debug exit */ +#define KVM_DEBUG_EXIT_ERROR 0x0 +#define KVM_DEBUG_EXIT_SINGLE_STEP 0x1 +#define

Re: [PATCH 5/7] KVM: arm64: guest debug, add support for single-step

2014-11-26 Thread Alex Bennée
Andrew Jones drjo...@redhat.com writes: On Tue, Nov 25, 2014 at 04:10:03PM +, Alex Bennée wrote: This adds support for single-stepping the guest. As userspace can and will manipulate guest registers before restarting any tweaking of the registers has to occur just before control

Re: [PATCH 2/7] KVM: arm: guest debug, define API headers

2014-12-01 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Wed, Nov 26, 2014 at 03:04:10PM +, Alex Bennée wrote: Peter Maydell peter.mayd...@linaro.org writes: On 25 November 2014 at 16:10, Alex Bennée alex.ben...@linaro.org wrote: +/* Exit types which define why we did a debug exit

Re: [PATCH 4/7] KVM: arm64: guest debug, add SW break point support

2014-12-01 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Nov 25, 2014 at 04:10:02PM +, Alex Bennée wrote: This adds support for SW breakpoints inserted by userspace. First we need to trap all BKPT exceptions in the hypervisor (ELS). This in controlled through the MDCR_EL2 register

Re: [PATCH 5/7] KVM: arm64: guest debug, add support for single-step

2014-12-01 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Nov 25, 2014 at 04:10:03PM +, Alex Bennée wrote: This adds support for single-stepping the guest. As userspace can and will manipulate guest registers before restarting any tweaking of the registers has to occur just before

Re: [PATCH 6/7] KVM: arm64: re-factor hyp.S debug register code

2014-12-01 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Nov 25, 2014 at 04:10:04PM +, Alex Bennée wrote: This is a pre-cursor to sharing the code with the guest debug support. This replaces the big macro that fishes data out of a fixed location with a more general helper macro

Re: [PATCH 7/7] KVM: arm64: guest debug, HW assisted debug support

2014-12-01 Thread Alex Bennée
Christoffer Dall christoffer.d...@linaro.org writes: On Tue, Nov 25, 2014 at 04:10:05PM +, Alex Bennée wrote: snip --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S @@ -18,6 +18,7 @@ #include linux/linkage.h #include linux/kvm.h +#include uapi/asm/kvm.h #include asm

Re: arm: warning at virt/kvm/arm/vgic.c:1468

2015-02-12 Thread Alex Bennée
Alex Bennée alex.ben...@linaro.org writes: Christoffer Dall christoffer.d...@linaro.org writes: snip On Sun, Feb 08, 2015 at 08:48:09AM +0100, Jan Kiszka wrote: snip BTW, KVM tracing support on ARM seems like it requires some care. E.g.: kvm_exit does not report an exit reason. The in-kernel

Re: arm: warning at virt/kvm/arm/vgic.c:1468

2015-02-12 Thread Alex Bennée
/kvmarm -- Alex Bennée -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH kvm-unit-tests 00/15] arm64: initial drop

2015-01-06 Thread Alex Bennée
looking at them now. -- Alex Bennée -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[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 0/5] QEMU ARM64 Migration Fixes

2015-03-16 Thread Alex Bennée
/stsquad/qemu/tree/migration/fixes-v4 Kernel: https://git.linaro.org/people/alex.bennee/linux.git/shortlog/refs/heads/migration/kvmarm-fixes-for-4.0-v3 Alex Bennée (4): target-arm: kvm: save/restore mp state hw/intc: arm_gic_kvm.c restore config first target-arm: kvm64 sync FP register state

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

2015-03-16 Thread Alex Bennée
I was getting very confused about the duplication of state so wanted to make it explicit. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 083211c..6dc1799 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -155,6 +155,11 @@ typedef

[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 -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

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 0/5] KVM ARM64 Migration Fixes

2015-03-13 Thread Alex Bennée
been working with can be found at: http://git.linaro.org/people/alex.bennee/linux.git branch: migration/kvmarm-fixes-for-4.0-v3 Alex Bennée (2): arm/arm64: KVM: export VCPU power state via MP_STATE ioctl arm/arm64: KVM: add a common vgic_queue_irq_to_lr fn Christoffer Dall (3): arm/arm64

[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 v3 2/5] arm/arm64: KVM: add a common vgic_queue_irq_to_lr fn

2015-03-13 Thread Alex Bennée
This helps re-factor away some of the repetitive code and makes the code flow more nicely. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v3 - Move to before the un-queue active patch diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 0cc6ab6..6682d58 100644 --- a/virt/kvm

[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 3/5] arm/arm64: KVM: support for un-queuing active IRQs

2015-03-13 Thread Alex Bennée
...@linaro.org Signed-off-by: Alex Bennée alex.ben...@linaro.org --- AJB: - fixed merge conflicts - moved additional shared bitmaps to be dynamically allocated - make irq_active_on_cpu dynamically allocated as well - in vgic_queue_irq don't queue pending if already active

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

2015-03-13 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

[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 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 02/10] KVM: define common __KVM_GUESTDBG_USE_SW/HW_BP values

2015-03-31 Thread Alex Bennée
-off-by: Alex Bennée alex.ben...@linaro.org 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 @@ -310,8 +310,8 @@ struct kvm_guest_debug_arch

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

2015-03-31 Thread Alex Bennée
in the mirror location - if we are using HW assisted debug we do the same with DBG[WB][CV]R 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 diff --git a/arch/arm64/include/asm/kvm_host.h b/arch

[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 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 10/10] KVM: arm64: add trace points for guest_debug debug

2015-03-31 Thread Alex Bennée
and WPT registers. I've also added a #define trace_dreg to shorten some lines. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/arch/arm64/kvm/debug.c b/arch/arm64/kvm/debug.c index 638c111..7c96288 100644 --- a/arch/arm64/kvm/debug.c +++ b/arch/arm64/kvm/debug.c @@ -25,12 +25,37

[PATCH v2 0/4] QEMU support for KVM Guest Debug on arm64

2015-03-31 Thread Alex Bennée
and can be found at: https://git.linaro.org/people/alex.bennee/linux.git branch: guest-debug/4.0-rc6-v2 Alex Bennée (4): linux-headers: partial sync from my kernel tree (DEV) target-arm: kvm - implement software breakpoints target-arm: kvm - support for single step target-arm: kvm - add

[PATCH v2 4/4] target-arm: kvm - add support for HW assisted debug

2015-03-31 Thread Alex Bennée
From: Alex Bennée a...@bennee.com This adds basic support for HW assisted debug. The ioctl interface to KVM allows us to pass an implementation defined number of break and watch point registers. When KVM_GUESTDBG_USE_HW_BP is specified these debug registers will be installed in place on the world

[PATCH v2 2/4] target-arm: kvm - implement software breakpoints

2015-03-31 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 diff --git a/target-arm/kvm.c b/target-arm/kvm.c index 72c1fa1..290c1fe 100644 --- a/target-arm/kvm.c +++ b/target-arm/kvm.c @@ -25,6 +25,7

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

2015-03-31 Thread Alex Bennée
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 the kernel. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - convert to using HSR_EC diff --git a/target-arm/kvm.c b

[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 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 03/10] KVM: arm: guest debug, define API headers

2015-03-31 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 --- v2 - expose hsr and pc directly to user-space diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/asm/kvm.h index 3ef77a4

[PATCH v2 01/10] KVM: add commentary for kvm_debug_exit_arch struct

2015-03-31 Thread Alex Bennée
Bring into line with the commentary for the other structures and their KVM_EXIT_* cases. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - add comments for other exit types diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 8055706..5eedf84 100644 --- a/include

[PATCH v2 1/4] linux-headers: partial sync from my kernel tree (DEV)

2015-03-31 Thread Alex Bennée
I assume I'll properly merge the KVM Headers direct from Linux when done. These headers came from: https://git.linaro.org/people/alex.bennee/linux.git/shortlog/refs/heads/guest-debug/4.0-rc6-v2 Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - update ABI to include -far diff --git

[PATCH v6 2/5] target-arm: kvm: save/restore mp state

2015-04-01 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

Re: [PATCH v2 03/10] KVM: arm: guest debug, define API headers

2015-04-01 Thread Alex Bennée
The type of debugging being used is control by the architecture specific s/control/controlled/ good catch control bits of the kvm_guest_debug-control flags in the ioctl structure. Signed-off-by: Alex Bennée alex.ben...@linaro.org --- v2 - expose hsr and pc directly to user-space

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

2015-03-03 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 3 March 2015 at 20:06, Paolo Bonzini pbonz...@redhat.com wrote: On 03/03/2015 11:56, Alex Bennée 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

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

2015-03-02 Thread Alex Bennée
Marc Zyngier marc.zyng...@arm.com writes: On 02/03/15 08:50, Alex Bennée wrote: Marc Zyngier marc.zyng...@arm.com writes: On Wed, 25 Feb 2015 15:36:21 + Alex Bennée alex.ben...@linaro.org wrote: Alex, Christoffer, snip So the first half of the patch looks perfectly OK to me

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

2015-03-02 Thread Alex Bennée
...@linaro.org Signed-off-by: Alex Bennée alex.ben...@linaro.org --- AJB: - fixed merge conflicts - moved additional shared bitmaps to be dynamically allocated - make irq_active_on_cpu dynamically allocated as well - in vgic_queue_irq don't queue pending if already active

[PATCH v2 3/5] arm: KVM: add a common vgic_queue_irq_to_lr fn

2015-03-02 Thread Alex Bennée
This helps re-factor away some of the repetitive code and makes the code flow more nicely. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index bfb6fbb..3b4ded2 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c @@ -263,6 +263,13

[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

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

2015-03-02 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_HALTED. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index b112efc..602156f 100644

[PATCH v2 0/5] KVM ARM64 Migration Fixes

2015-03-02 Thread Alex Bennée
at: http://git.linaro.org/people/alex.bennee/linux.git branch: migration/kvmarm-fixes-for-4.0-v2 It includes the two patches from the current kvmarm/master branch. Alex Bennée (2): arm: KVM: export vcpi-pause state via MP_STATE ioctls arm: KVM: add a common vgic_queue_irq_to_lr fn Christoffer

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

2015-03-02 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 8531536..f7fd76e 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -269,7

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

2015-03-02 Thread Alex Bennée
Marc Zyngier marc.zyng...@arm.com writes: On Wed, 25 Feb 2015 15:36:21 + Alex Bennée alex.ben...@linaro.org wrote: Alex, Christoffer, snip So the first half of the patch looks perfectly OK to me... diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index af6a521..3b4ded2 100644

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 0/6] QEMU ARM64 Migration Fixes

2015-03-04 Thread Alex Bennée
for the MP_STATE to represent powered off which I'm going to look at when I re-spin the kernel series. Branch: https://github.com/stsquad/qemu/tree/migration/fixes-v3 Alex Bennée (5): target-arm: kvm: save/restore mp state hw/intc: arm_gic_kvm.c restore config first hw/char: pl011 don't keep

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

2015-03-04 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 v2 5/6] target-arm: kvm64 fix save/restore of SPSR regs

2015-03-04 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 v2 2/6] hw/intc: arm_gic_kvm.c restore config first

2015-03-04 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 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 v2 4/6] target-arm: kvm64 sync FP register state

2015-03-04 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 diff --git a/target-arm/kvm64.c b/target-arm/kvm64.c index 8cf3a62

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

2015-03-03 Thread Alex Bennée
Peter Maydell peter.mayd...@linaro.org writes: On 26 February 2015 at 01:02, 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

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

2015-03-03 Thread Alex Bennée
+, Alex Bennée wrote: From: Christoffer Dall christoffer.d...@linaro.org The current code was negatively indexing the cpu state array and not synchronizing banked spsr register state with the current mode's spsr state, causing occasional failures with migration. Some munging is done

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

2015-02-25 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 0/6] QEMU ARM64 Migration Fixes

2015-02-25 Thread Alex Bennée
triggered interrupt lines. And the cpu.h documentation was for my own sanity. Cheers, Alex. Alex Bennée (5): target-arm: kvm: save/restore mp state arm_gic_kvm.c: restore config before pending IRQs hw/char/pl011: don't keep setting the IRQ if nothing changed target-arm/kvm64.c: sync FP

[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/4] arm/arm64: KVM: Implement support for unqueueing active IRQs

2015-02-25 Thread Alex Bennée
...@linaro.org Signed-off-by: Alex Bennée alex.ben...@linaro.org --- AJB: - fixed merge conflicts - moved additional shared bitmaps to be dynamically allocated - make irq_active_on_cpu dynamically allocated as well - in vgic_queue_irq don't queue pending if already active

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

2015-02-25 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_HALTED. Signed-off-by: Alex Bennée alex.ben...@linaro.org diff --git a/Documentation/virtual/kvm/api.txt b/Documentation/virtual/kvm/api.txt index b112efc..602156f 100644

  1   2   3   >