Re: [PATCH kvm-unit-tests 00/10] report is nice, use it more

2014-12-12 Thread Andrew Jones
On Fri, Dec 12, 2014 at 05:06:07PM +0100, Andrew Jones wrote: This series applies report() to more x86 unit tests. It also cleans up some uses of it in vmx_tests. Finally, it also introduces report prefix support, and applies that a few places. There should be no functional changes

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

2014-12-10 Thread Andrew Jones
to the minimal drop 10-12: Prep the arm framework for enabling the mmu on aarch64 13-14: Prep the aarch64 framework for enabling the mmu 15 : Enables the mmu on aarch64 These patches are also available here https://github.com/rhdrjones/kvm-unit-tests/tree/arm64/initial-drop Thanks, drew Andrew

[PATCH 15/15] arm64: enable mmu

2014-12-10 Thread Andrew Jones
Implement asm_mmu_enable and flush_tlb_all, and then make a final change to mmu.c in order to link it into arm64. The final change is to map the code read-only. This is necessary because armv8 forces all writable code shared between EL1 and EL0 to be PXN. Signed-off-by: Andrew Jones drjo

[PATCH 04/15] Makefile: cscope may need to look in lib/$ARCH

2014-12-10 Thread Andrew Jones
When $ARCH != $TEST_DIR we should look there too. This patch cheats though and makes cscope always look there, but then gets rid of the duplicates generated when $ARCH == $TEST_DIR. Signed-off-by: Andrew Jones drjo...@redhat.com --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions

[PATCH 07/15] arm: selftest: rename svc mode to kernel mode

2014-12-10 Thread Andrew Jones
Separate the concepts of an 'svc', the syscall instruction present on both arm and arm64, and 'svc mode', which is arm's kernel mode, and doesn't exist on arm64. kernel mode on arm64 is modeled with exception level 1 (el1). Signed-off-by: Andrew Jones drjo...@redhat.com --- arm/selftest.c

[PATCH 09/15] arm64: vectors support

2014-12-10 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- arm/cstart64.S| 142 ++- arm/selftest.c| 129 --- arm/unittests.cfg | 2 - config/config-arm64.mak | 1 + lib/arm64/asm-offsets.c | 16

[PATCH 13/15] arm64: import some Linux page table API

2014-12-10 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm64/asm/page.h | 66 +++- lib/arm64/asm/pgtable-hwdef.h | 136 ++ lib/arm64/asm/pgtable.h | 69 + 3 files changed, 270 insertions(+), 1 deletion

[PATCH 11/15] arm: import more linux page table api

2014-12-10 Thread Andrew Jones
To use page level descriptors we need some pgd/pud/pmd/pte methods, and a few more flags defined. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/asm/mmu.h | 16 +--- lib/arm/asm/pgtable-hwdef.h | 38 ++- lib/arm/asm/pgtable.h | 91

[PATCH 12/15] arm: prepare mmu code for arm64

2014-12-10 Thread Andrew Jones
* don't assume 1G PGDIR_SIZE or L1_CACHE_BYTES pgd alignment * use page level descriptors for non-I/O memory * apply new pgd/pud/pmd/pte methods * split mmu.h to share function declarations * use more generic flag names in mmu.c Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/asm/mmu

[PATCH 01/15] arm: fix run script testdev probing

2014-12-10 Thread Andrew Jones
Using -kernel doesn't force qemu to exit immediately, and thus we hang when trying to run arm/run. Using -initrd works though. Signed-off-by: Andrew Jones drjo...@redhat.com --- arm/run | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arm/run b/arm/run index a714350225597

[PATCH 03/15] arm: setup: fix type mismatch

2014-12-10 Thread Andrew Jones
Correct a type mismatch in the cpus initialization. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/arm/setup.c b/lib/arm/setup.c index 5fa37ca35f383..50ca4cb9ff99e 100644 --- a/lib/arm/setup.c +++ b/lib

[PATCH 14/15] arm64: prepare for 64k pages

2014-12-10 Thread Andrew Jones
more than one page, even though the memory is there. Signed-off-by: Andrew Jones drjo...@redhat.com --- arm/flat.lds | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arm/flat.lds b/arm/flat.lds index ee9fc0ab79abc..89a55720d728f 100644 --- a/arm/flat.lds +++ b/arm

[PATCH 10/15] arm: get PHYS_MASK from pgtable-hwdef.h

2014-12-10 Thread Andrew Jones
This allows it to be different for arm64, even with setup.h shared. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/asm/mmu.h | 2 +- lib/arm/asm/page.h | 5 ++--- lib/arm/asm/pgtable-hwdef.h | 6 ++ lib/arm/asm/setup.h | 6 ++ lib/arm/mmu.c

