Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-10-08 Thread Gleb Natapov
On Mon, Oct 06, 2014 at 02:19:32PM -0300, Marcelo Tosatti wrote: On Sat, Oct 04, 2014 at 10:23:32AM +0300, Gleb Natapov wrote: On Tue, Sep 09, 2014 at 12:28:11PM -0300, Marcelo Tosatti wrote: On Mon, Jul 21, 2014 at 04:14:24PM +0300, Gleb Natapov wrote: On Wed, Jul 09, 2014 at 04:12:53PM

nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Jan Kiszka
Hi all, after migrating a Jailhouse VM to a newer host platform with shadow VMCS support I found a bug. As you may know, Jailhouse doesn't intercept interrupts, thus also never requests an interrupt window. Nevertheless: qemu-system-x86-5777 [001] 74970.625324: kvm_mmio: mmio write

Re: [PATCH v2] KVM: x86: some apic broadcast modes does not work

2014-10-08 Thread Paolo Bonzini
Il 06/10/2014 21:08, Radim Krčmář ha scritto: 2014-10-06 18:29+0300, Nadav Amit: On Oct 3, 2014, at 3:49 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-10-03 00:30+0300, Nadav Amit: Reviewed-by: Radim Krčmář rkrc...@redhat.com +#define X2APIC_BROADCAST 0xul (int is better

Re: [PATCH v2 00/15] KVM GICv3 emulation

2014-10-08 Thread Andre Przywara
On 08/10/14 05:08, wanghaibin wrote: On 2014/8/21 21:06, Andre Przywara wrote: GICv3 is the ARM generic interrupt controller designed to overcome some limits of the prevalent GICv2. Most notably it lifts the 8-CPU limit. Though with recent patches from Marc there is support for hosts to

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Paolo Bonzini
Il 08/10/2014 10:29, Jan Kiszka ha scritto: Hi all, after migrating a Jailhouse VM to a newer host platform with shadow VMCS support I found a bug. As you may know, Jailhouse doesn't intercept interrupts, thus also never requests an interrupt window. Nevertheless: qemu-system-x86-5777

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Jan Kiszka
On 2014-10-08 10:47, Paolo Bonzini wrote: Il 08/10/2014 10:29, Jan Kiszka ha scritto: Hi all, after migrating a Jailhouse VM to a newer host platform with shadow VMCS support I found a bug. As you may know, Jailhouse doesn't intercept interrupts, thus also never requests an interrupt window.

Re: [PATCH 3/5] KVM: x86: Decoding guest instructions which cross page boundary may fail

2014-10-08 Thread Paolo Bonzini
Il 07/10/2014 11:15, Nadav Amit ha scritto: On Oct 6, 2014, at 11:50 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-10-03 01:10+0300, Nadav Amit: Once an instruction crosses a page boundary, the size read from the second page disregards the common case that part of the operand resides

Re: [PATCH 5/6] KVM: x86: Wrong assertion on paging_tmpl.h

2014-10-08 Thread Paolo Bonzini
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Il 01/10/2014 19:14, Nadav Amit ha scritto: + ASSERT(!is_long_mode(vcpu) || is_pae(vcpu)); I am ok with removing the assertion. Due to the multiple changes, I lost track what it was supposed to do. Anyhow, removing the second part was required

Re: [PATCH 5/5] KVM: x86: Using TSC deadline may cause multiple interrupts by user writes

