Re: [kvm-unit-tests PATCH 3/3] add timeout support

2015-12-22 Thread Andrew Jones
On Tue, Dec 22, 2015 at 07:02:21PM +0100, Radim Krčmář wrote: > 2015-12-21 13:45-0600, Andrew Jones: > > On Mon, Dec 21, 2015 at 06:04:20PM +0100, Radim Krčmář wrote: > >> 2015-12-17 14:10-0600, Andrew Jones: > >> > diff --git a/run_tests.sh b/run_tests.sh > &g

Re: [kvm-unit-tests PATCH 1/3] run_tests.sh: reduce return code ambiguity

2015-12-21 Thread Andrew Jones
On Mon, Dec 21, 2015 at 05:31:24PM +0100, Radim Krčmář wrote: > 2015-12-17 14:10-0600, Andrew Jones: > > qemu/unittest exit codes are convoluted, causing codes 0 and 1 > > to be ambiguous. Here are the po

Re: [kvm-unit-tests PATCH 3/3] add timeout support

2015-12-21 Thread Andrew Jones
On Mon, Dec 21, 2015 at 06:04:20PM +0100, Radim Krčmář wrote: > 2015-12-17 14:10-0600, Andrew Jones: > > Signed-off-by: Andrew Jones <drjo...@redhat.com> > > --- > > diff --git a/arm/run b/arm/run > > @@ -75,10 +75,14 @@ chr_testdev+=' -device virtconsole,chardev

Re: [PATCH kvm-unit-tests v2 05/12] lib/report: allow test skipping

2015-12-18 Thread Andrew Jones
On Fri, Dec 18, 2015 at 12:18:19PM +0100, Radim Krčmář wrote: > 2015-12-17 13:37-0600, Andrew Jones: > > On Thu, Dec 17, 2015 at 01:30:23PM -0600, Andrew Jones wrote: > >> On Thu, Dec 17, 2015 at 06:53:36PM +0100, Radim Krčmář wrote: > >> > We can now explicit

Re: [PATCH kvm-unit-tests v2 00/12] Improve the output of test runners

2015-12-18 Thread Andrew Jones
On Fri, Dec 18, 2015 at 01:38:31PM +0100, Radim Krčmář wrote: > 2015-12-17 14:04-0600, Andrew Jones: > > On Thu, Dec 17, 2015 at 06:53:31PM +0100, Radim Krčmář wrote: > >> v1: http://www.spinics.net/lists/kvm/msg125202.html > >> > >> Drew brought up the existen

Re: [PATCH kvm-unit-tests v2 01/12] run_tests: move run() to scripts/

2015-12-18 Thread Andrew Jones
On Fri, Dec 18, 2015 at 11:42:40AM +0100, Radim Krčmář wrote: > 2015-12-17 12:45-0600, Andrew Jones: > > On Thu, Dec 17, 2015 at 06:53:32PM +0100, Radim Krčmář wrote: > >> We'll be using it from scripts/mkstandalone later. > >> > >> Signed-off-

Re: [PATCH kvm-unit-tests v2 01/12] run_tests: move run() to scripts/

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:32PM +0100, Radim Krčmář wrote: > We'll be using it from scripts/mkstandalone later. > > Signed-off-by: Radim Krčmář > --- > v2: new > > run_tests.sh | 53 + > scripts/run.bash | 51

Re: [PATCH kvm-unit-tests v2 02/12] run_tests: prepare for changes in scripts/mkstandalone

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:33PM +0100, Radim Krčmář wrote: > mkstandalone has a different mechanism for running tests as well as a > different handling of output and return codes. > - create two shell function to capture test execution and logging > - return the return value of unit-test > -

Re: [PATCH kvm-unit-tests v2 10/12] run_tests: print summary

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:41PM +0100, Radim Krčmář wrote: > Might be interesting and hopefully won't break too many scripts. > > Signed-off-by: Radim Krčmář > --- > v2: > - don't print "0 unexpected failures" in run_tests' summary. [Drew] >(This could have been done

Re: [PATCH kvm-unit-tests v2 09/12] x86/hyperv_synic: check for support before testing

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:40PM +0100, Radim Krčmář wrote: > It's not easy to distinguish successful unit-test from failed QEMU, so > we check for presence of the needed feature before hand. > > Signed-off-by: Radim Krčmář > --- > v2: remove "> /dev/null" as check doesn't

Re: [PATCH kvm-unit-tests v2 10/12] run_tests: print summary

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:41PM +0100, Radim Krčmář wrote: > Might be interesting and hopefully won't break too many scripts. > > Signed-off-by: Radim Krčmář > --- > v2: > - don't print "0 unexpected failures" in run_tests' summary. [Drew] >(This could have been done

Re: [PATCH kvm-unit-tests v2 05/12] lib/report: allow test skipping

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:36PM +0100, Radim Krčmář wrote: > We can now explicitly mark a unit-test as skipped. > If all unit-tests were skipped, the whole test is reported as skipped as > well. This also includes the case where no tests were run, but still > ended with report_summary(). > >