[PATCH 05/15] arm: use absolute headers

2014-12-10 Thread Andrew Jones
-by: Andrew Jones drjo...@redhat.com --- arm/cstart.S | 6 +++--- arm/selftest.c| 14 +++--- lib/arm/asm-offsets.c | 4 ++-- lib/arm/asm/asm-offsets.h | 2 +- lib/arm/asm/io.h | 8 lib/arm/asm/mmu.h | 6 +++--- lib/arm/asm/page.h

[PATCH 06/15] arm: setup: drop unused arguments

2014-12-10 Thread Andrew Jones
Drop the unused arguments from setup(), passing only the fdt. This allows setup() to be more easily shared with arm64. Signed-off-by: Andrew Jones drjo...@redhat.com --- arm/cstart.S| 12 ++-- lib/arm/setup.c | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git

[PATCH 02/15] virtio: don't use size_t

2014-12-10 Thread Andrew Jones
A size_t can have a different size when compiled as 64-bit vs. 32-bit. When unsigned int is what we want, then make sure unsigned int is what we use. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/chr-testdev.c | 4 ++-- lib/virtio.c | 2 +- lib/virtio.h | 3 ++- 3 files

[PATCH 08/15] arm64: initial drop

2014-12-10 Thread Andrew Jones
make QEMU=[qemu with aarch64, mach-virt, and chr-testdev] ./run_tests.sh Signed-off-by: Andrew Jones drjo...@redhat.com --- arm/cstart64.S | 48 + arm/run | 10 -- arm/selftest.c | 6 arm/unittests.cfg

Re: [PATCH v2 0/6] Improve PSCI system events and fix reboot bugs

2014-12-05 Thread Andrew Jones
On Wed, Dec 03, 2014 at 10:18:36PM +0100, Christoffer Dall wrote: Several people have reported problems with rebooting ARM VMs, especially on 32-bit ARM. This is mainly due to the same reason we were seeing boot errors in the past, namely that the ram, dcache, and icache weren't coherent on

Re: [PATCH 0/5] Improve PSCI system events and fix reboot bugs

2014-12-01 Thread Andrew Jones
), and then intermittently afterwards. I've just tested this patch series, and it appears to resolve the issue. No stuck vcpu after install, and a reboot loop has been running for a while now. I'm testing on a mustang. If you like, feel free to add a Tested-by: Andrew Jones drjo...@redhat.com drew

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

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:09:59PM +, Alex Bennée wrote: 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

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

2014-11-26 Thread Andrew Jones
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: - kvm_guest_debug_arch, allows us to pass in HW debug registers - kvm_debug_exit_arch, signals the exact debug exit

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

2014-11-26 Thread Andrew Jones
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. Technically the stub is already there, and you're

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

2014-11-26 Thread Andrew Jones
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. I've added a new field to the vcpu structure to hold

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

2014-11-26 Thread Andrew Jones
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 is passed back to the guest. Furthermore while

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

2014-11-26 Thread Andrew Jones
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 to restore a set of debug registers. It uses macro

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

2014-11-26 Thread Andrew Jones
On Tue, Nov 25, 2014 at 04:10:05PM +, Alex Bennée wrote: This adds support for userspace to control the HW debug registers for guest debug. We'll only copy the $ARCH defined number across as that's all that hyp.S will use anyway. I've moved some helper functions into the hw_breakpoint.h

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

2014-11-26 Thread Andrew Jones
On Wed, Nov 26, 2014 at 05:46:05PM +0100, Paolo Bonzini wrote: On 26/11/2014 15:58, Alex Bennée wrote: 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

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Andrew Jones
On Thu, Nov 13, 2014 at 12:44:39AM -0200, Marcelo Tosatti wrote: The periodic kvmclock sync can be an undesired source of latencies. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 0033df3..be56fd3 100644 ---

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Andrew Jones
On Thu, Nov 13, 2014 at 09:40:41AM +0100, Andrew Jones wrote: On Thu, Nov 13, 2014 at 12:44:39AM -0200, Marcelo Tosatti wrote: The periodic kvmclock sync can be an undesired source of latencies. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/x86.c b

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Andrew Jones
On Thu, Nov 13, 2014 at 11:44:02AM +0100, Andrew Jones wrote: On Thu, Nov 13, 2014 at 09:40:41AM +0100, Andrew Jones wrote: On Thu, Nov 13, 2014 at 12:44:39AM -0200, Marcelo Tosatti wrote: The periodic kvmclock sync can be an undesired source of latencies. Signed-off-by: Marcelo

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Andrew Jones
On Thu, Nov 13, 2014 at 06:47:40PM +0100, Paolo Bonzini wrote: On 13/11/2014 18:46, Radim Krčmář wrote: Yes, or add callbacks to sysfs writes that would schedule/cancel this work. (But having a for_every_vm loop is quite ugly.) I'd be happy with a 'const kvmclock_periodic_sync'.