2014-10-08 Thread Paolo Bonzini
Il 03/10/2014 00:10, Nadav Amit ha scritto: To solve this situation, ignore host initiated TSC deadline writes that do not change the deadline value. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/kvm/lapic.c | 7 ++- arch/x86/kvm/lapic.h | 3 ++- arch/x86/kvm/x86.c

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Marc Zyngier
On 07/10/14 20:39, Christoffer Dall wrote: On Tue, Oct 07, 2014 at 02:28:43PM +0100, Marc Zyngier wrote: On 07/10/14 11:48, Catalin Marinas wrote: On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote: +/** + * kvm_prealloc_hwpgd - allocate inital table for VTTBR + * @kvm:

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Wanpeng Li
Hi Jan, On Wed, Oct 08, 2014 at 10:29:45AM +0200, Jan Kiszka wrote: Hi all, after migrating a Jailhouse VM to a newer host platform with shadow VMCS support I found a bug. As you may know, Jailhouse doesn't intercept interrupts, thus also never requests an interrupt window. Nevertheless:

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Christoffer Dall
On Wed, Oct 08, 2014 at 10:34:31AM +0100, Marc Zyngier wrote: On 07/10/14 20:39, Christoffer Dall wrote: On Tue, Oct 07, 2014 at 02:28:43PM +0100, Marc Zyngier wrote: On 07/10/14 11:48, Catalin Marinas wrote: On Mon, Oct 06, 2014 at 09:30:25PM +0100, Christoffer Dall wrote: +/** + *

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Catalin Marinas
On Tue, Oct 07, 2014 at 08:39:54PM +0100, Christoffer Dall wrote: I came up with the following based on your feedback, but I personally don't find it a lot easier to read than what I had already. Suggestions are welcome: At least PTRS_PER_S2_PGD and KVM_PREALLOC_LEVEL are clearer to me as

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Christoffer Dall
On Tue, Oct 07, 2014 at 02:40:27PM +0100, Marc Zyngier wrote: Hi Christoffer, On 06/10/14 21:30, Christoffer Dall wrote: This patch adds the necessary support for all host kernel PGSIZE and VA_SPACE configuration options for both EL2 and the Stage-2 page tables. However, for 40bit and

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Jan Kiszka
On 2014-10-08 11:25, Wanpeng Li wrote: Hi Jan, On Wed, Oct 08, 2014 at 10:29:45AM +0200, Jan Kiszka wrote: Hi all, after migrating a Jailhouse VM to a newer host platform with shadow VMCS support I found a bug. As you may know, Jailhouse doesn't intercept interrupts, thus also never

Re: [PATCH 5/5] KVM: x86: Using TSC deadline may cause multiple interrupts by user writes

2014-10-08 Thread Radim Krčmář
2014-10-07 12:35+0300, Nadav Amit: Thanks for reviewing this patch and the rest of the gang. Happy to do so, I've learned a lot. On Oct 6, 2014, at 11:57 PM, Radim Krčmář rkrc...@redhat.com wrote: 2014-10-03 01:10+0300, Nadav Amit: Setting the TSC deadline MSR that are initiated by the

Re: [PATCH 5/5] KVM: x86: Using TSC deadline may cause multiple interrupts by user writes

2014-10-08 Thread Paolo Bonzini
Il 08/10/2014 12:06, Radim Krčmář ha scritto: - why is host_initiated required? Since if the guest writes to the MSR, it means it wants to rearm the TSC deadline. Even if the deadline passed, interrupt should be triggered. MSR isn't 0, so the deadline hasn't passed for the guest yet.

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Paolo Bonzini
Il 08/10/2014 11:51, Jan Kiszka ha scritto: Could you point out where the other places L0 sets CPU_BASED_VIRTUAL_INTR_PENDING before entering L2? enable_irq_window(). I instrumented it, and it showed up right before vmcs12 state became corrupted. But it would write to the vmcs02, not to the

Re: [PATCH v2 1/3] arm64: KVM: Implement 48 VA support for KVM EL2 and Stage-2

2014-10-08 Thread Marc Zyngier
On 08/10/14 10:47, Christoffer Dall wrote: On Wed, Oct 08, 2014 at 10:34:31AM +0100, Marc Zyngier wrote: On 07/10/14 20:39, Christoffer Dall wrote: On Tue, Oct 07, 2014 at 02:28:43PM +0100, Marc Zyngier wrote: On 07/10/14 11:48, Catalin Marinas wrote: On Mon, Oct 06, 2014 at 09:30:25PM +0100,

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Jan Kiszka
On 2014-10-08 12:20, Paolo Bonzini wrote: Il 08/10/2014 11:51, Jan Kiszka ha scritto: Could you point out where the other places L0 sets CPU_BASED_VIRTUAL_INTR_PENDING before entering L2? enable_irq_window(). I instrumented it, and it showed up right before vmcs12 state became corrupted.

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Paolo Bonzini
Il 08/10/2014 12:29, Jan Kiszka ha scritto: But it would write to the vmcs02, not to the shadow VMCS; the shadow VMCS is active during copy_shadow_to_vmcs12/copy_vmcs12_to_shadow, and at no other time. It is not clear to me how the VIRTUAL_INTR_PENDING bit ended up from the vmcs02 (where

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

2014-10-08 Thread Cornelia Huck
On Tue, 07 Oct 2014 18:24:22 -0700 Andy Lutomirski l...@amacapital.net wrote: On 10/07/2014 07:39 AM, Cornelia Huck wrote: This patchset aims to get us some way to implement virtio-1 compliant and transitional devices in qemu. Branch available at git://github.com/cohuck/qemu virtio-1

Re: [PATCHv7 07/26] driver core: amba: add device binding path 'driver_override'

2014-10-08 Thread Antonios Motakis
On Fri, Sep 26, 2014 at 5:37 PM, Russell King - ARM Linux li...@arm.linux.org.uk wrote: On Tue, Sep 23, 2014 at 04:46:06PM +0200, Antonios Motakis wrote: As already demonstrated with PCI [1] and the platform bus [2], a driver_override property in sysfs can be used to bypass the id matching

Re: [[RFC] KVM-S390: Provide guest TOD Clock Get/Set Controls

2014-10-08 Thread Jason J. Herne
This is a reply to the following thread: http://www.spinics.net/lists/kvm/msg108448.html I'm sending it in this fashion because my normal mail client is not allowing me to send it in plain text and the html is getting rejected by the mailing list. Sorry to those of you who received both this and

Re: [[RFC] KVM-S390: Provide guest TOD Clock Get/Set Controls

2014-10-08 Thread Alexander Graf
On 08.10.14 16:09, Jason Herne wrote: Christian Borntraeger borntrae...@de.ibm.com wrote on 09/22/2014 05:08:34 AM: ... Actually, I would expect something different (more or less something like standby/resume). In fact Jasons code that we have internally in testing is doing the simple

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Jan Kiszka
On 2014-10-08 12:34, Paolo Bonzini wrote: Il 08/10/2014 12:29, Jan Kiszka ha scritto: But it would write to the vmcs02, not to the shadow VMCS; the shadow VMCS is active during copy_shadow_to_vmcs12/copy_vmcs12_to_shadow, and at no other time. It is not clear to me how the

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Paolo Bonzini
Il 08/10/2014 17:07, Jan Kiszka ha scritto: As usual, this was a nasty race that involved some concurrent VCPUs and proper host load, so hard to write unit tests... diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 04fa1b8..d6bcaca 100644 --- a/arch/x86/kvm/vmx.c +++

Re: [PATCH kvm-kmod] adjust timekeeping compatibility code

2014-10-08 Thread Jan Kiszka
On 2014-09-30 10:43, Paolo Bonzini wrote: Il 30/09/2014 09:54, Jan Kiszka ha scritto: kvm_get_xtime_nsec could overflow. If we make kvm_get_boot_base_ns compute the equivalent of 3.17's base_mono+offs_boot formula (instead of just offs_boot), we can avoid that and drop kvm_get_xtime_nsec

[PATCH] KVM: nVMX: Disable preemption while reading from shadow VMCS

2014-10-08 Thread Jan Kiszka
In order to access the shadow VMCS, we need to load it. At this point, vmx-loaded_vmcs-vmcs and the actually loaded one start to differ. If we now get preempted by Linux, vmx_vcpu_put and, on return, the vmx_vcpu_load will work against the wrong vmcs. That can cause copy_shadow_to_vmcs12 to

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Jan Kiszka
On 2014-10-08 17:44, Paolo Bonzini wrote: Il 08/10/2014 17:07, Jan Kiszka ha scritto: As usual, this was a nasty race that involved some concurrent VCPUs and proper host load, so hard to write unit tests... diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 04fa1b8..d6bcaca 100644

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-10-08 Thread Marcelo Tosatti
On Wed, Oct 08, 2014 at 09:56:36AM +0300, Gleb Natapov wrote: On Mon, Oct 06, 2014 at 02:19:32PM -0300, Marcelo Tosatti wrote: On Sat, Oct 04, 2014 at 10:23:32AM +0300, Gleb Natapov wrote: On Tue, Sep 09, 2014 at 12:28:11PM -0300, Marcelo Tosatti wrote: On Mon, Jul 21, 2014 at 04:14:24PM

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-10-08 Thread Gleb Natapov
On Wed, Oct 08, 2014 at 02:15:34PM -0300, Marcelo Tosatti wrote: On Wed, Oct 08, 2014 at 09:56:36AM +0300, Gleb Natapov wrote: On Mon, Oct 06, 2014 at 02:19:32PM -0300, Marcelo Tosatti wrote: On Sat, Oct 04, 2014 at 10:23:32AM +0300, Gleb Natapov wrote: On Tue, Sep 09, 2014 at 12:28:11PM

Re: [PATCH] KVM: nVMX: Disable preemption while reading from shadow VMCS

2014-10-08 Thread Bandan Das
Jan Kiszka jan.kis...@siemens.com writes: In order to access the shadow VMCS, we need to load it. At this point, vmx-loaded_vmcs-vmcs and the actually loaded one start to differ. If we now get preempted by Linux, vmx_vcpu_put and, on return, the vmx_vcpu_load will work against the wrong vmcs.

Re: [PATCH] KVM: nVMX: Disable preemption while reading from shadow VMCS

2014-10-08 Thread Jan Kiszka
On 2014-10-08 21:07, Bandan Das wrote: Jan Kiszka jan.kis...@siemens.com writes: In order to access the shadow VMCS, we need to load it. At this point, vmx-loaded_vmcs-vmcs and the actually loaded one start to differ. If we now get preempted by Linux, vmx_vcpu_put and, on return, the

Re: [patch 3/4] KVM: MMU: reload request from GET_DIRTY_LOG path

2014-10-08 Thread Marcelo Tosatti
Argh, lets try again: skip_pinned = true -- mark page dirty, keep spte intact called from get dirty log path. skip_pinned = false --- reload remote mmu destroy pinned spte. called from: dirty log enablement, rmap write protect

Re: [PATCH] KVM: nVMX: Disable preemption while reading from shadow VMCS

2014-10-08 Thread Paolo Bonzini
Il 08/10/2014 18:05, Jan Kiszka ha scritto: In order to access the shadow VMCS, we need to load it. At this point, vmx-loaded_vmcs-vmcs and the actually loaded one start to differ. If we now get preempted by Linux, vmx_vcpu_put and, on return, the vmx_vcpu_load will work against the wrong

Re: [PATCH] KVM: nVMX: Disable preemption while reading from shadow VMCS

2014-10-08 Thread Paolo Bonzini
Il 08/10/2014 21:19, Jan Kiszka ha scritto: Ouch! I apologize if I missed this in the previous discussion but why do we never get into this condition while running a Linux guest ? Well, you need high load on the host, preemption at the wrong time, and some relevant difference between the

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Wanpeng Li
On Wed, Oct 08, 2014 at 05:07:48PM +0200, Jan Kiszka wrote: On 2014-10-08 12:34, Paolo Bonzini wrote: Il 08/10/2014 12:29, Jan Kiszka ha scritto: But it would write to the vmcs02, not to the shadow VMCS; the shadow VMCS is active during copy_shadow_to_vmcs12/copy_vmcs12_to_shadow, and at no

Re: nVMX: Shadowing of CPU_BASED_VM_EXEC_CONTROL broken

2014-10-08 Thread Wanpeng Li
On Thu, Oct 09, 2014 at 07:34:47AM +0800, Wanpeng Li wrote: On Wed, Oct 08, 2014 at 05:07:48PM +0200, Jan Kiszka wrote: On 2014-10-08 12:34, Paolo Bonzini wrote: Il 08/10/2014 12:29, Jan Kiszka ha scritto: But it would write to the vmcs02, not to the shadow VMCS; the shadow VMCS is active

Re: [PATCH] KVM: nVMX: Disable preemption while reading from shadow VMCS

2014-10-08 Thread Wanpeng Li
On Wed, Oct 08, 2014 at 06:05:39PM +0200, Jan Kiszka wrote: In order to access the shadow VMCS, we need to load it. At this point, vmx-loaded_vmcs-vmcs and the actually loaded one start to differ. If we now get preempted by Linux, vmx_vcpu_put and, on return, the vmx_vcpu_load will work against

[PATCH] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT

2014-10-08 Thread Nicholas A. Bellinger
From: Nicholas Bellinger n...@linux-iscsi.org This patch addresses a bug where individual vhost-scsi configfs endpoint groups can be removed from below while active exports to QEMU userspace still exist, resulting in an OOPs. It adds a configfs_depend_item() in vhost_scsi_set_endpoint() to

Re: [PATCH] vhost-scsi: Take configfs group dependency during VHOST_SCSI_SET_ENDPOINT

2014-10-08 Thread Nicholas A. Bellinger
Hi MST Co, Quick question below wrt to this patch.. On Thu, 2014-10-09 at 03:34 +, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org This patch addresses a bug where individual vhost-scsi configfs endpoint groups can be removed from below while active exports

[PATCH 3.10] vhost-net: backport extend device allocation to 3.10

2014-10-08 Thread Dmitry Petuhov
From: Michael S. Tsirkin m...@redhat.com upstream commit 23cc5a991c7a9fb7e6d6550e65cee4f4173111c5 Michael Mueller provided a patch to reduce the size of vhost-net structure as some allocations could fail under memory pressure/fragmentation. We are still left with high order allocations though.