Re: [PATCH kvm-unit-tests v2 05/12] lib/report: allow test skipping

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 01:30:23PM -0600, Andrew Jones wrote: > On Thu, Dec 17, 2015 at 06:53:36PM +0100, Radim Krčmář wrote: > > We can now explicitly mark a unit-test as skipped. > > If all unit-tests were skipped, the whole test is reported as skipped as > > well. This a

[kvm-unit-tests PATCH 3/3] add timeout support

2015-12-17 Thread Andrew Jones
Signed-off-by: Andrew Jones <drjo...@redhat.com> --- arm/run | 8 ++-- arm/unittests.cfg | 1 + run_tests.sh| 5 - scripts/functions.bash | 8 ++-- scripts/mkstandalone.sh | 9 +++-- x86/run | 8 ++-- x86/unittes

[kvm-unit-tests PATCH 1/3] run_tests.sh: reduce return code ambiguity

2015-12-17 Thread Andrew Jones
SUCCESS < 128 - something failed (could be the unittest, qemu, or a run script) Check the logs. >= 128 - signal (signum = code - 128) Signed-off-by: Andrew Jones <drjo...@redhat.com> --- run_tests.sh| 27 +-- scripts/mkstanda

[kvm-unit-tests PATCH 2/3] cleanup unittests.cfg headers

2015-12-17 Thread Andrew Jones
Signed-off-by: Andrew Jones <drjo...@redhat.com> --- arm/unittests.cfg | 26 +- x86/unittests.cfg | 21 ++--- 2 files changed, 31 insertions(+), 16 deletions(-) diff --git a/arm/unittests.cfg b/arm/unittests.cfg index 5e26da1a8c1bc..926bbb153728b

[kvm-unit-tests PATCH 0/3] run_tests.sh changes

2015-12-17 Thread Andrew Jones
Improve exit code handling and add unittest timeout support. Andrew Jones (3): run_tests.sh: reduce return code ambiguity cleanup unittests.cfg headers add timeout support arm/run | 8 ++-- arm/unittests.cfg | 27 ++- run_tests.sh

Re: [PATCH kvm-unit-tests v2 12/12] run_tests: suppress stderr

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:43PM +0100, Radim Krčmář wrote: > log it instead to keep the output clear. > > Signed-off-by: Radim Krčmář > --- > v2: new (v1 did this by catching all output in a variable) > > run_tests.sh | 2 +- > 1 file changed, 1 insertion(+), 1

Re: [PATCH kvm-unit-tests v2 03/12] scripts/mkstandalone: use common run function

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:34PM +0100, Radim Krčmář wrote: > The biggest change is dependency on bash. An alternative would be to > rewrite `run` in POSIX shell, but I think it's ok to presume that KVM > unit tests will run on a system where installing bash isn't a problem. Hmm... as hard as

Re: [PATCH kvm-unit-tests v2 11/12] wrappers: consolidate skip output

2015-12-17 Thread Andrew Jones
skipped $testname (check returned $?)"' > -echo "skip $testname (failed check)" > -return > +echo "`SKIP` $testname (failed check)" > +return $EXIT_SKIP > } > > cmdline="TESTNAME=$testname ACCEL=$accel __run $

Re: [PATCH kvm-unit-tests v2 04/12] scripts/mkstandalone: improve exit paths

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:35PM +0100, Radim Krčmář wrote: > trap can be called on EXIT, which covers most exits. Not with dash :-) If we decide to depend on bash, then Reviewed-by: Andrew Jones <drjo...@redhat.com> > > Signed-off-by: Radim Krčmář <rkrc...@redhat.com

Re: [PATCH kvm-unit-tests v2 00/12] Improve the output of test runners

2015-12-17 Thread Andrew Jones
On Thu, Dec 17, 2015 at 06:53:31PM +0100, Radim Krčmář wrote: > v1: http://www.spinics.net/lists/kvm/msg125202.html > > Drew brought up the existence of scripts/mkstandalone.sh, which > significantly expanded v2 (and my set of curses) ... > I didn't want to do the same twice, so first part of

Re: [PATCH kvm-unit-tests 2/4] x86: replace set_exception_return with longjmp-based implementation

2015-12-15 Thread Andrew Jones
On Tue, Dec 15, 2015 at 11:25:36AM +0100, Paolo Bonzini wrote: > set_exception_return forces exceptions handlers to return to a specific > address instead of returning to the instruction address pushed by the > CPU at the time of the exception. The unit tests apic.c and vmx.c use > this

Re: [PATCH kvm-unit-tests 1/4] lib: add setjmp header and x86 implementation

2015-12-15 Thread Andrew Jones
On Tue, Dec 15, 2015 at 11:25:35AM +0100, Paolo Bonzini wrote: > Signed-off-by: Paolo Bonzini > --- > config/config-i386.mak | 2 ++ > config/config-x86-common.mak | 4 +++- > config/config-x86_64.mak | 2 ++ > lib/setjmp.h | 12 >

Re: [PATCH kvm-unit-tests 3/4] x86: remove test_for_exception