[kvm-unit-tests PATCH 0/6] arm: enable MMU

2014-10-30 Thread Andrew Jones
This first patch of this series fixes a bug caused by attempting to use spinlocks without enabling the MMU. The next three do some prep for the fifth, and also fix arm's PAGE_ALIGN. The fifth is prep for the sixth, which finally turns the MMU on for arm unit tests. Andrew Jones (6): arm: fix

[PATCH 1/6] arm: fix crash on cubietruck

2014-10-30 Thread Andrew Jones
/arm/asm/mmu.h @@ -0,0 +1,11 @@ +#ifndef __ASMARM_MMU_H_ +#define __ASMARM_MMU_H_ +/* + * Copyright (C) 2014, Red Hat Inc, Andrew Jones drjo...@redhat.com + * + * This work is licensed under the terms of the GNU LGPL, version 2. + */ + +#define mmu_enabled() (0) + +#endif /* __ASMARM_MMU_H_ */ diff

[PATCH 5/6] arm: import some Linux page table API

2014-10-30 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/asm/page.h | 22 +++ lib/arm/asm/pgtable-hwdef.h | 65 + 2 files changed, 87 insertions(+) create mode 100644 lib/arm/asm/pgtable-hwdef.h diff --git a/lib/arm/asm/page.h b

[PATCH 2/6] lib: add ALIGN() macro

2014-10-30 Thread Andrew Jones
Add a type-considerate ALIGN[_UP] macro to libcflat, and apply it to /lib code that can make use of it. This will be used to fix PAGE_ALIGN on arm, which can be used on phys_addr_t addresses, which may exceed 32 bits. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/alloc.c| 4

[PATCH 4/6] arm: apply ALIGN() and const.h to arm files

2014-10-30 Thread Andrew Jones
This fixes PAGE_ALIGN for greater than 32-bit addresses. Also fix up some whitespace in lib/arm/asm/page.h Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/asm/page.h | 21 +++-- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/arm/asm/page.h b/lib

[PATCH 3/6] lib: steal const.h from kernel

2014-10-30 Thread Andrew Jones
And apply it to /lib files. This prepares for the import of kernel headers that make use of the const.h macros. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/asm-generic/page.h | 8 +++- lib/const.h| 11 +++ 2 files changed, 14 insertions(+), 5 deletions

[PATCH 6/6] arm: turn on the MMU

2014-10-30 Thread Andrew Jones
We should probably always run with the mmu on, so let's enable it from setup with an identity map. Signed-off-by: Andrew Jones drjo...@redhat.com --- arm/cstart.S | 33 config/config-arm.mak | 3 ++- lib/arm/asm/mmu.h | 34

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-10-30 Thread Andrew Jones
On Fri, Sep 26, 2014 at 09:51:15AM +0200, Christoffer Dall wrote: On Tue, Sep 16, 2014 at 08:57:31AM -0400, Andrew Jones wrote: - Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - Il 16/09/2014 04:06, Andrew Jones ha scritto: We shouldn't try Load-Exclusive instructions unless we've enabled memory management, as these instructions depend on the data cache unit's coherency monitor. This patch adds a new setup boolean, initialized

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - Il 16/09/2014 14:12, Andrew Jones ha scritto: Should it at least write 1 to the spinlock? I thought about that. So on one hand we might get a somewhat functional synchronization mechanism, which may be enough for some unit test that doesn't enable caches

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - - Original Message - Il 16/09/2014 14:12, Andrew Jones ha scritto: Should it at least write 1 to the spinlock? I thought about that. So on one hand we might get a somewhat functional synchronization mechanism, which may be enough for some

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't require any synchronization. So we should be able to do enable caches spin_lock start

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't require any synchronization. So we should be able to do enable caches spin_lock start

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
- Original Message - - Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't require any synchronization. So we should be able to do

