Re: [Qemu-devel] [PATCH v3 5/6] target-i386: Don't enable nested VMX by default

2014-10-30 Thread Paolo Bonzini
Here I'm less certain what the best approach is. As you point out, there's an inconsistency that I agree should be fixed. I wonder however whether an approach similar to 3/6 for KVM only would be better? I.e., have VMX as a sometimes-KVM-supported feature be listed in the model and filter it

Re: [Qemu-devel] [PATCH RFC 07/11] dataplane: allow virtio-1 devices

2014-10-30 Thread Cornelia Huck
On Tue, 28 Oct 2014 16:22:54 +0100 Greg Kurz gk...@linux.vnet.ibm.com wrote: On Tue, 7 Oct 2014 16:40:03 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: Handle endianness conversion for virtio-1 virtqueues correctly. Note that dataplane now needs to be built per-target. It

Re: Benchmarking for vhost polling patch

2014-10-30 Thread Zhang Haoyu
Hi Michael, Following the polling patch thread: http://marc.info/?l=kvmm=140853271510179w=2, I changed poll_stop_idle to be counted in micro seconds, and carried out experiments using varying sizes of this value. The setup for netperf consisted of 1 vm and 1 vhost , each running on

Re: [PATCH 00/17] RFC: userfault v2

2014-10-30 Thread zhanghailiang
On 2014/10/30 1:46, Andrea Arcangeli wrote: Hi Zhanghailiang, On Mon, Oct 27, 2014 at 05:32:51PM +0800, zhanghailiang wrote: Hi Andrea, Thanks for your hard work on userfault;) This is really a useful API. I want to confirm a question: Can we support distinguishing between writing and

Re: [PATCH v12 1/6] KVM: Add architecture-defined TLB flush support

2014-10-30 Thread Cornelia Huck
On Wed, 22 Oct 2014 15:34:06 -0700 Mario Smarduch m.smard...@samsung.com wrote: This patch adds support for architecture implemented VM TLB flush, currently ARMv7 defines HAVE_KVM_ARCH_TLB_FLUSH_ALL. This leaves other architectures unaffected using the generic version. In subsequent patch

Re: [PATCH v12 0/6] arm/KVM: dirty page logging support for ARMv7 (3.17.0-rc1)

2014-10-30 Thread Christian Borntraeger
Am 23.10.2014 00:34, schrieb Mario Smarduch: This patch series introduces dirty page logging for ARMv7 and adds some degree of generic dirty logging support for x86, armv7 and later armv8. I implemented Alex's suggestion after he took a look at the patches at kvm forum to simplify the

Re: Benchmarking for vhost polling patch

2014-10-30 Thread Razya Ladelsky
Zhang Haoyu zhan...@sangfor.com wrote on 30/10/2014 01:30:08 PM: From: Zhang Haoyu zhan...@sangfor.com To: Razya Ladelsky/Haifa/IBM@IBMIL, mst m...@redhat.com Cc: Razya Ladelsky/Haifa/IBM@IBMIL, kvm kvm@vger.kernel.org Date: 30/10/2014 01:30 PM Subject: Re: Benchmarking for vhost polling

Re: [PATCH v12 2/6] KVM: Add generic support for dirty page logging

2014-10-30 Thread Cornelia Huck
On Wed, 22 Oct 2014 15:34:07 -0700 Mario Smarduch m.smard...@samsung.com wrote: This patch defines KVM_GENERIC_DIRTYLOG, and moves dirty log read function to it's own file virt/kvm/dirtylog.c. x86 is updated to use the generic dirty log interface, selecting KVM_GENERIC_DIRTYLOG in its Kconfig

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-30 Thread David Vrabel
On 29/10/14 05:19, Andy Lutomirski wrote: CPUID leaf 4F02H: miscellaneous features [...] ### CommonHV RNG If CPUID.4F02H.EAX is nonzero, then it contains an MSR index used to communicate with a hypervisor random number generator. This

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-30 Thread Paolo Bonzini
On 10/30/2014 01:21 PM, David Vrabel wrote: I would add: If the hypervisor's pool of random data is exhausted, it MAY return 0. The hypervisor MUST provide at least 4 (?) non-zero numbers to each guest. Mandating non-zero numbers sounds like a bad idea. Just use the RNG for what it

Re: [PATCH 00/17] RFC: userfault v2

2014-10-30 Thread Dr. David Alan Gilbert
* zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: On 2014/10/30 1:46, Andrea Arcangeli wrote: Hi Zhanghailiang, On Mon, Oct 27, 2014 at 05:32:51PM +0800, zhanghailiang wrote: Hi Andrea, Thanks for your hard work on userfault;) This is really a useful API. I want to confirm a