2015-12-15 Thread Andrew Jones
On Tue, Dec 15, 2015 at 11:25:37AM +0100, Paolo Bonzini wrote: > Test functions know whether an exception was generated simply by checking > the last value returned by set_exception_jmpbuf. The exception number is > passed to set_exception_jmpbuf so that it can set up the exception handler. > >

Re: [PATCH v7 19/19] KVM: ARM64: Add a new kvm ARM PMU device

2015-12-15 Thread Andrew Jones
On Tue, Dec 15, 2015 at 03:59:31PM +, Marc Zyngier wrote: > On 15/12/15 15:50, Shannon Zhao wrote: > > > > > > On 2015/12/15 23:33, Marc Zyngier wrote: > >> On 15/12/15 08:49, Shannon Zhao wrote: > From: Shannon Zhao > > Add a new kvm device type

Re: [PATCH kvm-unit-tests 0/6] Improve the output of test runners

2015-12-15 Thread Andrew Jones
On Tue, Dec 15, 2015 at 02:13:25PM +0100, Radim Krčmář wrote: > 2015-12-15 11:19+0100, Paolo Bonzini: > > On 14/12/2015 22:24, Radim Krčmář wrote: > >> This series is a mix of patches that change the output of run_tests.sh > >> and x86-run. The output of ./run_tests.sh now looks like this: > > >

Re: [PATCH kvm-unit-tests 3/6] x86/pmu: expect failure with nmi_watchdog

2015-12-15 Thread Andrew Jones
On Tue, Dec 15, 2015 at 02:01:01PM +0100, Radim Krčmář wrote: > 2015-12-14 16:05-0600, Andrew Jones: > > On Mon, Dec 14, 2015 at 10:24:18PM +0100, Radim Krčmář wrote: > >> diff --git a/x86/pmu.c b/x86/pmu.c > >> @@ -291,7 +292,7 @@ static vo

Re: [PATCH kvm-unit-tests 3/6] x86/pmu: expect failure with nmi_watchdog

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:18PM +0100, Radim Krčmář wrote: > Host's nmi_watchdog takes one slot, making the "all counters" unit-test > fail. We know exactly what happens, mark it as expected failure. > > PMU test is now executed regardless of host_nmi_watchdog. > > Signed-off-by: Radim