Re: [PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-16 Thread Andrew Jones
On Tue, Sep 16, 2014 at 10:38:11AM -0400, Andrew Jones wrote: - Original Message - - Original Message - Il 16/09/2014 14:43, Andrew Jones ha scritto: I don't think we need to worry about this case. AFAIU, enabling the caches for a particular cpu shouldn't

[PATCH kvm-unit-tests] arm: fix crash when caches are off

2014-09-15 Thread Andrew Jones
from the spec if the instructions will behave as expected while caches are off, so we no longer allow Load-Exclusive instructions on those processors without caches enabled either. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/asm/setup.h | 2 ++ lib/arm/setup.c | 1 + lib/arm

[PATCH v2 2/3] watchdog: control hard lockup detection default

2014-08-08 Thread Andrew Jones
hypervisor guest types may find it useful as well. Signed-off-by: Ulrich Obergfell uober...@redhat.com Signed-off-by: Andrew Jones drjo...@redhat.com --- v2: don't override hardlockup detector setting when just changing the threshold [Uli and Don] --- include/linux/nmi.h | 9 + kernel

Re: [PATCH 2/3] watchdog: control hard lockup detection default

2014-07-25 Thread Andrew Jones
On Fri, Jul 25, 2014 at 04:32:55AM -0400, Ulrich Obergfell wrote: - Original Message - From: Andrew Jones drjo...@redhat.com To: linux-ker...@vger.kernel.org, kvm@vger.kernel.org Cc: uober...@redhat.com, dzic...@redhat.com, pbonz...@redhat.com, a...@linux-foundation.org, mi

[PATCH 2/3] watchdog: control hard lockup detection default

2014-07-24 Thread Andrew Jones
hypervisor guest types may find it useful as well. Signed-off-by: Ulrich Obergfell uober...@redhat.com Signed-off-by: Andrew Jones drjo...@redhat.com --- include/linux/nmi.h | 9 + kernel/watchdog.c | 45 +++-- 2 files changed, 52 insertions(+), 2

[PATCH 0/3] watchdog: kvm: disable hard lockup detection by default

2014-07-24 Thread Andrew Jones
It's not recommended for KVM guests to enable hard lockup detection, as false positives may be easily triggered by, for example, vcpu overcommit. However any kernel compiled with HARDLOCKUP_DETECTOR that detects a PMU on boot will by default enable hard lockup detection. This series gives a kernel

[PATCH 1/3] watchdog: fix print-once on enable

2014-07-24 Thread Andrew Jones
) pr_info(enabled on all CPUs, ...) The patch avoids this by clearing cpu0_err in watchdog_nmi_disable(). Signed-off-by: Ulrich Obergfell uober...@redhat.com Signed-off-by: Andrew Jones drjo...@redhat.com --- kernel/watchdog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel

[PATCH 3/3] kvm: ensure hard lockup detection is disabled by default

2014-07-24 Thread Andrew Jones
Obergfell uober...@redhat.com Signed-off-by: Andrew Jones drjo...@redhat.com --- arch/x86/kernel/kvm.c | 8 1 file changed, 8 insertions(+) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 3dd8e2c4d74a9..95c3cb16af3e5 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c

[PATCH v7 00/14] kvm-unit-tests/arm: initial drop

2014-07-16 Thread Andrew Jones
the already Reviewed-by patches 05/14 add minimal virtio support for devtree virtio-mmio 09/14 arm: initial drop should get a second look (or interdiffed). Thanks in advance for reviews! [1] http://lists.nongnu.org/archive/html/qemu-devel/2014-07/msg01960.html Andrew Jones (12): libfdt: Import

[PATCH v7 06/14] lib/asm-generic: add page.h and virt_to_phys/phys_to_virt

2014-07-16 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/asm-generic/io.h | 13 + lib/asm-generic/page.h | 28 2 files changed, 41 insertions(+) create mode 100644 lib/asm-generic/page.h diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index