[PATCH 3/3] KVM: x86: optimize some accesses to LVTT and SPIV

2014-10-30 Thread Radim Krčmář
We mirror a subset of these registers in separate variables. Using them directly should be faster. Signed-off-by: Radim Krčmář rkrc...@redhat.com --- arch/x86/kvm/lapic.c | 10 +++--- arch/x86/kvm/lapic.h | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git

[PATCH 2/3] KVM: x86: detect LVTT changes under APICv

2014-10-30 Thread Radim Krčmář
APICv traps register writes, so we can't retrieve previous value and omit timer cancelation when mode changes. timer_mode_mask shouldn't be changing as it depends on cpuid. Signed-off-by: Radim Krčmář rkrc...@redhat.com --- #define assign(a, b) (a == b ? false : (a = b, true))

[PATCH 0/3] kvm: APICv register write workaround

2014-10-30 Thread Radim Krčmář
APICv traps register writes, so we can't retrieve previous value, but our code depends on detecting changes. Apart from disabling APIC register virtualization, we can detect the change by using extra memory. One value history is enough, but we still don't want to keep it for every APIC register,

[PATCH 1/3] KVM: x86: detect SPIV changes under APICv

2014-10-30 Thread Radim Krčmář
APICv traps register writes, so we can't retrieve previous value. (A bit of blame on Intel.) This caused a migration bug: LAPIC is enabled, so our restore code correctly lowers apic_sw_enabled, but doesn't increase it after APICv is disabled, so we get below zero when freeing it; resulting in

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-30 Thread Roger Pau Monné
Adding the bhyve guys. El 29/10/14 a les 6.19, Andy Lutomirski ha escrit: Here's a draft CommonHV spec. It's also on github: https://github.com/amluto/CommonHV So far, this provides a two-way RNG interface, a way to detect it, and a way to detect other hypervisor leaves. The latter is

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-30 Thread Andy Lutomirski
On Thu, Oct 30, 2014 at 5:21 AM, David Vrabel david.vra...@citrix.com wrote: On 29/10/14 05:19, Andy Lutomirski wrote: CPUID leaf 4F02H: miscellaneous features [...] ### CommonHV RNG If CPUID.4F02H.EAX is nonzero, then it contains an MSR

Re: [Xen-devel] [RFC] Hypervisor RNG and enumeration

2014-10-30 Thread Ian Campbell
On Thu, 2014-10-30 at 07:45 -0700, Andy Lutomirski wrote: Xen does not have a continual source of entropy and the only feasible way is for the toolstack to provide each guest with a fixed size pool of random data during guest creation. Xen could seed a very simple per-guest DRBG at

