Re: [PATCH RFC 1/2] kvm vcpu: Note down pause loop exit

2012-07-11 Thread Andrew Jones
- Original Message - > > > > Hm, suppose we're the next-in-line for a ticket lock and exit due > > to > > PLE. The lock holder completes and unlocks, which really assigns > > the > > lock to us. So now we are the lock owner, yet we are marked as > > don't > > yield-to-us in the PLE code

Re: [PATCH v8] kvm: notify host when the guest is panicked

2012-08-08 Thread Andrew Jones
On Wed, Aug 08, 2012 at 10:43:01AM +0800, Wen Congyang wrote: > diff --git a/Documentation/virtual/kvm/pv_event.txt > b/Documentation/virtual/kvm/pv_event.txt > new file mode 100644 > index 000..0ebc890 > --- /dev/null > +++ b/Documentation/virtual/kvm/pv_event.txt > @@ -0,0 +1,32 @@ > +The KV

Re: [PATCH v7 3/3] KVM: perf: kvm events analysis tool

2012-08-27 Thread Andrew Jones
On Mon, Aug 27, 2012 at 05:51:46PM +0800, Dong Hao wrote: > +struct event_stats { > + u64 count; > + u64 time; > + > + /* used to calculate stddev. */ > + double mean; > + double M2; > +}; How about moving the stats functions from builtin-stat.c to e.g. util/stats.c, and the

Re: [PATCH v7 3/3] KVM: perf: kvm events analysis tool