[PATCH v7 03/14] Introduce asm-generic/*.h files

2014-07-16 Thread Andrew Jones
specific versions placed in lib/$ARCH/asm/. Signed-off-by: Andrew Jones drjo...@redhat.com Acked-by: Christoffer Dall christoffer.d...@linaro.org --- v5: added a trivial ioremap function [Christoffer Dall] v4: introduce lib/asm symlink to get rid of #ifdef __arm__, add spinlock.h too v3: wrt

[PATCH v7 14/14] arm: vectors support

2014-07-16 Thread Andrew Jones
new file mode 100644 index 0..883cab89622f7 --- /dev/null +++ b/lib/arm/asm/processor.h @@ -0,0 +1,39 @@ +#ifndef _ASMARM_PROCESSOR_H_ +#define _ASMARM_PROCESSOR_H_ +/* + * Copyright (C) 2014, Red Hat Inc, Andrew Jones drjo...@redhat.com + * + * This work is licensed under the terms

[PATCH v7 07/14] virtio: add minimal support for virtqueues

2014-07-16 Thread Andrew Jones
Currently only supports sending (outbufs), doesn't have any bells or whistles. Code adapted from the Linux Kernel. Signed-off-by: Andrew Jones drjo...@redhat.com --- v7: - {alloc,alloc_aligned} - {calloc,memalign} - changes now split between virtio.* and virtio-mmio.* files --- lib/virtio

[PATCH v7 11/14] arm: Add IO accessors to avoid register-writeback

2014-07-16 Thread Andrew Jones
From: Christoffer Dall christoffer.d...@linaro.org Add IO accessor functions to the arm library functions to avoid register-writeback IO accessors that are not yet supported by the kernel. Signed-off-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Andrew Jones drjo...@redhat.com

[PATCH v7 13/14] arm: add useful headers from the Linux kernel

2014-07-16 Thread Andrew Jones
-offsets.mak b/config/asm-offsets.mak new file mode 100644 index 0..b2578a6692f33 --- /dev/null +++ b/config/asm-offsets.mak @@ -0,0 +1,41 @@ +# +# asm-offsets adapted from the kernel, see +# Kbuild +# scripts/Kbuild.include +# scripts/Makefile.build +# +# Authors: Andrew Jones

[PATCH v7 12/14] arm: Add arch-specific asm/page.h and __va/__pa

2014-07-16 Thread Andrew Jones
These are pretty much the same as the asm-generic version, but use phys_addr_t. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/asm/io.h | 13 + lib/arm/asm/page.h | 34 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/lib

[PATCH v7 05/14] add minimal virtio support for devtree virtio-mmio

2014-07-16 Thread Andrew Jones
Support the bare minimum of virtio to enable access to the virtio-mmio config space of a device. Currently this implementation must use a device tree to find the device. Signed-off-by: Andrew Jones drjo...@redhat.com Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v7: - s/alloc

[PATCH v7 04/14] Introduce lib/alloc

2014-07-16 Thread Andrew Jones
physical memory allocator, which the early_* alloc functions build on. Signed-off-by: Andrew Jones drjo...@redhat.com --- v7: expanded from only supplying the alloc function wrappers to including early_* and phys_alloc [Paolo Bonzini] --- lib/alloc.c | 176

[PATCH v7 02/14] add support for Linux device trees

2014-07-16 Thread Andrew Jones
-of.txt. Signed-off-by: Andrew Jones drjo...@redhat.com Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v7: - squashed the add a make target bit of v6's libfdt: get libfdt to build (now dropped) patch. The rest of that dropped patch has already been merged under libcflat: add more

[PATCH v7 08/14] Introduce chr-testdev

2014-07-16 Thread Andrew Jones
-by: Andrew Jones drjo...@redhat.com --- lib/chr-testdev.c | 72 +++ lib/chr-testdev.h | 14 +++ lib/virtio.h | 2 ++ 3 files changed, 88 insertions(+) create mode 100644 lib/chr-testdev.c create mode 100644 lib/chr-testdev.h diff --git

[PATCH v7 10/14] arm: Add spinlock implementation

2014-07-16 Thread Andrew Jones
From: Christoffer Dall christoffer.d...@linaro.org Add simple busy-wait spinlock implementation for ARM. Signed-off-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Andrew Jones drjo...@redhat.com --- config/config-arm.mak | 3 ++- lib/arm/asm/spinlock.h | 9 ++--- lib/arm

[PATCH v7 09/14] arm: initial drop

2014-07-16 Thread Andrew Jones
--cross-prefix=arm-linux-gnu- --arch=arm make ./run_tests.sh Signed-off-by: Andrew Jones drjo...@redhat.com Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v7: - remove memregions (reworked them as phys_alloc in lib/alloc) - selftest: non-functional change: s/argv[i]/var

Re: [PATCH v7 09/14] arm: initial drop

2014-07-16 Thread Andrew Jones
/setup.h b/lib/arm/asm/setup.h new file mode 100644 index 0..21445ef2085fc --- /dev/null +++ b/lib/arm/asm/setup.h @@ -0,0 +1,27 @@ +#ifndef _ASMARM_SETUP_H_ +#define _ASMARM_SETUP_H_ +/* + * Copyright (C) 2014, Red Hat Inc, Andrew Jones drjo...@redhat.com + * + * This work

Re: [PATCH v6 06/17] Introduce alloc_ops

2014-07-15 Thread Andrew Jones
On Fri, Jul 11, 2014 at 12:07:25PM +0200, Andrew Jones wrote: On Fri, Jul 11, 2014 at 11:41:34AM +0200, Paolo Bonzini wrote: Il 11/07/2014 10:55, Andrew Jones ha scritto: On Fri, Jul 11, 2014 at 10:40:42AM +0200, Paolo Bonzini wrote: Il 11/07/2014 10:19, Andrew Jones ha scritto: alloc_ops

Re: [PATCH v6 00/17] kvm-unit-tests/arm: initial drop

2014-07-15 Thread Andrew Jones
On Fri, Jul 11, 2014 at 10:47:00AM +0200, Paolo Bonzini wrote: Il 11/07/2014 10:19, Andrew Jones ha scritto: This is a v6 of a series that introduces arm to kvm-unit-tests. As the tidy-up patches from v5 have already been merged (thanks!), these are just the remaining patches. Although

Re: [PATCH v6 07/17] add minimal virtio support for devtree virtio-mmio

2014-07-15 Thread Andrew Jones
On Fri, Jul 11, 2014 at 11:08:28AM +0200, Andrew Jones wrote: On Fri, Jul 11, 2014 at 10:32:51AM +0200, Paolo Bonzini wrote: Il 11/07/2014 10:19, Andrew Jones ha scritto: +enum virtio_hwdesc_type { + VIRTIO_HWDESC_TYPE_DT = 0, /* device tree */ + NR_VIRTIO_HWDESC_TYPES