[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
Cubietruck seems to be more sensitive than my Midway when attempting to use [ldr|str]ex instructions without caches enabled (mmu disabled). Fix this by making the spinlock implementation (currently the only user of *ex instructions) conditional on the mmu being enabled. Signed-off-by: Andrew

[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

[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

[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

suspicious rcu_dereference_check() usage warning with 3.18-rc2

2014-10-30 Thread Takashi Iwai
Hi, I've got a warning with the latest Linus tree like below: [ INFO: suspicious RCU usage. ] 3.18.0-rc2-test2+ #70 Not tainted --- include/linux/kvm_host.h:474 suspicious rcu_dereference_check() usage! other info that might help us debug this: rcu_scheduler_active

Re: [PATCH RFC 00/11] qemu: towards virtio-1 host support

2014-10-30 Thread Cornelia Huck
On Tue, 28 Oct 2014 06:43:29 +0200 Michael S. Tsirkin m...@redhat.com wrote: On Fri, Oct 24, 2014 at 10:38:39AM +0200, Cornelia Huck wrote: On Fri, 24 Oct 2014 00:42:20 +0300 Michael S. Tsirkin m...@redhat.com wrote: On Tue, Oct 07, 2014 at 04:39:56PM +0200, Cornelia Huck wrote:

Re: [Qemu-devel] [PATCH RFC 05/11] virtio: introduce legacy virtio devices

2014-10-30 Thread Cornelia Huck
On Tue, 28 Oct 2014 16:40:18 +0100 Greg Kurz gk...@linux.vnet.ibm.com wrote: On Tue, 7 Oct 2014 16:40:01 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: Introduce a helper function to indicate whether a virtio device is operating in legacy or virtio standard mode. It may be

Re: [PATCH v12 2/6] KVM: Add generic support for dirty page logging

2014-10-30 Thread Mario Smarduch
On 10/30/2014 05:14 AM, Cornelia Huck wrote: On Wed, 22 Oct 2014 15:34:07 -0700 Mario Smarduch m.smard...@samsung.com wrote: This patch defines KVM_GENERIC_DIRTYLOG, and moves dirty log read function to it's own file virt/kvm/dirtylog.c. x86 is updated to use the generic dirty log

Re: [PATCH v12 0/6] arm/KVM: dirty page logging support for ARMv7 (3.17.0-rc1)

2014-10-30 Thread Mario Smarduch
On 10/30/2014 05:11 AM, Christian Borntraeger wrote: Am 23.10.2014 00:34, schrieb Mario Smarduch: This patch series introduces dirty page logging for ARMv7 and adds some degree of generic dirty logging support for x86, armv7 and later armv8. I implemented Alex's suggestion after he took a

Re: suspicious rcu_dereference_check() usage warning with 3.18-rc2

2014-10-30 Thread Alexei Starovoitov
On Thu, Oct 30, 2014 at 9:44 AM, Takashi Iwai ti...@suse.de wrote: Hi, I've got a warning with the latest Linus tree like below: [ INFO: suspicious RCU usage. ] 3.18.0-rc2-test2+ #70 Not tainted --- include/linux/kvm_host.h:474 suspicious rcu_dereference_check()

Re: [Qemu-devel] [PATCH RFC 05/11] virtio: introduce legacy virtio devices

2014-10-30 Thread Greg Kurz
On Thu, 30 Oct 2014 19:02:01 +0100 Cornelia Huck cornelia.h...@de.ibm.com wrote: On Tue, 28 Oct 2014 16:40:18 +0100 Greg Kurz gk...@linux.vnet.ibm.com wrote: On Tue, 7 Oct 2014 16:40:01 +0200 Cornelia Huck cornelia.h...@de.ibm.com wrote: Introduce a helper function to indicate

Re: [PATCH v2 4/6] hw_random: fix unregister race.

2014-10-30 Thread Rusty Russell
Herbert Xu herb...@gondor.apana.org.au writes: On Thu, Sep 18, 2014 at 08:37:45PM +0800, Amos Kong wrote: From: Rusty Russell ru...@rustcorp.com.au The previous patch added one potential problem: we can still be reading from a hwrng when it's unregistered. Add a wait for zero in the

Re: [PATCH 00/17] RFC: userfault v2

2014-10-30 Thread zhanghailiang
On 2014/10/30 20:49, Dr. David Alan Gilbert wrote: * zhanghailiang (zhang.zhanghaili...@huawei.com) wrote: On 2014/10/30 1:46, Andrea Arcangeli wrote: Hi Zhanghailiang, On Mon, Oct 27, 2014 at 05:32:51PM +0800, zhanghailiang wrote: Hi Andrea, Thanks for your hard work on userfault;) This

Re: suspicious rcu_dereference_check() usage warning with 3.18-rc2

2014-10-30 Thread Wanpeng Li
On Thu, Oct 30, 2014 at 05:44:48PM +0100, Takashi Iwai wrote: Hi, I've got a warning with the latest Linus tree like below: [ INFO: suspicious RCU usage. ] 3.18.0-rc2-test2+ #70 Not tainted --- include/linux/kvm_host.h:474 suspicious rcu_dereference_check() usage!

Re: Benchmarking for vhost polling patch

2014-10-30 Thread Zhang Haoyu
Hi Michael, Following the polling patch thread: http://marc.info/? l=kvmm=140853271510179w=2, I changed poll_stop_idle to be counted in micro seconds, and carried out experiments using varying sizes of this value. The setup for netperf consisted of 1 vm and 1 vhost , each

Re: [PATCH 00/17] RFC: userfault v2

2014-10-30 Thread Peter Feiner
On Thu, Oct 30, 2014 at 07:31:48PM +0800, zhanghailiang wrote: On 2014/10/30 1:46, Andrea Arcangeli wrote: On Mon, Oct 27, 2014 at 05:32:51PM +0800, zhanghailiang wrote: I want to confirm a question: Can we support distinguishing between writing and reading memory for userfault? That is, we

Re: [PATCH 00/17] RFC: userfault v2

2014-10-30 Thread zhanghailiang
On 2014/10/31 10:23, Peter Feiner wrote: On Thu, Oct 30, 2014 at 07:31:48PM +0800, zhanghailiang wrote: On 2014/10/30 1:46, Andrea Arcangeli wrote: On Mon, Oct 27, 2014 at 05:32:51PM +0800, zhanghailiang wrote: I want to confirm a question: Can we support distinguishing between writing and

[PATCH] KVM: x86: fix access memslots w/o hold srcu read lock

2014-10-30 Thread Wanpeng Li
The srcu read lock must be held while accessing memslots (e.g. when using gfn_to_* functions), however, commit c24ae0dcd3e8 (kvm: x86: Unpin and remove kvm_arch-apic_access_page) call gfn_to_page() in kvm_vcpu_reload_apic_access_page() w/o hold it which leads to suspicious

Re: [PATCH 00/17] RFC: userfault v2

2014-10-30 Thread zhanghailiang
On 2014/10/31 11:29, zhanghailiang wrote: On 2014/10/31 10:23, Peter Feiner wrote: On Thu, Oct 30, 2014 at 07:31:48PM +0800, zhanghailiang wrote: On 2014/10/30 1:46, Andrea Arcangeli wrote: On Mon, Oct 27, 2014 at 05:32:51PM +0800, zhanghailiang wrote: I want to confirm a question: Can we

Re: [PATCH 00/17] RFC: userfault v2

2014-10-30 Thread Andres Lagar-Cavilla
On Thu, Oct 30, 2014 at 9:38 PM, zhanghailiang zhang.zhanghaili...@huawei.com wrote: On 2014/10/31 11:29, zhanghailiang wrote: On 2014/10/31 10:23, Peter Feiner wrote: On Thu, Oct 30, 2014 at 07:31:48PM +0800, zhanghailiang wrote: On 2014/10/30 1:46, Andrea Arcangeli wrote: On Mon, Oct

Re: [PATCH] KVM: x86: fix access memslots w/o hold srcu read lock

2014-10-30 Thread Chen, Tiejun
On 2014/10/31 12:33, Wanpeng Li wrote: The srcu read lock must be held while accessing memslots (e.g. when using gfn_to_* functions), however, commit c24ae0dcd3e8 (kvm: x86: Unpin and remove kvm_arch-apic_access_page) call gfn_to_page() in kvm_vcpu_reload_apic_access_page() w/o hold it which

Re: [PATCH v12 1/6] KVM: Add architecture-defined TLB flush support

2014-10-30 Thread Cornelia Huck
On Wed, 22 Oct 2014 15:34:06 -0700 Mario Smarduch m.smard...@samsung.com wrote: This patch adds support for architecture implemented VM TLB flush, currently ARMv7 defines HAVE_KVM_ARCH_TLB_FLUSH_ALL. This leaves other architectures unaffected using the generic version. In subsequent patch

Re: [PATCH v12 0/6] arm/KVM: dirty page logging support for ARMv7 (3.17.0-rc1)

2014-10-30 Thread Christian Borntraeger
Am 23.10.2014 00:34, schrieb Mario Smarduch: This patch series introduces dirty page logging for ARMv7 and adds some degree of generic dirty logging support for x86, armv7 and later armv8. I implemented Alex's suggestion after he took a look at the patches at kvm forum to simplify the

Re: [PATCH v12 2/6] KVM: Add generic support for dirty page logging

2014-10-30 Thread Cornelia Huck
On Wed, 22 Oct 2014 15:34:07 -0700 Mario Smarduch m.smard...@samsung.com wrote: This patch defines KVM_GENERIC_DIRTYLOG, and moves dirty log read function to it's own file virt/kvm/dirtylog.c. x86 is updated to use the generic dirty log interface, selecting KVM_GENERIC_DIRTYLOG in its Kconfig

Re: [PATCH v12 2/6] KVM: Add generic support for dirty page logging

2014-10-30 Thread Mario Smarduch
On 10/30/2014 05:14 AM, Cornelia Huck wrote: On Wed, 22 Oct 2014 15:34:07 -0700 Mario Smarduch m.smard...@samsung.com wrote: This patch defines KVM_GENERIC_DIRTYLOG, and moves dirty log read function to it's own file virt/kvm/dirtylog.c. x86 is updated to use the generic dirty log

Re: [PATCH v12 0/6] arm/KVM: dirty page logging support for ARMv7 (3.17.0-rc1)

2014-10-30 Thread Mario Smarduch
On 10/30/2014 05:11 AM, Christian Borntraeger wrote: Am 23.10.2014 00:34, schrieb Mario Smarduch: This patch series introduces dirty page logging for ARMv7 and adds some degree of generic dirty logging support for x86, armv7 and later armv8. I implemented Alex's suggestion after he took a