2012-08-27 Thread Andrew Jones
On Mon, Aug 27, 2012 at 01:34:36PM -0600, David Ahern wrote: > On 8/27/12 9:53 AM, Andrew Jones wrote: > >On Mon, Aug 27, 2012 at 05:51:46PM +0800, Dong Hao wrote: > > > > > > > >>+struct event_stats { > >>+ u64 count; > >>+

Re: [PATCH] kvm: handle last_boosted_vcpu = 0 case

2012-06-22 Thread Andrew Jones
On Thu, Jun 21, 2012 at 04:56:08PM +0530, Raghavendra K T wrote: > Here are the results from kernbench. > > PS: I think we have to only take that, both the patches perform better, > than reading into actual numbers since I am seeing more variance in > especially 3x. may be I can test with some mor

Re: [PATCH] kvm: handle last_boosted_vcpu = 0 case

2012-06-28 Thread Andrew Jones
- Original Message - > In summary, current PV has huge benefit on non-PLE machine. > > On PLE machine, the results become very sensitive to load, type of > workload and SPIN_THRESHOLD. Also PLE interference has significant > effect on them. But still it has slight edge over non PV. > H

Re: [PATCH RFC 0/2] kvm: Better yield_to candidate using preemption notifiers

2013-03-05 Thread Andrew Jones
On Mon, Mar 04, 2013 at 11:31:46PM +0530, Raghavendra K T wrote: > This patch series further filters better vcpu candidate to yield to > in PLE handler. The main idea is to record the preempted vcpus using > preempt notifiers and iterate only those preempted vcpus in the > handler. Note that the v

Re: [PATCH RFC 0/2] kvm: Better yield_to candidate using preemption notifiers

2013-03-05 Thread Andrew Jones
On Tue, Mar 05, 2013 at 05:54:09PM +0530, Raghavendra K T wrote: > On 03/05/2013 03:23 PM, Andrew Jones wrote: > >On Mon, Mar 04, 2013 at 11:31:46PM +0530, Raghavendra K T wrote: > >> This patch series further filters better vcpu candidate to yield to > >>in PLE h

Re: KVM guest 100% cpu lock up

2013-03-18 Thread Andrew Jones
- Original Message - > Hello, > > I am having an intermittent issue where one of my KVM guests is > locking up and when checking the process its running @ 100% cpu. > The host is CentOS 6.4 running the kernel > kernel-2.6.32-358.0.1.el6.x86_64. > > Would it be worth attempting to compi

Re: [PATCH RFC V10 0/18] Paravirtualized ticket spinlocks

2013-06-24 Thread Andrew Jones
On Mon, Jun 24, 2013 at 06:10:14PM +0530, Raghavendra K T wrote: > > Results: > === > base = 3.10-rc2 kernel > patched = base + this series > > The test was on 32 core (model: Intel(R) Xeon(R) CPU X7560) HT disabled > with 32 KVM guest vcpu 8GB RAM. Have you ever tried to get results with HT

Re: [PATCH RFC V9 0/19] Paravirtualized ticket spinlocks

2013-06-26 Thread Andrew Jones
On Wed, Jun 26, 2013 at 02:15:26PM +0530, Raghavendra K T wrote: > On 06/25/2013 08:20 PM, Andrew Theurer wrote: > >On Sun, 2013-06-02 at 00:51 +0530, Raghavendra K T wrote: > >>This series replaces the existing paravirtualized spinlock mechanism > >>with a paravirtualized ticketlock mechanism. The

arm: kvm-selftest

2013-07-31 Thread Andrew Jones
Hi Christoffer, I'm just confirming that I found the right repo/branch for the most recent kvmarm unit tests. I'm looking at github.com/virtualopensystems/linux-kvm-arm kvm-selftest with last commit commit b5aec35ee58c6b2d726a3e2fb56ec0e6e89976e0 Author: Christoffer Dall Date: Fri Feb 15 18:

ppc kvm-unit-tests?

2013-08-21 Thread Andrew Jones
Hi Alex, I'm looking at adding arm to kvm-unit-tests. One the first things I'd like to do is clean up the kvm-unit-tests repo a bit. There's some arch-specific files (including ppc) laying around in the root dir that I'd sweep up before adding another arch to the mix. Although, checking the git hi

[PATCH] kvm: warn if num cpus is greater than num recommended

2013-08-22 Thread Andrew Jones
qemu should check KVM_CAP_NR_VCPUS for the recommended number of vcpus. This patch adds a warning if a user specifies a number of cpus between the recommended and max. Signed-off-by: Andrew Jones --- kvm-all.c | 45 +++-- 1 file changed, 27 insertions(+

Re: [Qemu-devel] [PATCH] kvm: warn if num cpus is greater than num recommended

2013-08-23 Thread Andrew Jones
- Original Message - > Am 22.08.2013 18:12, schrieb Eduardo Habkost: > > > > On 22/08/2013, at 12:39, Andrew Jones wrote: > > > >> The comment in kvm_max_vcpus() states that it's using the recommended > >> procedure from the kernel API docum

Re: [Qemu-devel] [PATCH] kvm: warn if num cpus is greater than num recommended

2013-08-23 Thread Andrew Jones
- Original Message - > Il 22/08/2013 17:39, Andrew Jones ha scritto: > > The comment in kvm_max_vcpus() states that it's using the recommended > > procedure from the kernel API documentation to get the max number > > of vcpus that kvm supports. It is, b

[PATCH v2] kvm: warn if num cpus is greater than num recommended

2013-08-23 Thread Andrew Jones
r the fail case was slightly changed, 'exceeds max cpus' to 'exceeds the maximum cpus'. If this is unacceptable change for users like libvirt, then I'll need to spin a v3. Signed-off-by: Andrew Jones --- kvm-all.c | 69 -

Re: [Qemu-devel] [PATCH] kvm: warn if num cpus is greater than num recommended

2013-08-26 Thread Andrew Jones
- Original Message - > Il 23/08/2013 13:33, Andrew Jones ha scritto: > > Does smp_cpus map to the current > > number of cpus, or to the number of possible cpus? If it maps to the number > > of possible cpus, then this is the right place. If the former, then I gues

Re: [libvirt] [PATCH v2] kvm: warn if num cpus is greater than num recommended

2013-08-28 Thread Andrew Jones
- Original Message - > On 08/23/2013 07:24 AM, Andrew Jones wrote: > > The comment in kvm_max_vcpus() states that it's using the recommended > > procedure from the kernel API documentation to get the max number > > of vcpus that kvm supports. It is, b

[PATCH 3/3] aarch64: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-14 Thread Andrew Jones
Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 8. Signed-off-by: Andrew Jones --- arch/arm64/include/asm/kvm_host.h | 7 ++- arch/arm64/kvm/Kconfig| 11 +++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/kvm_host.h b

[PATCH 1/3] arm: kvm: clamp NR_VCPUS to MAX_VCPUS

2013-09-14 Thread Andrew Jones
Signed-off-by: Andrew Jones --- arch/arm/kvm/arm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index 741f66a2edbd7..9ebf8ac3a12ff 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c @@ -201,7 +201,7 @@ int

[PATCH 2/3] arm32: kvm: rename CONFIG_KVM_ARM_MAX_VCPUS

2013-09-14 Thread Andrew Jones
Drop the _ARM_ part of the name. We can then introduce a config option like this to aarch64 and other arches using the same name - allowing grep to show them all. Also update the help text to describe the option more completely. Signed-off-by: Andrew Jones --- arch/arm/include/asm/kvm_host.h

[PATCH 0/3] KVM_MAX_VCPUS related changes

2013-09-14 Thread Andrew Jones
Andrew Jones (3): arm: kvm: clamp NR_VCPUS to MAX_VCPUS arm32: kvm: rename CONFIG_KVM_ARM_MAX_VCPUS aarch64: kvm: introduce CONFIG_KVM_MAX_VCPUS arch/arm/include/asm/kvm_host.h | 4 ++-- arch/arm/kvm/Kconfig | 8 arch/arm/kvm/arm.c| 2 +- arch

[PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-14 Thread Andrew Jones
s (160). I can't think of anything other than generating more warnings[1] from qemu with guests that configure more vcpus than pcpus though. [1] Actually, until 972fc544b6034a in uq/master is merged there won't be any warnings either. Signed-off-by: Andrew Jones --- arch/x86/includ

[PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-14 Thread Andrew Jones
Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 255. Signed-off-by: Andrew Jones --- arch/x86/include/asm/kvm_host.h | 5 +++-- arch/x86/kvm/Kconfig| 10 ++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch

Re: [PATCH 1/3] arm: kvm: clamp NR_VCPUS to MAX_VCPUS

2013-09-14 Thread Andrew Jones
On Sat, Sep 14, 2013 at 07:14:02AM -0500, Alexander Graf wrote: > > > Am 14.09.2013 um 07:10 schrieb Andrew Jones : > > > Signed-off-by: Andrew Jones > > --- > > arch/arm/kvm/arm.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > >

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-16 Thread Andrew Jones
On Sun, Sep 15, 2013 at 12:03:22PM +0300, Gleb Natapov wrote: > On Sat, Sep 14, 2013 at 02:16:51PM +0200, Andrew Jones wrote: > > This patch removes KVM_SOFT_MAX_VCPUS and uses num_online_cpus() for > > KVM_CAP_NR_VCPUS instead, as ARM does. While the API doc simply says >

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-16 Thread Andrew Jones
On Sun, Sep 15, 2013 at 12:08:38PM +0300, Gleb Natapov wrote: > On Sat, Sep 14, 2013 at 02:18:49PM +0200, Andrew Jones wrote: > > Take CONFIG_KVM_MAX_VCPUS from arm32, but set the default to 255. > > > > Signed-off-by: Andrew Jones > > --- > > arc

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-16 Thread Andrew Jones
On Mon, Sep 16, 2013 at 11:55:17AM +0300, Gleb Natapov wrote: > On Mon, Sep 16, 2013 at 10:22:09AM +0200, Andrew Jones wrote: > > > > [1] Actually, until 972fc544b6034a in uq/master is merged there won't be > > > > any warnings either. > > &g

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-16 Thread Andrew Jones
On Mon, Sep 16, 2013 at 11:47:10AM +0300, Gleb Natapov wrote: > On Mon, Sep 16, 2013 at 10:28:20AM +0200, Andrew Jones wrote: > > On Sun, Sep 15, 2013 at 12:08:38PM +0300, Gleb Natapov wrote: > > > On Sat, Sep 14, 2013 at 02:18:49PM +0200, Andrew Jones wrote: > > > >

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-16 Thread Andrew Jones
On Mon, Sep 16, 2013 at 05:41:18PM +0300, Gleb Natapov wrote: > On Mon, Sep 16, 2013 at 01:47:26PM +0200, Andrew Jones wrote: > > On Mon, Sep 16, 2013 at 11:55:17AM +0300, Gleb Natapov wrote: > > > On Mon, Sep 16, 2013 at 10:22:09AM +0200, Andrew Jones wrote: > > >

Re: [PATCH] x86: kvm: introduce CONFIG_KVM_MAX_VCPUS

2013-09-16 Thread Andrew Jones
On Mon, Sep 16, 2013 at 05:16:20PM +0300, Gleb Natapov wrote: > On Mon, Sep 16, 2013 at 02:03:33PM +0200, Andrew Jones wrote: > > On Mon, Sep 16, 2013 at 11:47:10AM +0300, Gleb Natapov wrote: > > > On Mon, Sep 16, 2013 at 10:28:20AM +0200, Andrew Jones wrote: > > > >

Re: [PATCH] [RFC] x86: kvm: remove KVM_SOFT_MAX_VCPUS

2013-09-17 Thread Andrew Jones
On Tue, Sep 17, 2013 at 12:36:19PM +0300, Gleb Natapov wrote: > On Mon, Sep 16, 2013 at 05:22:26PM +0200, Andrew Jones wrote: > > On Mon, Sep 16, 2013 at 05:41:18PM +0300, Gleb Natapov wrote: > > > On Mon, Sep 16, 2013 at 01:47:26PM +0200, Andrew Jones wrote: > > > >

[PATCH v2] arm32: kvm: rename CONFIG_KVM_ARM_MAX_VCPUS

2013-09-24 Thread Andrew Jones
Drop the _ARM_ part of the name. We can then introduce a config option like this to aarch64 and other arches using the same name - allowing grep to show them all. Also update the help text to describe the option more completely. Signed-off-by: Andrew Jones --- v2: reword help text some more

[PATCH v5 05/19] add 'make cscope' support

2014-06-11 Thread Andrew Jones
Add a Makefile target to quickly generate arch-specific cscope for kvm-unit-tests. Assumes a mostly flat directory structure, i.e. uses '-maxdepth 1' in the file search. Signed-off-by: Andrew Jones Acked-by: Christoffer Dall --- Makefile | 11 +-- 1 file changed, 9 insert

[PATCH v5 04/19] add distclean target and gitignore more

2014-06-11 Thread Andrew Jones
also add a check for config.mak in Makefile Signed-off-by: Andrew Jones Acked-by: Christoffer Dall --- .gitignore | 5 + Makefile | 9 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d6663ec10caf1..775d0dfd8263e 100644 --- a

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 @@ usa

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:42:51PM +0200, Paolo Bonzini wrote: > Il 12/06/2014 12:40, Andrew Jones ha scritto: > >>>> >+if [ -z "$testdir" -a \( "$arch" = "i386" -o "$arch" = "x86_64" \) ]; > >>>> >then

Re: [PATCH v5 06/19] libfdt: Import libfdt source

2014-06-12 Thread Andrew Jones
On Thu, Jun 12, 2014 at 12:44:30PM +0200, Paolo Bonzini wrote: > Il 11/06/2014 16:01, Andrew Jones ha scritto: > >This adds the applicable libfdt source files (unmodified) and a > >README to explain where the source came from. The README says > > > > The code in t

Re: [PATCH v5 09/19] libcflat: add abort() and assert()

2014-06-12 Thread Andrew Jones
On Thu, Jun 12, 2014 at 12:48:16PM +0200, Paolo Bonzini wrote: > Il 11/06/2014 16:01, Andrew Jones ha scritto: > >The test framework may have external dependencies. assert() provides > >the ability to abort when those dependencies aren't met. However, > >assert() should

Re: [PATCH v5 13/19] libcflat: clean up libcflat.h and add string.h

2014-06-12 Thread Andrew Jones
On Thu, Jun 12, 2014 at 12:52:18PM +0200, Paolo Bonzini wrote: > Il 11/06/2014 16:01, Andrew Jones ha scritto: > >Use libgcc's stddef.h and stdint.h, and then remove the redundant > >defines from libcflat.h. Also separate out the string function > >declarations into

Re: [PATCH v5 12/19] Introduce virtio-testdev

2014-06-12 Thread Andrew Jones
On Thu, Jun 12, 2014 at 12:16:18PM +0200, Paolo Bonzini wrote: > Il 11/06/2014 16:01, Andrew Jones ha scritto: > >virtio-testdev is a communication channel to qemu through virtio that > >can be used by test code to send commands. The only command currently > >implemented is E

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

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 &g

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 > --- > x86/unittests.cfg | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/x86/unittests.cfg b/x86/unittests.cfg > index 7930c026a38d6..d78fe0eafe2

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

2014-06-17 Thread Andrew Jones
er as report(msg1, cond1) -> FAIL report_skip(msg2, !cond1, cond1 && cond2) -> SKIP report_skip(msg3, !cond1, cond1 && cond3) -> SKIP Signed-off-by: Andrew Jones --- lib/libcflat.h | 1 + lib/report.c | 34 ++ 2 files changed,

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 &g

[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 --- lib

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

2014-07-11 Thread Andrew Jones
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 [2] http://fpaste.org/117172/ [3] http://fpaste.org/117173/ Andrew Jones (15): libfdt: Import libfdt source libfdt: get libfdt t

[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 Acked-by: Christoffer Dall --- v6: split out string.h [Paolo Bonzini] v4: rewrite strchr w/out use of strlen

[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 Ack

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

2014-07-11 Thread Andrew Jones
. Signed-off-by: Andrew Jones Reviewed-by: Christoffer Dall --- 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 | 272

[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 Reviewed-by: Christoffer Dall --- v6: - switch to using alloc() - s/vmdev/vm_dev/ to be

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

2014-07-11 Thread Andrew Jones
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 + * + * This work is licensed under the terms of the GNU LGPL, version 2. + */ +#include &

[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 --- lib/arm/asm/io.h | 13 + lib/arm/asm/page.h | 34 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/lib/arm/asm/io.h b

[PATCH v6 12/17] arm: initial drop

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

[PATCH v6 17/17] arm: vectors support

2014-07-11 Thread Andrew Jones
. Signed-off-by: Andrew Jones Reviewed-by: Christoffer Dall --- 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 an 8K usr stack v3: - squashed in

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

2014-07-11 Thread Andrew Jones
From: Christoffer Dall Add simple busy-wait spinlock implementation for ARM. Signed-off-by: Christoffer Dall Signed-off-by: Andrew Jones --- config/config-arm.mak | 3 ++- lib/arm/asm/spinlock.h | 9 ++--- lib/arm/spinlock.c | 28 3 files changed, 32

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

2014-07-11 Thread Andrew Jones
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 +# + +define se

[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 --- lib/alloc.c | 2 ++ lib/alloc.h | 31 +++ 2 files

[PATCH v6 10/17] Introduce chr-testdev

2014-07-11 Thread Andrew Jones
ned-off-by: Andrew Jones --- 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 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 Signed-off-by: Andrew Jones --- lib/arm/asm/io.h | 57

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

2014-07-11 Thread Andrew Jones
cture specific versions placed in lib/$ARCH/asm/. Signed-off-by: Andrew Jones Acked-by: Christoffer Dall --- 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 to io.h (was libio.[ch]) only - get r

[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 --- 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 f00f4d3e68fe1

[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 --- lib/virtio.c | 177 +++ lib/virtio.h | 107 +++- 2 files changed, 282 insertions(+), 2 dele

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

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_

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 l

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 f

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

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 remain

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 */ >

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

2014-07-16 Thread Andrew Jones
by's, and mainly 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 Jon

[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 --- 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 f00f4d3e68fe1

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

2014-07-16 Thread Andrew Jones
cture specific versions placed in lib/$ARCH/asm/. Signed-off-by: Andrew Jones Acked-by: Christoffer Dall --- 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 to io.h (was libio.[ch]) only - get r

[PATCH v7 14/14] arm: vectors support

2014-07-16 Thread Andrew Jones
+file = selftest.flat +extra_params = -append 'vectors-usr' +groups = selftest diff --git a/config/config-arm.mak b/config/config-arm.mak index f03b96d4c50c5..8a274c50332b0 100644 --- a/config/config-arm.mak +++ b/config/config-arm.mak @@ -41,7 +41,8 @@ cflatobjs += \ lib/chr-t

[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 --- v7: - {alloc,alloc_aligned} -> {calloc,memalign} - changes now split between virtio.* and virtio-mmio.* files --- lib/virtio-mmio

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

2014-07-16 Thread Andrew Jones
From: Christoffer Dall 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 Signed-off-by: Andrew Jones --- lib/arm/asm/io.h | 57

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

2014-07-16 Thread Andrew Jones
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 +# + +define se

[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 --- lib/arm/asm/io.h | 13 + lib/arm/asm/page.h | 34 +- 2 files changed, 46 insertions(+), 1 deletion(-) diff --git a/lib/arm/asm/io.h b

[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 Reviewed-by: Christoffer Dall --- v7: - s/alloc/calloc/ - split into virtio.[ch] and virtio

[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 --- 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 Reviewed-by: Christoffer Dall --- 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 string

[PATCH v7 08/14] Introduce chr-testdev

2014-07-16 Thread Andrew Jones
ned-off-by: Andrew Jones --- 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 Add simple busy-wait spinlock implementation for ARM. Signed-off-by: Christoffer Dall Signed-off-by: Andrew Jones --- config/config-arm.mak | 3 ++- lib/arm/asm/spinlock.h | 9 ++--- lib/arm/spinlock.c | 28 3 files changed, 32

[PATCH v7 09/14] arm: initial drop

2014-07-16 Thread Andrew Jones
onfigure --cross-prefix=arm-linux-gnu- --arch=arm make ./run_tests.sh Signed-off-by: Andrew Jones Reviewed-by: Christoffer Dall --- v7: - remove memregions (reworked them as phys_alloc in lib/alloc) - selftest: non-functional change: s/argv[i]/var/ - lib/argv:setup_args don't derefe

Re: [PATCH v7 08/14] Introduce chr-testdev

2014-07-16 Thread Andrew Jones
On Wed, Jul 16, 2014 at 05:31:33AM -0400, Levente Kurusa wrote: > - Original Message - > > [...] > > +void chr_testdev_exit(int code) > > +{ > > + char buf[8]; > > + int len; > > + > > + snprintf(buf, sizeof(buf), "%dq", code); > > + len = strlen(buf); > > AFAIK, snprintf returns t

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

2014-07-16 Thread Andrew Jones
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, A

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

2014-07-24 Thread Andrew Jones
ch of this series. Other hypervisor guest types may find it useful as well. Signed-off-by: Ulrich Obergfell Signed-off-by: Andrew Jones --- include/linux/nmi.h | 9 + kernel/watchdog.c | 45 +++-- 2 files changed, 52 insertions(+), 2 deletio

[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
== 0 || cpu0_err) pr_info("enabled on all CPUs, ...") The patch avoids this by clearing cpu0_err in watchdog_nmi_disable(). Signed-off-by: Ulrich Obergfell Signed-off-by: Andrew Jones --- kernel/watchdog.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/watchdo

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

2014-07-24 Thread Andrew Jones
ned-off-by: Andrew Jones --- 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 @@ -35,6 +35,7 @@ #include #include

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" > > To: linux-ker...@vger.kernel.org, kvm@vger.kernel.org > > Cc: uober...@redhat.com, dzic...@redhat.com, pbonz...@redhat.com,

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

2014-08-08 Thread Andrew Jones
ch of this series. Other hypervisor guest types may find it useful as well. Signed-off-by: Ulrich Obergfell Signed-off-by: Andrew Jones --- v2: don't override hardlockup detector setting when just changing the threshold [Uli and Don] --- include/linux/

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

2014-09-15 Thread Andrew Jones
n on A15's it's not clear 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 --- lib/arm/asm/setup.h | 2 ++ lib/arm/setup.c

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 a

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

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 > &

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 > > &g

  1   2   3   4   5   6   >