Re: [PATCH] arm64: KVM: debug: Remove spurious inline attributes

2015-12-17 Thread Alex Bennée
Marc Zyngier writes: > On 17/12/15 16:28, Alex Bennée wrote: >> >> Marc Zyngier writes: >> >>> The debug trapping code is pretty heavy on the "inline" attribute, >>> but most functions are actually referenced in the sysreg tables, >>> m

Re: [PATCH] arm64: KVM: debug: Remove spurious inline attributes

2015-12-17 Thread Alex Bennée
ing verified that the output code is similar. > > Cc: Alex Bennée > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/sys_regs.c | 58 > +++ > 1 file changed, 29 insertions(+), 29 deletions(-) > > diff --git a/arch/arm64/kvm

Re: [PATCH v3 4/4] VSOCK: Add Makefile and Kconfig

2015-12-11 Thread Alex Bennée
elp > + This module implements a virtio transport for Virtual Sockets. > + > + Enable this transport if your Virtual Machine runs on > Qemu/KVM. Is this better worded as: "Enable this transport if your Virtual Machine host supports vsockets over virtio.

Re: [PATCH v3 3/4] VSOCK: Introduce vhost-vsock.ko

2015-12-11 Thread Alex Bennée
et_init, > + .destruct = virtio_transport_destruct, > + .release = virtio_transport_release, > + .connect = virtio_transport_connect, > + .shutdown = virtio_transport_shutdown, > + > + .dgram_e

Re: [PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko

2015-12-10 Thread Alex Bennée
virtio_transport_recv_pkt_work); > + INIT_WORK(&vsock->tx_work, virtio_transport_send_pkt_work); > + > + mutex_lock(&vsock->rx_lock); > + virtio_vsock_rx_fill(vsock); > + mutex_unlock(&vsock->rx_lock); > + > + mutex_unlock(&the_virti

Re: [PATCH v3 1/4] VSOCK: Introduce virtio-vsock-common.ko

2015-12-10 Thread Alex Bennée
virtio_transport_send_reset(vsk, pkt); > + return -ENOMEM; > + } > + > + pr_debug("%s: create pending\n", __func__); > + child = __vsock_create(sock_net(sk), NULL, sk, GFP_KERNEL, > +sk->sk_type, 0); > +

[PATCH v10 2/6] target-arm: kvm - implement software breakpoints

2015-12-08 Thread Alex Bennée
returns to userspace. Signed-off-by: Alex Bennée -- 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 v9 - add include for

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

2015-12-08 Thread Alex Bennée
is actually capable of more advanced matching but it is unclear if this expressiveness is available via the gdbstub protocol. Signed-off-by: Alex Bennée --- v2 - correct setting of PMC/BAS/MASK - improved commentary - added helper function to check watchpoint in range - fix find/deletion

[PATCH v10 6/6] tests/guest-debug: introduce basic gdbstub tests

2015-12-08 Thread Alex Bennée
s architectures. Signed-off-by: Alex Bennée --- v10: - fixup for Py2/3 cleanliness - drop to shell on exception --- tests/guest-debug/test-gdbstub.py | 176 ++ 1 file changed, 176 insertions(+) create mode 100644 tests/guest-debug/test-gdbstub.py diff --git a/te

[PATCH v10 3/6] target-arm: kvm - support for single step

2015-12-08 Thread Alex Bennée
;t support guest debug the ioctl will simply error. Signed-off-by: Alex Bennée --- v2 - convert to using HSR_EC v3 - use internals.h definitions v10 - fix arm32 build - remove redundent flag setting (done in main kvm.c) - more words on fail case --- target-arm/kvm64.c | 7 +++ 1 file

[PATCH v10 5/6] target-arm: kvm - re-inject guest debug exceptions

2015-12-08 Thread Alex Bennée
can't handle the guest using single step as we will keep trapping to back to userspace. GDB makes heavy use of single-step behind the scenes which effectively means the guests ability to debug itself is disabled while it is being debugged. Signed-off-by: Alex Bennée --- v5: - new for v5 v1

[PATCH v10 1/6] target-arm: kvm64 - introduce kvm_arm_init_debug()