Re: [PATCH kvm-unit-tests 2/6] x86/*: report skipped tests

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:17PM +0100, Radim Krčmář wrote: > No care to consistency or exhaustivity was given. > > (svm-disabled test should be redone and it's weird that x86/hyperv_synic > is about the only one that does report_skip when unsupported.) > > Signed-off-by: Radim Krčmář

Re: [PATCH kvm-unit-tests 4/6] run_tests: generalize check

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:19PM +0100, Radim Krčmář wrote: > config attribute "check" is currently unused. > Provide a simple implementation instead of removing it. > > Signed-off-by: Radim Krčmář > --- > run_tests.sh | 15 --- > 1 file changed, 4

Re: [PATCH kvm-unit-tests 1/6] lib/report: allow test skipping

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 04:00:19PM -0600, Andrew Jones wrote: > On Mon, Dec 14, 2015 at 10:24:16PM +0100, Radim Krčmář wrote: > > This patch allows us to explicitly mark a unit-test as skipped. > > If all unit-tests were skipped, the whole test is reported as skipped as >

Re: [PATCH kvm-unit-tests 1/6] lib/report: allow test skipping

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:16PM +0100, Radim Krčmář wrote: > This patch allows us to explicitly mark a unit-test as skipped. > If all unit-tests were skipped, the whole test is reported as skipped as > well. This also includes the case where no report()s were done, but > the test still ended

Re: [PATCH kvm-unit-tests 0/6] Improve the output of test runners

2015-12-14 Thread Andrew Jones
On Mon, Dec 14, 2015 at 10:24:15PM +0100, Radim Krčmář wrote: > This series is a mix of patches that change the output of run_tests.sh > and x86-run. The output of ./run_tests.sh now looks like this: > > > PASS apic (14 tests, 0 unexpected failures) > > PASS ioapic (19 tests, 0 unexpected

Re: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-08 Thread Andrew Jones
On Tue, Dec 08, 2015 at 09:57:21AM +0300, Pavel Fedin wrote: > Hello! > > > I messed up the "load into xzr" test royally in the last attached patch. > > It was quite wrong. > > Yes, because "mov %0, xzr" is not trapped. > > > I have now tested > > > > asm volatile( > > "str %3,

Re: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Andrew Jones
On Mon, Dec 07, 2015 at 04:36:31PM -0600, Andrew Jones wrote: > On Mon, Dec 07, 2015 at 11:36:28AM +0300, Pavel Fedin wrote: > > Hello! > > > > > FYI, I tried writing test cases for this issue with kvm-unit-tests. The > > > issue didn't reproduce for me.

Re: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Andrew Jones
On Mon, Dec 07, 2015 at 11:47:44AM +0300, Pavel Fedin wrote: > Hello! > > > But, if Pavel doesn't > > mind trying them out on his system, then it'd be good to know if they > > reproduce there. I'd like to find out if it's a test case problem or > > something else strange going on with

Re: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Andrew Jones
On Mon, Dec 07, 2015 at 12:48:12PM +0300, Pavel Fedin wrote: > Hello! > > > FYI, I tried writing test cases for this issue with kvm-unit-tests. The > > issue didn't reproduce for me. It's quite possible my test cases are > > flawed > > Indeed they are, a very little thing fell through again...

Re: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Andrew Jones
On Mon, Dec 07, 2015 at 03:58:11PM -0600, Andrew Jones wrote: > On Mon, Dec 07, 2015 at 12:48:12PM +0300, Pavel Fedin wrote: > > Hello! > > > > > FYI, I tried writing test cases for this issue with kvm-unit-tests. The > > > issue didn't reproduce for me.

Re: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-07 Thread Andrew Jones
ad 0xc0de0badc0de PASS: sysreg: to xzr check: read 0x SUMMARY: 6 tests, 3 unexpected failures Return value from qemu: 3 Updated test attached. drew >From ef5af811a72c14977e7958ee94b0c7b0fb99e6e8 Mon Sep 17 00:00:00 2001 From: Andrew Jones <drjo...@redhat.com>

Re: [PATCH v4 0/4] KVM: arm64: BUG FIX: Correctly handle zero register transfers

2015-12-04 Thread Andrew Jones
se problem or something else strange going on with environments. kvm-unit-tests patch attached Thanks, drew >From 6576833b5e45801f0226316afae7daf0936a0aee Mon Sep 17 00:00:00 2001 From: Andrew Jones <drjo...@redhat.com> Date: Fri, 4 Dec 2015 23:55:53 +0100 Subject: [kvm-unit-tests PATCH] arm64: add xzr emulator tes

Re: [PATCH v2 10/21] arm64: KVM: Add patchable function selector

2015-12-02 Thread Andrew Jones
On Fri, Nov 27, 2015 at 06:50:04PM +, Marc Zyngier wrote: > KVM so far relies on code patching, and is likely to use it more > in the future. The main issue is that our alternative system works > at the instruction level, while we'd like to have alternatives at > the function level. How about

Re: [kvm-unit-tests PATCH 00/18] bunch of mostly trivial patches

2015-11-20 Thread Andrew Jones
On Tue, Nov 10, 2015 at 11:54:22AM -0500, Andrew Jones wrote: > On Tue, Nov 10, 2015 at 05:38:38PM +0100, Paolo Bonzini wrote: > > > > > > On 06/11/2015 01:24, Andrew Jones wrote: > > > Many of these patches were posted once. Some weren't, but anyway > > &

Re: [kvm-unit-tests PATCH 01/18] makefiles: use bash

2015-11-10 Thread Andrew Jones
On Tue, Nov 10, 2015 at 05:22:41PM +0100, Paolo Bonzini wrote: > > > On 06/11/2015 01:24, Andrew Jones wrote: > > Use bash in the makefiles, like we do in the scripts. Without > > this some platforms using dash fail to execute make targets > > that use bash-isms. >

Re: [kvm-unit-tests PATCH 00/18] bunch of mostly trivial patches

2015-11-10 Thread Andrew Jones
On Tue, Nov 10, 2015 at 05:38:38PM +0100, Paolo Bonzini wrote: > > > On 06/11/2015 01:24, Andrew Jones wrote: > > Many of these patches were posted once. Some weren't, but anyway > > almost everything is pretty trivial. I'd like to get these in, or > > at least g

Re: [PATCH] kvm-all: PAGE_SIZE should be real host page size

2015-11-10 Thread Andrew Jones
On Tue, Nov 10, 2015 at 04:41:16PM +0100, Paolo Bonzini wrote: > > > On 10/11/2015 01:23, Andrew Jones wrote: > > Just noticed this while grepping TARGET_PAGE_SIZE for an unrelated > > reason. I didn't use qemu_real_host_page_size as kvm_set_phys_mem() > > does, bec

Re: [Qemu-devel] [PATCH] kvm-all: PAGE_SIZE should be real host page size

2015-11-10 Thread Andrew Jones
On Tue, Nov 10, 2015 at 04:29:31PM +, Peter Maydell wrote: > On 10 November 2015 at 00:23, Andrew Jones <drjo...@redhat.com> wrote: > > Just noticed this while grepping TARGET_PAGE_SIZE for an unrelated > > reason. I didn't use qemu_real_host_page_size as kvm_set_phys_me

Re: [Qemu-devel] [kvm-unit-tests PATCHv5 3/3] arm: pmu: Add CPI checking

2015-11-10 Thread Andrew Jones
On Mon, Nov 02, 2015 at 09:58:14AM -0600, Andrew Jones wrote: > On Fri, Oct 30, 2015 at 03:32:43PM -0400, Christopher Covington wrote: > > Hi Drew, > > > > On 10/30/2015 09:00 AM, Andrew Jones wrote: > > > On Wed, Oct 28, 2015 at 03:12:55PM -0400, Christopher Cov

[kvm-unit-tests PATCH 19/18] don't embed code inside asserts

2015-11-09 Thread Andrew Jones
assert() is classically a macro which could also be disabled, so if somebody introduces a switch to "#define assert(...) /*nothing*/" in the future, we'd lose code. Suggested-by: Thomas Huth <th...@redhat.com> Signed-off-by: Andrew Jones <drjo...@redhat.com> ---