[PATCH v6 00/17] kvm-unit-tests/arm: initial drop

2014-07-11 Thread Andrew Jones
). Thanks in advance for reviews! [1] http://lists.nongnu.org/archive/html/qemu-devel/2014-07/msg01960.html [2] http://fpaste.org/117172/ [3] http://fpaste.org/117173/ Andrew Jones (15): libfdt: Import libfdt source libfdt: get libfdt to build add support for Linux device trees libcflat: add

[PATCH v6 02/17] libfdt: get libfdt to build

2014-07-11 Thread Andrew Jones
Add string functions needed for libfdt, and add a make target for it. Also split string function declarations out to own string.h. While at it, add strcpy. Signed-off-by: Andrew Jones drjo...@redhat.com Acked-by: Christoffer Dall christoffer.d...@linaro.org --- v6: split out string.h [Paolo

[PATCH v6 11/17] libcflat: clean up libcflat.h

2014-07-11 Thread Andrew Jones
Use libgcc's stddef.h and stdint.h, and then remove the redundant defines from libcflat.h. These changes have no affect on code including libcflat.h, but are needed in order to compile an unmodified libfdt for kvm-unit-tests using an arm cross-compiler. Signed-off-by: Andrew Jones drjo

[PATCH v6 03/17] add support for Linux device trees

2014-07-11 Thread Andrew Jones
. Signed-off-by: Andrew Jones drjo...@redhat.com Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v5: - changed *get_baseaddr* helpers to *get_base* helpers - a couple minor code changes [Christoffer Dall] v4: reworked everything, added lots of comments to devicetree.h --- lib/devicetree.c

[PATCH v6 07/17] add minimal virtio support for devtree virtio-mmio

2014-07-11 Thread Andrew Jones
Support the bare minimum of virtio to enable access to the virtio-mmio config space of a device. Currently this implementation must use a device tree to find the device. Signed-off-by: Andrew Jones drjo...@redhat.com Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v6: - switch

[PATCH v6 04/17] libcflat: add abort() and assert()

2014-07-11 Thread Andrew Jones
\ lib/report.o # libfdt paths diff --git a/lib/abort.c b/lib/abort.c new file mode 100644 index 0..61f7f924aba4b --- /dev/null +++ b/lib/abort.c @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2014, Red Hat Inc, Andrew Jones drjo...@redhat.com + * + * This work is licensed under the terms

[PATCH v6 15/17] arm: Add arch-specific asm/page.h and __va/__pa

2014-07-11 Thread Andrew Jones
These are pretty much the same as the asm-generic version, but use phys_addr_t. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/arm/asm/io.h | 13 + lib/arm/asm/page.h | 34 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/lib

[PATCH v6 12/17] arm: initial drop

2014-07-11 Thread Andrew Jones
] ./configure --cross-prefix=arm-linux-gnu- --arch=arm make ./run_tests.sh Signed-off-by: Andrew Jones drjo...@redhat.com Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v6: - fixed setup.c comment [Christoffer Dall] - changed arm/run to use chr-testdev instead of virtio-testdev - add

[PATCH v6 17/17] arm: vectors support