2015-12-08 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 --- target-arm/kvm64.c | 18 ++ 1 file changed, 18 insertions(+

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

2015-12-08 Thread Alex Bennée
ug capability checks - Whitespace and comment cleanups - Py2/3 cleanliness for test script More detailed changelogs are attached to each patch. GIT Repo: The patch series is based off a recent master and can be found at: https://github.com/stsquad/qemu branch: kvm/guest-debug-v10 Alex Benn

Re: [PATCH v9 6/6] tests/guest-debug: introduce basic gdbstub tests

2015-12-08 Thread Alex Bennée
Peter Maydell writes: > On 12 November 2015 at 16:20, Alex Bennée wrote: >> From: Alex Bennée >> >> The aim of these tests is to combine with an appropriate kernel >> image (with symbol-file vmlinux) and check it behaves as it should. >> Given a kernel

Re: [PATCH v9 3/6] target-arm: kvm - support for single step

2015-12-08 Thread Alex Bennée
Peter Maydell writes: > On 12 November 2015 at 16:20, Alex Bennée 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 the kernel. >&g

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-12-01 Thread Alex Bennée
t; KVM_ARM64_DEBUG_DIRTY, just like we have skip_debug_state on all actions > involving the save/restore in the assembly version. > >> in any case, I feel some context is lost when this is moved away from >> assembly and understanding this patch would be easier if the semantics >

Re: [PATCH 2/2] KVM: Create debugfs dir and stat files for each VM

2015-11-30 Thread Alex Bennée
he arch initialization indirectly > calls kvm_arm_create_scratch_host_vcpu and that's where the > trouble begins, as it also creates a VM. > > My assumption was, that nobody would create multiple VMs under > the same PID. Christian and I are working on a solution on kernel > si

Re: [PATCH v2 08/21] arm64: KVM: Implement debug save/restore

2015-11-30 Thread Alex Bennée
kvm_cpu_context *ctxt); > void __sysreg32_save_state(struct kvm_vcpu *vcpu); > void __sysreg32_restore_state(struct kvm_vcpu *vcpu); > > +void __debug_save_state(struct kvm_vcpu *vcpu, > + struct kvm_guest_debug_arch *dbg, > + struct k

Re: [PATCH v2 04/21] arm64: KVM: Implement vgic-v3 save/restore

2015-11-30 Thread Alex Bennée
+ write_gicreg(cpu_if->vgic_lr[LR_OFFSET(5)], ICH_LR5_EL2); > + case 4: > + write_gicreg(cpu_if->vgic_lr[LR_OFFSET(4)], ICH_LR4_EL2); > + case 3: > + write_gicreg(cpu_if->vgic_lr[LR_OFFSET(3)], ICH_LR3_EL2); > + case 2: > +

Re: [PATCH 11/21] arm64: KVM: Implement the core world switch

2015-11-24 Thread Alex Bennée
+ > + /* Jump in the fire! */ > + exit_code = __guest_enter(vcpu, host_ctxt); > + /* And we're baaack! */ > + > + __sysreg_save_state(guest_ctxt); > + __sysreg32_save_state(vcpu); > + __timer_save_state(vcpu); > + __vgic_save_state(vcpu); > + > + __deactivate_traps(vcpu); > + __deactivate_vm(vcpu); > + > + __sysreg_restore_state(host_ctxt); > + > + __debug_save_state(vcpu, &vcpu->arch.vcpu_debug_state, guest_ctxt); > + __debug_clear_restore_state(vcpu, &vcpu->arch.host_debug_state, > host_ctxt); > + > + return exit_code; > +} -- 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 v9 1/6] target-arm: kvm64 - introduce kvm_arm_init_debug()

2015-11-20 Thread Alex Bennée
Peter Maydell writes: > On 20 November 2015 at 15:05, Peter Maydell wrote: >> On 12 November 2015 at 16:20, Alex Bennée wrote: >>> 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 capa

[PATCH v9 5/6] target-arm: kvm - re-inject guest debug exceptions

2015-11-12 Thread Alex Bennée
From: Alex Bennée If we can't find details for the debug exception in our debug state then we can assume the exception is due to debugging inside the guest. To inject the exception into the guest state we re-use the TCG exception code (do_interupt). However while guest debugging is in effe

[PATCH v9 3/6] target-arm: kvm - support for single step

2015-11-12 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 --- v2 - convert to using HSR_EC v3 - use internals.h definitions --- targe

[PATCH v9 2/6] target-arm: kvm - implement software breakpoints

2015-11-12 Thread Alex Bennée
returns to userspace. Signed-off-by: Alex Bennée -- 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 v9 - add include for

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

2015-11-12 Thread Alex Bennée
ch. GIT Repo: The patch series is based off a recent master and can be found at: https://github.com/stsquad/qemu branch: kvm/guest-debug-v9 Alex Bennée (6): target-arm: kvm64 - introduce kvm_arm_init_debug() target-arm: kvm - implement software breakpoints target-arm: kvm - support for