[kvm-unit-tests PATCH v2 02/19] trivial: lib: fail hard on failed mallocs

2015-11-09 Thread Andrew Jones
It's pretty safe to not even bother checking for NULL when using malloc and friends, but if we do check, then fail hard. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- v2: no code in asserts [Thomas Huth] lib/virtio-mmio.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[PATCH] kvm-all: PAGE_SIZE should be real host page size

2015-11-09 Thread Andrew Jones
Just noticed this while grepping TARGET_PAGE_SIZE for an unrelated reason. I didn't use qemu_real_host_page_size as kvm_set_phys_mem() does, because we'd need to make sure page_size_init() has run first. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- kvm-all.c | 6 -- 1 file chan

Re: [kvm-unit-tests PATCH 02/18] trivial: lib: fail hard on failed mallocs

2015-11-06 Thread Andrew Jones
On Fri, Nov 06, 2015 at 03:05:41PM +0100, Thomas Huth wrote: > On 06/11/15 01:24, Andrew Jones wrote: > > It's pretty safe to not even bother checking for NULL when > > using malloc and friends, but if we do check, then fail > > hard. > > > > Signed-off-by:

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

2015-11-05 Thread Andrew Jones
From: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Andrew Jones <drjo...@redhat.com> --- lib/printf.c | 13 + 1 file changed, 13 insertions(+) diff --git a/lib/printf.c b/lib/printf.c index 89308fb26b7d2..5d

[kvm-unit-tests PATCH 16/18] lib: link in linux kernel headers (uapi)

2015-11-05 Thread Andrew Jones
/include/linux would leave too many potential name collisions. So we create a lib/linux link, and do *not* add -I lib/linux. Doing it this way requires code to include the uapi headers with , putting them in their own "linux" namespace. Signed-off-by: Andrew Jones <drjo.

[kvm-unit-tests PATCH 18/18] arm/arm64: uart0_init: check /chosen/stdout-path

2015-11-05 Thread Andrew Jones
this stuff is a little less unnecessary, let's add a warning when we do actually find an address that doesn't match our initializer. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- lib/arm/io.c | 36 +++- 1 file changed, 27 insertions(+), 9 deletions(-)

[kvm-unit-tests PATCH 05/18] README: add pointer to new wiki page

2015-11-05 Thread Andrew Jones
Signed-off-by: Andrew Jones <drjo...@redhat.com> --- README | 6 ++ 1 file changed, 6 insertions(+) diff --git a/README b/README index eab5ea28f7fab..45587f2a97ec6 100644 --- a/README +++ b/README @@ -1,3 +1,9 @@ +Welcome to kvm-unit-tests + +See http://www.linux-kvm.org/page/KVM-unit

[kvm-unit-tests PATCH 02/18] trivial: lib: fail hard on failed mallocs

2015-11-05 Thread Andrew Jones
It's pretty safe to not even bother checking for NULL when using malloc and friends, but if we do check, then fail hard. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- lib/virtio-mmio.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lib/virtio-mmio.c

[kvm-unit-tests PATCH 10/18] run_tests: probe for max-smp

2015-11-05 Thread Andrew Jones
in the smp = line of a unittests.cfg file. That variable will then expand to the number of host cpus, or to the maximum vcpus allowed by KVM. [Inspired by a patch from Alex Bennée solving the same issue.] Signed-off-by: Andrew Jones <drjo...@redhat.com> --- arm/unittests.cfg | 3 ++- run_te

[kvm-unit-tests PATCH 15/18] arm/arm64: generate map files

2015-11-05 Thread Andrew Jones
Signed-off-by: Andrew Jones <drjo...@redhat.com> --- .gitignore | 1 + config/config-arm-common.mak | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 242fae475094c..acbb9055212aa 100644 --- a/.gitignore +++ b/.gitignore @

[kvm-unit-tests PATCH 14/18] arm/arm64: allow building a single test

2015-11-05 Thread Andrew Jones
' to use it, where "some-test" matches the name of the source file, i.e. arm/some-test.c Signed-off-by: Andrew Jones <drjo...@redhat.com> --- config/config-arm-common.mak | 6 ++ 1 file changed, 6 insertions(+) diff --git a/config/config-arm-common.mak b/config/config-arm-

[kvm-unit-tests PATCH 17/18] Revert "arm/arm64: import include/uapi/linux/psci.h"

2015-11-05 Thread Andrew Jones
The previous patch allows us to "unimport" this header now. This reverts commit 7bc9f5e757bfa5c5a520281640fcf47a14b3. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- lib/arm/asm/uapi-psci.h | 73 --- lib/arm64/asm/uapi-