2014-07-11 Thread Andrew Jones
. Signed-off-by: Andrew Jones drjo...@redhat.com Reviewed-by: Christoffer Dall christoffer.d...@linaro.org --- v6: use alloc() for start_usr v5: rebase change: replace __stringify with libcflat's new xstr macro v4: a couple tweaks to fit changes in the other patches, vectors-usr test now has

[PATCH v6 13/17] arm: Add spinlock implementation

2014-07-11 Thread Andrew Jones
From: Christoffer Dall christoffer.d...@linaro.org Add simple busy-wait spinlock implementation for ARM. Signed-off-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Andrew Jones drjo...@redhat.com --- config/config-arm.mak | 3 ++- lib/arm/asm/spinlock.h | 9 ++--- lib/arm

[PATCH v6 16/17] arm: add useful headers from the Linux kernel

2014-07-11 Thread Andrew Jones
-offsets.mak b/config/asm-offsets.mak new file mode 100644 index 0..b2578a6692f33 --- /dev/null +++ b/config/asm-offsets.mak @@ -0,0 +1,41 @@ +# +# asm-offsets adapted from the kernel, see +# Kbuild +# scripts/Kbuild.include +# scripts/Makefile.build +# +# Authors: Andrew Jones

[PATCH v6 06/17] Introduce alloc_ops

2014-07-11 Thread Andrew Jones
alloc_ops provide interfaces for alloc(), free() and friends, allowing unit tests and common code to use dynamic memory allocation. arch-specific code must provide the implementations. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/alloc.c | 2 ++ lib/alloc.h | 31

[PATCH v6 10/17] Introduce chr-testdev

2014-07-11 Thread Andrew Jones
-by: Andrew Jones drjo...@redhat.com --- lib/chr-testdev.c | 72 +++ lib/chr-testdev.h | 14 +++ lib/virtio.h | 2 ++ 3 files changed, 88 insertions(+) create mode 100644 lib/chr-testdev.c create mode 100644 lib/chr-testdev.h diff --git

[PATCH v6 14/17] arm: Add IO accessors to avoid register-writeback

2014-07-11 Thread Andrew Jones
From: Christoffer Dall christoffer.d...@linaro.org Add IO accessor functions to the arm library functions to avoid register-writeback IO accessors that are not yet supported by the kernel. Signed-off-by: Christoffer Dall christoffer.d...@linaro.org Signed-off-by: Andrew Jones drjo...@redhat.com