[PATCH v9 6/6] tests/guest-debug: introduce basic gdbstub tests

2015-11-12 Thread Alex Bennée
From: Alex Bennée The aim of these tests is to combine with an appropriate kernel image (with symbol-file vmlinux) and check it behaves as it should. Given a kernel it checks: - single step - software breakpoint - hardware breakpoint - access, read and write watchpoints On success it

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

2015-11-12 Thread Alex Bennée
is actually capable of more advanced matching but it is unclear if this expressiveness is available via the gdbstub protocol. Signed-off-by: Alex Bennée --- v2 - correct setting of PMC/BAS/MASK - improved commentary - added helper function to check watchpoint in range - fix find/deletion

[PATCH v9 1/6] target-arm: kvm64 - introduce kvm_arm_init_debug()

2015-11-12 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 --- target-arm/kvm64.c | 18 ++ 1 file changed, 18 insertions(+

Re: [Qemu-devel] [RFC PATCH v2] os-android: Add support to android platform

2015-09-20 Thread Alex Bennée
mios *termp, struct winsize *winp) > { > +#if defined(CONFIG_ANDROID) > +char pty_buf[PATH_MAX]; > +#define ptsname(fd) pty_buf > +#endif Indentation not consistent with the rest of the function. > const char *slave; > int mfd = -1, sfd = -1; >

Re: [PATCH] arm64: KVM: Fix user access for debug registers

2015-09-16 Thread Alex Bennée
think. >> >> Reported-by: Peter Maydell >> Cc: Alex Bennée >> Fixes: 84e690bfbed1 ("KVM: arm64: introduce vcpu->arch.debug_ptr") >> Signed-off-by: Marc Zyngier > > yikes! OK I'm now muchly confused as to how it could have worked... > >

Re: [PATCH] arm64: KVM: Fix user access for debug registers

2015-09-16 Thread Alex Bennée
way have a: Reviewed-by: Alex Bennée > > Reported-by: Peter Maydell > Cc: Alex Bennée > Fixes: 84e690bfbed1 ("KVM: arm64: introduce vcpu->arch.debug_ptr") > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/sys_regs.c | 8 > 1 file changed, 4

Re: [Qemu-devel] Help debugging a regression in KVM Module

2015-08-14 Thread Alex Bennée
ay. However you can tell bisect which parts of the tree you car about: git bisect start -- arch/arm64/kvm include/linux/kvm* include/uapi/linux/kvm* virt/kvm/ > > Thanks, > Peter -- Alex Bennée -- To unsubscribe from this list: send the line "unsubscribe kvm" in t

Re: [kvm-unit-tests PATCH 3/3] arm/run: use ACCEL to choose between kvm and tcg

2015-08-06 Thread Alex Bennée
Andrew Jones writes: > Inspired by a patch by Alex Bennée. This version uses a new > unittests.cfg variable and includes support for DRYRUN. > > Signed-off-by: Andrew Jones > --- > > Another difference with Alex's patch is we no longer output > 'Runnin

Re: [kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-08-04 Thread Alex Bennée
alvise rigo writes: > On Mon, Aug 3, 2015 at 6:06 PM, Alex Bennée wrote: > >> >> alvise rigo writes: >> >> > On Mon, Aug 3, 2015 at 12:30 PM, Alex Bennée >> wrote: >> >> >> >> alvise rigo writes: >> >> >

Re: [kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-08-03 Thread Alex Bennée
alvise rigo writes: > On Mon, Aug 3, 2015 at 12:30 PM, Alex Bennée wrote: >> >> alvise rigo writes: >> >>> Hi Alex, >>> >>> Nice set of tests, they are proving to be helpful. >>> One question below. >>> >>&

Re: [kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-08-03 Thread Alex Bennée
alvise rigo writes: > Hi Alex, > > Nice set of tests, they are proving to be helpful. > One question below. > > On Fri, Jul 31, 2015 at 5:54 PM, Alex Bennée wrote: >> From: Alex Bennée >> >> This test has been written mainly to stress multi-threaded T

[kvm-unit-tests PATCH v5 04/11] arm/run: introduce usingkvm var and use it

2015-07-31 Thread Alex Bennée
This makes the script a little cleaner by only checking for KVM support in one place. If KVM isn't available we can fall back to TCG emulation and echo the fact to the screen rather than let QEMU complain. Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones --- v2 - rm redund

[kvm-unit-tests PATCH v5 09/11] arm: query /dev/kvm for maximum vcpus

2015-07-31 Thread Alex Bennée
From: Alex Bennée The previous $(getconf _NPROCESSORS_CONF) isn't correct as the default maximum VCPU configuration is 4 on arm64 machines which typically have more actual cores. This introduces a simple utility program to query the KVM capabilities and use the correct maximum number of

[kvm-unit-tests PATCH v5 00/11] My current MTTCG tests

2015-07-31 Thread Alex Bennée
Alvise's atomic patch set. I suspect the load/store ordering issues will show up better once tested on a weak-ordered backend. I'm open to suggestions for other tests worth adding to show up the issues. The github tree can be found at: https://github.com/stsquad/kvm-unit-tests/tree/cu

[kvm-unit-tests PATCH v5 03/11] configure: emit HOST=$host to config.mak

2015-07-31 Thread Alex Bennée
This is useful information for the run scripts to know, especially if they want to drop to using TCG. Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones --- v3 - add r-b tag --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index b2ad32a..078b70c

[kvm-unit-tests PATCH v5 06/11] lib/arm: add flush_tlb_page mmu function

2015-07-31 Thread Alex Bennée
This introduces a new flush_tlb_page function which does exactly what you expect. It's going to be useful for the future TLB torture test. Signed-off-by: Alex Bennée --- lib/arm/asm/mmu.h | 11 +++ lib/arm64/asm/mmu.h | 8 2 files changed, 19 insertions(+) diff --git

[kvm-unit-tests PATCH v5 08/11] arm/unittests.cfg: add the tlbflush tests

2015-07-31 Thread Alex Bennée
--- arm/unittests.cfg | 24 1 file changed, 24 insertions(+) diff --git a/arm/unittests.cfg b/arm/unittests.cfg index ee655b2..19d72ad 100644 --- a/arm/unittests.cfg +++ b/arm/unittests.cfg @@ -35,3 +35,27 @@ file = selftest.flat smp = $(getconf _NPROCESSORS_CONF) extra

[kvm-unit-tests PATCH v5 07/11] new arm/tlbflush-test: TLB torture test

2015-07-31 Thread Alex Bennée
: - "page" flush each page in turn (one per function) - "self" do the flush after each computation cycle - "verbose" report progress on each computation cycle Signed-off-by: Alex Bennée --- v2 - rename to tlbflush-test - made makefile changes cleaner - added se

[kvm-unit-tests PATCH v5 02/11] README: add some CONTRIBUTING notes

2015-07-31 Thread Alex Bennée
Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones --- v2 - mention consistency v3 - add r-b tag --- README | 26 ++ 1 file changed, 26 insertions(+) diff --git a/README b/README index e9869d1..9389a26 100644 --- a/README +++ b/README @@ -25,3 +25,29 @@ Directory

[kvm-unit-tests PATCH v5 05/11] lib/printf: support the %u unsigned fmt field

2015-07-31 Thread Alex Bennée
--- lib/printf.c | 13 + 1 file changed, 13 insertions(+) diff --git a/lib/printf.c b/lib/printf.c index 89308fb..5d83605 100644 --- a/lib/printf.c +++ b/lib/printf.c @@ -180,6 +180,19 @@ int vsnprintf(char *buf, int size, const char *fmt, va_list va) break;

[kvm-unit-tests PATCH v5 01/11] arm/run: set indentation defaults for emacs

2015-07-31 Thread Alex Bennée
Signed-off-by: Alex Bennée --- arm/run | 1 + 1 file changed, 1 insertion(+) diff --git a/arm/run b/arm/run index 662a856..6b42a2e 100755 --- a/arm/run +++ b/arm/run @@ -1,4 +1,5 @@ #!/bin/bash +# -*- sh-basic-offset:8 indent-tabs-mode: t -*- if [ ! -f config.mak ]; then echo run

[kvm-unit-tests PATCH v5 11/11] new: arm/barrier-test for memory barriers

2015-07-31 Thread Alex Bennée
From: Alex Bennée This test has been written mainly to stress multi-threaded TCG behaviour but will demonstrate failure by default on real hardware. The test takes the following parameters: - "lock" use GCC's locking semantics - "excl" use load/store exclusive s

Re: [kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-31 Thread Alex Bennée
> +M: Marcelo Tosatti >> +L: kvm@vger.kernel.org >> +F: x86/* >> +F: lib/x86/* I haven't seen this upstream yet. Has this been pushed yet? -- 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: [kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-29 Thread Alex Bennée
Christoffer Dall writes: > On Tue, Jul 28, 2015 at 2:51 PM, Marc Zyngier wrote: >> On 28/07/15 13:44, Andrew Jones wrote: >>> On Tue, Jul 28, 2015 at 12:41:38PM +0100, Alex Bennée wrote: >>>> >>>> Paolo Bonzini writes: >>>> >>>

Re: [kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-28 Thread Alex Bennée
Paolo Bonzini writes: > On 28/07/2015 10:56, Alex Bennée wrote: >> +Architecture Specific Code: >> +--- >> + >> +ARM >> +M: Christoffer Dall >> +L: linux-arm-ker...@lists.infradead.org (moderated for non-subscribers) >>

[kvm-unit-tests RFC PATCH] Add MAINTAINERS file

2015-07-28 Thread Alex Bennée
This may be overkill for a project as small as the unit tests now but perhaps it pays to be explicit? Signed-off-by: Alex Bennée --- MAINTAINERS | 67 + 1 file changed, 67 insertions(+) create mode 100644 MAINTAINERS diff --git a

Re: [kvm-unit-tests PATCH v4 0/3] A couple of small fixes

2015-07-27 Thread Alex Bennée
Alex Bennée writes: > One minor fix for quote usage and added a final r-b tag from Drew. > > Please apply Ping. Do I need to get anyone in particular to commit this. I notice we don't list any particular maintainers with commit rights. > > Alex Bennée (3): > README

Re: [kvm-unit-tests RFC PATCH] arm/tlbflush.c: TLB flushing torture test [DEV]

2015-07-27 Thread Alex Bennée
Andrew Jones writes: > On Fri, Jul 24, 2015 at 02:25:06PM +0100, Alex Bennée wrote: >> This adds a fairly brain dead torture test for TLB flushes intended for >> stressing the MTTCG QEMU build. It takes the usual -smp option for >> multiple CPUs. >> >> By d

[kvm-unit-tests RFC PATCH] arm/tlbflush.c: TLB flushing torture test [DEV]

2015-07-24 Thread Alex Bennée
ach of the computation functions. At the moment it doesn't do any re-mapping of pages but maybe that is something that could be done in the future. [DEV VERSION FOR COMMENT] Signed-off-by: Alex Bennée --- arm/tlbflush.c | 163 +++ co

[kvm-unit-tests PATCH v4 2/3] configure: emit HOST=$host to config.mak

2015-07-22 Thread Alex Bennée
This is useful information for the run scripts to know, especially if they want to drop to using TCG. Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones --- v3 - add r-b tag --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index b2ad32a..078b70c

[kvm-unit-tests PATCH v4 0/3] A couple of small fixes

2015-07-22 Thread Alex Bennée
One minor fix for quote usage and added a final r-b tag from Drew. Please apply Alex Bennée (3): README: add some CONTRIBUTING notes configure: emit HOST=$host to config.mak arm/run: introduce usingkvm var and use it README| 26 ++ arm/run | 18

[kvm-unit-tests PATCH v4 3/3] arm/run: introduce usingkvm var and use it

2015-07-22 Thread Alex Bennée
This makes the script a little cleaner by only checking for KVM support in one place. If KVM isn't available we can fall back to TCG emulation and echo the fact to the screen rather than let QEMU complain. Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones --- v2 - rm redund

[kvm-unit-tests PATCH v4 1/3] README: add some CONTRIBUTING notes

2015-07-22 Thread Alex Bennée
Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones --- v2 - mention consistency v3 - add r-b tag --- README | 26 ++ 1 file changed, 26 insertions(+) diff --git a/README b/README index e9869d1..9389a26 100644 --- a/README +++ b/README @@ -25,3 +25,29 @@ Directory

[kvm-unit-tests PATCH v3 2/3] configure: emit HOST=$host to config.mak

2015-07-08 Thread Alex Bennée
This is useful information for the run scripts to know, especially if they want to drop to using TCG. Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones --- v3 - add r-b tag --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index b2ad32a..078b70c

[kvm-unit-tests PATCH v3 3/3] arm/run: introduce usingkvm var and use it

2015-07-08 Thread Alex Bennée
This makes the script a little cleaner by only checking for KVM support in one place. If KVM isn't available we can fall back to TCG emulation and echo the fact to the screen rather than let QEMU complain. Signed-off-by: Alex Bennée --- v2 - rm redundant M= statement v3 - make usingkv

[kvm-unit-tests PATCH v3 0/3] A couple of small fixes

2015-07-08 Thread Alex Bennée
A few more tweaks following review comments. I've added the r-b tags where given and squashed patches 3/4 together. Alex Bennée (3): README: add some CONTRIBUTING notes configure: emit HOST=$host to config.mak arm/run: introduce usingkvm var and use it README

[kvm-unit-tests PATCH v3 1/3] README: add some CONTRIBUTING notes

2015-07-08 Thread Alex Bennée
Signed-off-by: Alex Bennée Reviewed-by: Andrew Jones --- v2 - mention consistency v3 - add r-b tag --- README | 26 ++ 1 file changed, 26 insertions(+) diff --git a/README b/README index e9869d1..9389a26 100644 --- a/README +++ b/README @@ -25,3 +25,29 @@ Directory

[PATCH v8 03/11] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-07-07 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 . Reviewed-by: Christoffer Dall --- v2 - simplified form o

[PATCH v8 01/11] KVM: add comments for kvm_debug_exit_arch struct

2015-07-07 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 Reviewed-by: David Hildenbrand Reviewed-by: Andrew Jones Acked-by: Christoffer Dall --- v2 - add comments for

[PATCH v8 05/11] KVM: arm64: guest debug, add SW break point support

2015-07-07 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 Reviewed-by: Christoffer Dall --- v2 - update to use new exit struct - tweak for C setup - do

[PATCH v8 00/11] KVM Guest Debug support for arm64

2015-07-07 Thread Alex Bennée
5faB QEMU: https://github.com/stsquad/qemu branch: kvm/guest-debug-v6*** BLURB HERE *** Alex Bennée (11): KVM: add comments for kvm_debug_exit_arch struct KVM: arm64: guest debug, define API headers KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl KVM: arm: introduce kvm_arm_

[PATCH v8 08/11] KVM: arm64: introduce vcpu->arch.debug_ptr

2015-07-07 Thread Alex Bennée
the generic code when needed. Signed-off-by: Alex Bennée --- v6: - fix up some ws issues - correct clobber info - re-word commentary in kvm_host.h - fix endian access issues for aarch32 fields - revert all KVM_GET/SET_ONE_REG to 64bit (also see ABI update) v7 - new fn kvm_arm_reset_debug_

[PATCH v8 02/11] KVM: arm64: guest debug, define API headers

2015-07-07 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 Reviewed-by: David Hildenbrand Reviewed-by: Andrew Jones Acked-by: Christoffer Dall --- v2 - expose hsr and pc directly to user-space v3 - s/cont

[PATCH v8 04/11] KVM: arm: introduce kvm_arm_init/setup/clear_debug

2015-07-07 Thread Alex Bennée
bit from 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 Reviewed-by: Christoffer Dall --- v3 - rename fns from arch->arm - preserve MDCR_EL2.HPMN setting - re-word some of the comments - fix some minor g

[PATCH v8 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-07 Thread Alex Bennée
NSION 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 Reviewed-by: Christoffer Dall --- v2 - switched to C setup - replace host debug registers directly into context - minor tweak to api docs -

[PATCH v8 10/11] KVM: arm64: enable KVM_CAP_SET_GUEST_DEBUG

2015-07-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 Acked-by: Christoffer Dall --- v3: - separated capability check from previous patches - moved into arm64

[PATCH v8 11/11] KVM: arm64: add trace points for guest_debug debug

2015-07-07 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 --- v3 - add trace event for debug a

[PATCH v8 07/11] KVM: arm64: re-factor hyp.S debug register code

2015-07-07 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 Reviewed-by: Christoffer Dall --- v3: - return to the patch series - add save and restore targets - change register use and document v4: - keep original setup

[PATCH v8 06/11] KVM: arm64: guest debug, add support for single-step

2015-07-07 Thread Alex Bennée
d in the kernel. Once the host is no longer debugging the guest its ability to single-step userspace is restored. Signed-off-by: Alex Bennée Reviewed-by: Christoffer Dall --- v2 - Move pstate/mdscr manipulation into C - don't export guest_debug to assembly - add accessor for saved_debug

[kvm-unit-tests PATCH v2 2/4] configure: emit HOST=$host to config.mak

2015-07-07 Thread Alex Bennée
This is useful information for the run scripts to know, especially if they want to drop to using TCG. Signed-off-by: Alex Bennée --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index b2ad32a..078b70c 100755 --- a/configure +++ b/configure @@ -7,6 +7,7

[kvm-unit-tests PATCH v2 3/4] arm/run: introduce usingkvm var and use it

2015-07-07 Thread Alex Bennée
This makes the script a little cleaner by only checking for KVM support in one place. Signed-off-by: Alex Bennée --- arm/run | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arm/run b/arm/run index 6b42a2e..493ce0d 100755 --- a/arm/run +++ b/arm/run @@ -8,6 +8,16

[kvm-unit-tests PATCH v2 0/4] A couple of small fixes

2015-07-07 Thread Alex Bennée
I dropped the option parsing stuff which can be achieved by just appending QEMU args to the end of the command line. I've also addressed comments as suggested. Alex Bennée (4): README: add some CONTRIBUTING notes configure: emit HOST=$host to config.mak arm/run: introduce usingkvm va

[kvm-unit-tests PATCH v2 1/4] README: add some CONTRIBUTING notes

2015-07-07 Thread Alex Bennée
Signed-off-by: Alex Bennée --- v2 - mention consistency --- README | 26 ++ 1 file changed, 26 insertions(+) diff --git a/README b/README index e9869d1..9389a26 100644 --- a/README +++ b/README @@ -25,3 +25,29 @@ Directory structure: ./: the sources of the tests

[kvm-unit-tests PATCH v2 4/4] arm/run: clean-up setting of accel options

2015-07-07 Thread Alex Bennée
It would be nice to use --no-kvm but that flags a warning on pure-TCG builds. We echo the fact we are using TCG for the benefit of interactive use. Signed-off-by: Alex Bennée --- v2 - rm redundant M= statement --- arm/run | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff

Re: [kvm-unit-tests PATCH 7/7] arm/run: add --debug option

2015-07-06 Thread Alex Bennée
Andrew Jones writes: > On Fri, Jul 03, 2015 at 02:48:47PM +0100, Alex Bennée wrote: >> This allows you to pass debug options through to the QEMU command line. >> e.g.: >> >> ./arm/run --debug "-name debug-threads=on" -- arm/vos-spinlock-test.flat >

Re: [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-06 Thread Alex Bennée
Will Deacon writes: > On Fri, Jul 03, 2015 at 05:07:41PM +0100, Alex Bennée wrote: >> Will Deacon writes: >> > On Thu, Jul 02, 2015 at 02:50:33PM +0100, Alex Bennée wrote: >> >> Are you happy with this?: >> > >> > [...] >> >

Re: [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-03 Thread Alex Bennée
Will Deacon writes: > Hi Alex, > > On Thu, Jul 02, 2015 at 02:50:33PM +0100, Alex Bennée wrote: >> Are you happy with this?: > > [...] > >> +/** >> + * kvm_arch_dev_ioctl_check_extension >> + * >> + * We currently assume that the number of HW

[kvm-unit-tests PATCH 7/7] arm/run: add --debug option

2015-07-03 Thread Alex Bennée
This allows you to pass debug options through to the QEMU command line. e.g.: ./arm/run --debug "-name debug-threads=on" -- arm/vos-spinlock-test.flat -smp 4 Signed-off-by: Alex Bennée --- arm/run | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arm/run

[kvm-unit-tests PATCH 6/7] arm/run: introduce basic option parsing

2015-07-03 Thread Alex Bennée
So far this simple option parsing loop allows us to --force-tcg even when running on ARM hardware. Signed-off-by: Alex Bennée --- arm/run | 17 + 1 file changed, 17 insertions(+) diff --git a/arm/run b/arm/run index a3a33b3..43d7508 100755 --- a/arm/run +++ b/arm/run @@ -18,6

[kvm-unit-tests PATCH 5/7] arm/run: clean-up setting of accel options

2015-07-03 Thread Alex Bennée
It would be nice to use --no-kvm but that flags a warning on pure-TCG builds. We echo the fact we are using TCG for the benefit of interactive use. Signed-off-by: Alex Bennée --- arm/run | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/arm/run b/arm/run index 493ce0d

[kvm-unit-tests PATCH 2/7] configure: emit HOST=$host to config.mak

2015-07-03 Thread Alex Bennée
This is useful information for the run scripts to know, especially if they want to drop to using TCG. Signed-off-by: Alex Bennée --- configure | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure b/configure index b2ad32a..078b70c 100755 --- a/configure +++ b/configure @@ -7,6 +7,7

[kvm-unit-tests PATCH 3/7] arm/run: set indentation defaults for emacs

2015-07-03 Thread Alex Bennée
Signed-off-by: Alex Bennée --- arm/run | 1 + 1 file changed, 1 insertion(+) diff --git a/arm/run b/arm/run index 662a856..6b42a2e 100755 --- a/arm/run +++ b/arm/run @@ -1,4 +1,5 @@ #!/bin/bash +# -*- sh-basic-offset:8 indent-tabs-mode: t -*- if [ ! -f config.mak ]; then echo run

[kvm-unit-tests PATCH 0/7] A number of small arm/run fixes

2015-07-03 Thread Alex Bennée
Following on from yesterdays comments I've re-spun the changes as suggested. I've also added a very simple opt parsing for arm/run to allow us to --force-tcg and --debug "more qemu cmdline". As a bonus I've codified some notes for contributing into the README. Alex Ben

[kvm-unit-tests PATCH 1/7] READ: add some CONTRIBUTING notes

2015-07-03 Thread Alex Bennée
Signed-off-by: Alex Bennée --- README | 22 ++ 1 file changed, 22 insertions(+) diff --git a/README b/README index e9869d1..4001456 100644 --- a/README +++ b/README @@ -25,3 +25,25 @@ Directory structure: ./: the sources of the tests and the created objects/images

[kvm-unit-tests PATCH 4/7] run/arm: introduce usingkvm var and use it

2015-07-03 Thread Alex Bennée
This makes it easier to force KVM off in later patches. Signed-off-by: Alex Bennée --- arm/run | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/arm/run b/arm/run index 6b42a2e..493ce0d 100755 --- a/arm/run +++ b/arm/run @@ -8,6 +8,16 @@ fi source config.mak

Re: [PATCH] arm/run: don't enable KVM if system can't do it

2015-07-03 Thread Alex Bennée
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 -- 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 v7 08/11] KVM: arm64: introduce vcpu->arch.debug_ptr

2015-07-03 Thread Alex Bennée
Christoffer Dall writes: > On Wed, Jul 01, 2015 at 07:29:00PM +0100, Alex Bennée wrote: >> This introduces a level of indirection for the debug registers. Instead >> of using the sys_regs[] directly we store registers in a structure in >> the vcpu. The new kvm_arm_reset

Re: [PATCH v7 09/11] KVM: arm64: guest debug, HW assisted debug support

2015-07-02 Thread Alex Bennée
sters to enable the exceptions so we need to save and restore those bits. Two new capabilities have been added 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 Reviewed-by: Christoffer

Re: [PATCH] arm/run: don't enable KVM if system can't do it

2015-07-02 Thread Alex Bennée
Andrew Jones writes: > On Thu, Jul 02, 2015 at 12:05:31PM +0100, Alex Bennée wrote: >> As ARM (and no doubt other systems) can also run tests in pure TCG mode >> we might as well not bother enabling accel=kvm if we aren't on a real >> ARM based system. This preve

[PATCH] arm/run: don't enable KVM if system can't do it

2015-07-02 Thread Alex Bennée
As ARM (and no doubt other systems) can also run tests in pure TCG mode we might as well not bother enabling accel=kvm if we aren't on a real ARM based system. This prevents us seeing ugly warning messages when testing TCG. Signed-off-by: Alex Bennée --- arm/run | 8 +++- 1 file chang

[PATCH v7 02/11] KVM: arm64: guest debug, define API headers

2015-07-01 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 Reviewed-by: David Hildenbrand Reviewed-by: Andrew Jones Acked-by: Christoffer Dall --- v2 - expose hsr and pc directly to user-space v3 - s/cont

[PATCH v7 00/11] KVM Guest Debug support for arm64

2015-07-01 Thread Alex Bennée
his series are based off v4.1 and can be found at: Kernel: https://git.linaro.org/people/alex.bennee/linux.git branch: guest-debug/4.1-v7 describe: v4.1-11-g2a10438 QEMU: https://github.com/stsquad/qemu branch: kvm/guest-debug-v6 Alex Bennée (11): KVM: add comments for kvm_debug_exit_arch st

[PATCH v7 07/11] KVM: arm64: re-factor hyp.S debug register code

2015-07-01 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 Reviewed-by: Christoffer Dall --- v3: - return to the patch series - add save and restore targets - change register use and document v4: - keep original setup

[PATCH v7 03/11] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-07-01 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 . Reviewed-by: Christoffer Dall --- v2 - simplified form o

[PATCH v7 08/11] KVM: arm64: introduce vcpu->arch.debug_ptr

2015-07-01 Thread Alex Bennée
: Alex Bennée --- v6: - fix up some ws issues - correct clobber info - re-word commentary in kvm_host.h - fix endian access issues for aarch32 fields - revert all KVM_GET/SET_ONE_REG to 64bit (also see ABI update) v7 - new fn kvm_arm_reset_debug_ptr(), stubbed for arm - split trap

  1   2   3   >