[kvm-unit-tests PATCH 08/18] run_tests: pass test name to run script

2015-11-05 Thread Andrew Jones
With this $TEST_DIR/run can output test specific error messages. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index ebb7e9fe6fdfc..80b87823c3358 100755 --- a/run_tests.sh

[kvm-unit-tests PATCH 12/18] lib/arm: add flush_tlb_page mmu function

2015-11-05 Thread Andrew Jones
From: Alex Bennée <alex.ben...@linaro.org> 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 <alex.ben...@linaro.org> Reviewed-by: Andrew Jones <drjo...@redhat.co

[kvm-unit-tests PATCH 01/18] makefiles: use bash

2015-11-05 Thread Andrew Jones
Use bash in the makefiles, like we do in the scripts. Without this some platforms using dash fail to execute make targets that use bash-isms. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile

[kvm-unit-tests PATCH 00/18] bunch of mostly trivial patches

2015-11-05 Thread Andrew Jones
patches also available here https://github.com/rhdrjones/kvm-unit-tests/commits/queue Thanks, drew Alex Bennée (4): README: add some CONTRIBUTING notes configure: emit HOST=$host to config.mak lib/printf: support the %u unsigned fmt field lib/arm: add flush_tlb_page mmu function Andrew

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

2015-11-05 Thread Andrew Jones
From: Alex Bennée <alex.ben...@linaro.org> 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 <alex.ben...@linaro.org> Reviewed-by: Andrew Jones <drjo...@redhat.com> --- configure | 2 ++ 1 file cha

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

2015-11-05 Thread Andrew Jones
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 <drjo...@redhat.com> --- arm/run | 43 +-- arm/unittests.cfg | 4 +++- run_te

[kvm-unit-tests PATCH 04/18] trivial: lib: missing extern in string.h