[PATCH v6 05/17] Introduce asm-generic/*.h files

2014-07-11 Thread Andrew Jones
specific versions placed in lib/$ARCH/asm/. Signed-off-by: Andrew Jones drjo...@redhat.com Acked-by: Christoffer Dall christoffer.d...@linaro.org --- v5: added a trivial ioremap function [Christoffer Dall] v4: introduce lib/asm symlink to get rid of #ifdef __arm__, add spinlock.h too v3: wrt

[PATCH v6 08/17] lib: add asm/page.h and virt_to_phys/phys_to_virt

2014-07-11 Thread Andrew Jones
Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/asm-generic/io.h | 13 + lib/asm-generic/page.h | 28 2 files changed, 41 insertions(+) create mode 100644 lib/asm-generic/page.h diff --git a/lib/asm-generic/io.h b/lib/asm-generic/io.h index

[PATCH v6 09/17] virtio: add minimal support for virtqueues

2014-07-11 Thread Andrew Jones
Currently only supports sending (outbufs), doesn't have any bells or whistles. Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/virtio.c | 177 +++ lib/virtio.h | 107 +++- 2 files changed, 282

Re: [PATCH v6 06/17] Introduce alloc_ops

2014-07-11 Thread Andrew Jones
On Fri, Jul 11, 2014 at 10:40:42AM +0200, Paolo Bonzini wrote: Il 11/07/2014 10:19, Andrew Jones ha scritto: alloc_ops provide interfaces for alloc(), free() and friends, allowing unit tests and common code to use dynamic memory allocation. arch-specific code must provide the implementations

Re: [PATCH v6 07/17] add minimal virtio support for devtree virtio-mmio

2014-07-11 Thread Andrew Jones
On Fri, Jul 11, 2014 at 10:32:51AM +0200, Paolo Bonzini wrote: Il 11/07/2014 10:19, Andrew Jones ha scritto: +enum virtio_hwdesc_type { +VIRTIO_HWDESC_TYPE_DT = 0, /* device tree */ +NR_VIRTIO_HWDESC_TYPES, +}; + +enum virtio_bus_type { +VIRTIO_BUS_TYPE_MMIO = 0

Re: [PATCH v6 07/17] add minimal virtio support for devtree virtio-mmio

2014-07-11 Thread Andrew Jones
On Fri, Jul 11, 2014 at 11:27:58AM +0200, Paolo Bonzini wrote: Il 11/07/2014 11:08, Andrew Jones ha scritto: lib/arm/virtio.c where virtio_bind is in lib/arm/virtio.c. Well, virtio_bind will still need to be in lib/virtio.c, but just as a wrapper to arch_virtio_bind. Ok, that's just

Re: [PATCH v6 09/17] virtio: add minimal support for virtqueues

2014-07-11 Thread Andrew Jones
On Fri, Jul 11, 2014 at 11:32:20AM +0200, Paolo Bonzini wrote: Il 11/07/2014 11:23, Paolo Bonzini ha scritto: +static struct virtqueue *vm_setup_vq(struct virtio_device *vdev, + unsigned index, + void (*callback)(struct virtqueue *vq), +

Re: [PATCH v6 06/17] Introduce alloc_ops

2014-07-11 Thread Andrew Jones
On Fri, Jul 11, 2014 at 11:41:34AM +0200, Paolo Bonzini wrote: Il 11/07/2014 10:55, Andrew Jones ha scritto: On Fri, Jul 11, 2014 at 10:40:42AM +0200, Paolo Bonzini wrote: Il 11/07/2014 10:19, Andrew Jones ha scritto: alloc_ops provide interfaces for alloc(), free() and friends, allowing unit

Re: [PATCH] kvm-unit-tests/x86: fix unittests.cfg typo

2014-06-17 Thread Andrew Jones
On Thu, Apr 17, 2014 at 04:17:42PM +0200, Andrew Jones wrote: Signed-off-by: Andrew Jones drjo...@redhat.com --- x86/unittests.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x86/unittests.cfg b/x86/unittests.cfg index 7930c026a38d6..d78fe0eafe2b6 100644 --- a/x86

[PATCH][RFC] kvm-unit-tests: report: add report_skip

2014-06-17 Thread Andrew Jones
report_skip(msg2, !cond1, cond1 cond2) - SKIP report_skip(msg3, !cond1, cond1 cond3) - SKIP Signed-off-by: Andrew Jones drjo...@redhat.com --- lib/libcflat.h | 1 + lib/report.c | 34 ++ 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/lib

Re: [PATCH][RFC] kvm-unit-tests: report: add report_skip

2014-06-17 Thread Andrew Jones
On Tue, Jun 17, 2014 at 02:46:30PM +0200, Paolo Bonzini wrote: Il 17/06/2014 14:21, Andrew Jones ha scritto: would look better as report(msg1, cond1) - FAIL report_skip(msg2, !cond1, cond1 cond2) - SKIP report_skip(msg3, !cond1, cond1 cond3) - SKIP I

[PATCH kvm-unit-tests] report: add report_xfail for expected failures

2014-06-17 Thread Andrew Jones
Add report_xfail(), which is report(), but with another condition allowing it to output PASS/FAIL/XPASS/XFAIL, rather than only PASS/FAIL. This allows report output to stay more consistent between systems/configurations that may or may not support all tests. Signed-off-by: Andrew Jones drjo

Re: [PATCH v5 15/19] arm: initial drop

2014-06-16 Thread Andrew Jones
On Sat, Jun 14, 2014 at 04:16:53PM +0200, Christoffer Dall wrote: On Wed, Jun 11, 2014 at 04:01:30PM +0200, Andrew Jones wrote: This is the initial drop of the arm test framework and a first test that just checks that setup completed (a selftest). kvm isn't needed to run this test unless

Re: [PATCH v5 00/19] kvm-unit-tests/arm: initial drop

2014-06-16 Thread Andrew Jones
On Sat, Jun 14, 2014 at 04:44:47PM +0200, Christoffer Dall wrote: On Wed, Jun 11, 2014 at 04:01:15PM +0200, Andrew Jones wrote: This is a v5 of a series that introduces arm to kvm-unit-tests. First, it does some tidying up of the repo. Then, it adds support for device trees (libfdt

Re: [PATCH v5 03/19] clean root dir of all x86-ness

2014-06-12 Thread Andrew Jones
On Thu, Jun 12, 2014 at 12:31:54PM +0200, Paolo Bonzini wrote: Il 11/06/2014 16:01, Andrew Jones ha scritto: diff --git a/configure b/configure index d0c62e24dd1d2..6cfc64943f6e6 100755 --- a/configure +++ b/configure @@ -15,6 +15,7 @@ usage() { Usage: $0 [options] Options

<    1   2   3   4   5   6   >