2015-11-05 Thread Andrew Jones
Signed-off-by: Andrew Jones <drjo...@redhat.com> --- lib/string.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/string.h b/lib/string.h index 7820db86ee4e0..4e24f54d9e231 100644 --- a/lib/string.h +++ b/lib/string.h @@ -6,7 +6,7 @@ extern char *strcat(char *dest,

[kvm-unit-tests PATCH 06/18] README: add some CONTRIBUTING notes

2015-11-05 Thread Andrew Jones
From: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Andrew Jones <drjo...@redhat.com> --- README | 26 ++ 1 file changed, 26 insertions(+) diff --git a/README b/README index 45587f2a97ec6..45

[kvm-unit-tests PATCH 03/18] trivial: alloc: don't use 'top' outside spinlock

2015-11-05 Thread Andrew Jones
This is a fix just due to being too much of a type-A person. I noticed the issue while reading over the function, and decided to fix it, even though it's unlikely to be a problem ever because top is read-mostly (like written once, then only read, type of mostly). Signed-off-by: Andrew Jones <d

[kvm-unit-tests PATCH 13/18] arm: Fail on unknown subtest

2015-11-05 Thread Andrew Jones
From: Christopher Covington <c...@codeaurora.org> Signed-off-by: Christopher Covington <c...@codeaurora.org> Reviewed-by: Andrew Jones <drjo...@redhat.com> --- arm/selftest.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arm/selftest.c b/arm/selftest.c index fc9ec609d8

Re: [kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-11-03 Thread Andrew Jones
On Tue, Nov 03, 2015 at 10:40:18AM +0100, Paolo Bonzini wrote: > > > On 03/11/2015 08:08, Thomas Huth wrote: > > On 03/08/15 16:41, Andrew Jones wrote: > >> > This series is the first series of a series of series that will > >> > bring support to kvm-unit-

Re: [kvm-unit-tests PATCH 00/14] ppc64: initial drop

2015-11-03 Thread Andrew Jones
On Tue, Nov 03, 2015 at 10:40:18AM +0100, Paolo Bonzini wrote: > > > On 03/11/2015 08:08, Thomas Huth wrote: > > On 03/08/15 16:41, Andrew Jones wrote: > >> > This series is the first series of a series of series that will > >> > bring support to kvm-unit-

Re: [Qemu-devel] [kvm-unit-tests PATCHv5 3/3] arm: pmu: Add CPI checking

2015-11-02 Thread Andrew Jones
On Fri, Oct 30, 2015 at 03:32:43PM -0400, Christopher Covington wrote: > Hi Drew, > > On 10/30/2015 09:00 AM, Andrew Jones wrote: > > On Wed, Oct 28, 2015 at 03:12:55PM -0400, Christopher Covington wrote: > >> Calculate the numbers of cycles per instruction (CPI) impli

Re: [Qemu-devel] [kvm-unit-tests PATCHv5 3/3] arm: pmu: Add CPI checking

2015-10-30 Thread Andrew Jones
On Wed, Oct 28, 2015 at 03:12:55PM -0400, Christopher Covington wrote: > Calculate the numbers of cycles per instruction (CPI) implied by ARM > PMU cycle counter values. The code includes a strict checking facility > intended for the -icount option in TCG mode but it is not yet enabled > in the

Re: [Qemu-devel] [kvm-unit-tests PATCHv4 3/3] arm: pmu: Add CPI checking

2015-10-26 Thread Andrew Jones
On Mon, Oct 19, 2015 at 11:44:30AM -0400, Christopher Covington wrote: > Hi Drew, > > I appreciate your feedback on these patches. > > On 10/18/2015 02:28 PM, Andrew Jones wrote: > > >> --- a/arm/pmu.c > >> +++ b/arm/pmu.c > >> @@ -37,6 +37,18 @@

Re: [Qemu-devel] [kvm-unit-tests PATCHv5 2/3] arm: pmu: Check cycle count increases

2015-10-26 Thread Andrew Jones
On Mon, Oct 26, 2015 at 04:58:43PM +0100, Andrew Jones wrote: > On Mon, Oct 26, 2015 at 11:38:49AM -0400, Christopher Covington wrote: > > Ensure that reads of the PMCCNTR_EL0 are monotonically increasing, > > even for the smallest delta of two subsequent reads. > > > >

Re: [Qemu-devel] [kvm-unit-tests PATCHv5 2/3] arm: pmu: Check cycle count increases

2015-10-26 Thread Andrew Jones
printf("Read %ld then %ld.\n", a, b); > + return false; > + } > + } > + > + return true; > +} > + > int main(void) > { > report_prefix_push("pmu"); > > report("Control register", check

Re: [Qemu-devel] [kvm-unit-tests PATCHv5 3/3] arm: pmu: Add CPI checking

2015-10-26 Thread Andrew Jones
On Mon, Oct 26, 2015 at 11:38:50AM -0400, Christopher Covington wrote: > Calculate the numbers of cycles per instruction (CPI) implied by ARM > PMU cycle counter values. The code includes a strict checking facility > intended for the -icount option in TCG mode but it is not yet enabled > in the

Re: [Qemu-devel] [kvm-unit-tests PATCHv4 3/3] arm: pmu: Add CPI checking

2015-10-18 Thread Andrew Jones
On Mon, Oct 12, 2015 at 11:07:50AM -0400, Christopher Covington wrote: > Calculate the numbers of cycles per instruction (CPI) implied by ARM > PMU cycle counter values. The code includes a strict checking facility > intended for the -icount option in TCG mode but it is not yet enabled > in the

Re: [Qemu-devel] [kvm-unit-tests PATCHv4] ARM PMU tests

2015-10-18 Thread Andrew Jones
On Mon, Oct 12, 2015 at 11:07:47AM -0400, Christopher Covington wrote: > Changes from v3 in response to Drew's suggestions: > > * Improved pmu_data / PMCR fields and usage > * Straightened out awkward conditionals > * Added 32-bit support > * Styling enhancements > * Deferred -icount testing to

Re: [Qemu-devel] [kvm-unit-tests PATCHv4 1/3] arm: Add PMU test

2015-10-18 Thread Andrew Jones
on = \ > $(TEST_DIR)/selftest.flat \ > - $(TEST_DIR)/spinlock-test.flat > + $(TEST_DIR)/spinlock-test.flat \ > + $(TEST_DIR)/pmu.flat > > all: test_cases > > @@ -70,3 +71,4 @@ test_cases: $(generated_files) $(tests-common) $(tests) > &g

Re: [Qemu-devel] [kvm-unit-tests PATCHv4 2/3] arm: pmu: Check cycle count increases

2015-10-18 Thread Andrew Jones
On Mon, Oct 12, 2015 at 11:07:49AM -0400, Christopher Covington wrote: > Ensure that reads of the PMCCNTR_EL0 are monotonically increasing, > even for the smallest delta of two subsequent reads. > > Signed-off-by: Christopher Covington > --- > arm/pmu.c | 54

Re: [kvm-unit-tests PATCHv3 1/3] arm: Add PMU test

2015-10-06 Thread Andrew Jones
On Tue, Oct 06, 2015 at 01:49:24PM -0400, Christopher Covington wrote: > Beginning with a simple sanity check of the control register, add > a unit test for the ARM Performance Monitors Unit (PMU). > > Signed-off-by: Christopher Covington > --- > arm/pmu.c |

Re: [Qemu-devel] [kvm-unit-tests PATCHv3 2/3] arm: pmu: Check cycle count increases

2015-10-06 Thread Andrew Jones
On Tue, Oct 06, 2015 at 01:49:25PM -0400, Christopher Covington wrote: > Ensure that reads of the PMCCNTR_EL0 are monotonically increasing, > even for the smallest delta of two subsequent reads. > > Signed-off-by: Christopher Covington > --- > arm/pmu.c | 29

Re: [kvm-unit-tests PATCHv3 3/3] arm: pmu: Add CPI checking

2015-10-06 Thread Andrew Jones
On Tue, Oct 06, 2015 at 01:49:26PM -0400, Christopher Covington wrote: > Check the numbers of cycles per instruction (CPI) implied by ARM PMU > cycle counter values. Check that in -icount mode these strictly > match the specified rate. > > Signed-off-by: Christopher Covington

Re: [Qemu-devel] [PATCHv2] arm: Fail on unknown subtest

2015-10-02 Thread Andrew Jones
printf("Unknown subtest\n"); > + abort(); > } > > return report_summary(); > -- > Qualcomm Innovation Center, Inc. > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project >

Re: [Qemu-devel] [PATCH] arm: Add PMU test

2015-10-02 Thread Andrew Jones
On Thu, Oct 01, 2015 at 03:47:21PM -0400, Christopher Covington wrote: > Beginning with just a read of the control register, add plumbing > for testing the ARM Performance Monitors Unit (PMU). > > Signed-off-by: Christopher Covington Hi Christopher, PMU tests are a great

Re: [PATCH v2 00/22] KVM: ARM64: Add guest PMU support

2015-09-17 Thread Andrew Jones
On Thu, Sep 17, 2015 at 09:32:34AM +0800, Shannon Zhao wrote: > Hi Wei, > > On 2015/9/17 5:07, Wei Huang wrote: > > I am testing this series. > Thanks for your time and help. > > > The first question is: do you plan to add ACPI > > support in QEMU? > To the completeness, this should be added.

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

2015-09-10 Thread Andrew Jones
From: Alex Bennée <alex.ben...@linaro.org> 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 <alex.ben...@linaro.org> Reviewed-by: Andrew Jones <drjo...@redhat.com> --- configure | 2 ++ 1 file cha

[kvm-unit-tests PATCH 07/11] run_tests: probe for max-smp

2015-09-10 Thread Andrew Jones
in the smp = line of a unittests.cfg file. That variable will then expand to the number of host cpus, or to the maximum vcpus allowed by KVM. [Inspired by a patch from Alex Bennée solving the same issue.] Signed-off-by: Andrew Jones <drjo...@redhat.com> --- arm/unittests.cfg | 3 ++- run_te

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

2015-09-10 Thread Andrew Jones
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 <drjo...@redhat.com> --- arm/run | 43 +-- arm/unittests.cfg | 4 +++- run_te

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

2015-09-10 Thread Andrew Jones
From: Alex Bennée <alex.ben...@linaro.org> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> Reviewed-by: Andrew Jones <drjo...@redhat.com> --- lib/printf.c | 13 + 1 file changed, 13 insertions(+) diff --git a/lib/printf.c b/lib/printf.c index 89308fb26b7d2..5d

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

2015-09-10 Thread Andrew Jones
From: Alex Bennée <alex.ben...@linaro.org> 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 <alex.ben...@linaro.org> Reviewed-by: Andrew Jones <drjo...@redhat.co

[kvm-unit-tests PATCH 11/11] makefiles: use bash

2015-09-10 Thread Andrew Jones
Use bash in the makefiles, like we do in the scripts. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index 0d5933474cd8c..3e60b4f8e4a57 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,6 @@ +SHELL :

[kvm-unit-tests PATCH 05/11] run_tests: pass test name to run script

2015-09-10 Thread Andrew Jones
With this $TEST_DIR/run can output test specific error messages. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- run_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run_tests.sh b/run_tests.sh index ebb7e9fe6fdfc..80b87823c3358 100755 --- a/run_tests.sh

[kvm-unit-tests RFC PATCH 2/2] Revert "arm/arm64: import include/uapi/linux/psci.h"

2015-09-10 Thread Andrew Jones
The previous patch allows us to "unimport" this header now. This reverts commit 7bc9f5e757bfa5c5a520281640fcf47a14b3. Signed-off-by: Andrew Jones <drjo...@redhat.com> --- lib/arm/asm/uapi-psci.h | 73 --- lib/arm64/asm/uapi-

[kvm-unit-tests RFC PATCH 1/2] lib: link in linux kernel headers (uapi)

2015-09-10 Thread Andrew Jones
/include/linux would leave too many potential name collisions. So we create a lib/linux link, and do *not* add -I lib/linux. Doing it this way requires code to include the uapi headers with , putting them in their own "linux" namespace. Signed-off-by: Andrew Jones <drjo.

[kvm-unit-tests RFC PATCH 0/2] try another approach for uapi headers

2015-09-10 Thread Andrew Jones
be worth it just for psci.h, but we're looking at PCI support now, and thus we'll also want pci.h (and pci_regs.h). Although after pci.h I'm not sure what else we'll eventually want. If nothing, then maybe importing pci.h is also the right thing to do? Thanks, drew Andrew Jones (2): lib: link

[kvm-unit-tests PATCH 00/11] RESEND staging branch

2015-09-10 Thread Andrew Jones
/printf: support the %u unsigned fmt field lib: add isaac prng library from CCAN lib/arm: add flush_tlb_page mmu function Andrew Jones (6): arm/arm64: uart0_init: check /chosen/stdout-path arm/arm64: allow building a single test run_tests: pass test name to run script arm/run: use ACCEL

  1   2   3   4   5   6   >