[PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock

2015-02-24 Thread Raghavendra K T
Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does: prev = *lock; add_smp(&lock->tickets.head, TICKET_LOCK_INC); /* add_smp() is a full mb() */ if (unlikely(lock->tickets.tail & TICKET_

[PATCH] MIPS: KVM: Fix trace event to save PC directly

2015-02-24 Thread James Hogan
Currently the guest exit trace event saves the VCPU pointer to the structure, and the guest PC is retrieved by dereferencing it when the event is printed rather than directly from the trace record. This isn't safe as the printing may occur long afterwards, after the PC has changed and potentially a

Re: [PATCH] MIPS: KVM: Fix trace event to save PC directly

2015-02-24 Thread Steven Rostedt
On Tue, 24 Feb 2015 11:46:20 + James Hogan wrote: > Lets save the actual PC in the structure so that the correct value is > accessible later. > > Fixes: 669e846e6c4e ("KVM/MIPS32: MIPS arch specific APIs for KVM") > Signed-off-by: James Hogan > Cc: Paolo Bonzini > Cc: Ralf Baechle > Cc:

Re: [PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock

2015-02-24 Thread Greg KH
On Tue, Feb 24, 2015 at 02:54:59PM +0530, Raghavendra K T wrote: > Paravirt spinlock clears slowpath flag after doing unlock. > As explained by Linus currently it does: > prev = *lock; > add_smp(&lock->tickets.head, TICKET_LOCK_INC); > > /* add_smp()

Re: [PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock

2015-02-24 Thread Ingo Molnar
* Greg KH wrote: > On Tue, Feb 24, 2015 at 02:54:59PM +0530, Raghavendra K T wrote: > > Paravirt spinlock clears slowpath flag after doing unlock. > > As explained by Linus currently it does: > > prev = *lock; > > add_smp(&lock->tickets.head, TICKET_LOCK_INC); > >

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-02-24 Thread Andrew Jones
On Fri, Feb 20, 2015 at 04:36:26PM +0100, Andrew Jones wrote: > On Fri, Feb 20, 2015 at 02:37:25PM +, Ard Biesheuvel wrote: > > On 20 February 2015 at 14:29, Andrew Jones wrote: > > > So looks like the 3 orders of magnitude greater number of traps > > > (only to el2) don't impact kernel compil

Re: [PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock

2015-02-24 Thread Greg KH
On Tue, Feb 24, 2015 at 03:47:37PM +0100, Ingo Molnar wrote: > > * Greg KH wrote: > > > On Tue, Feb 24, 2015 at 02:54:59PM +0530, Raghavendra K T wrote: > > > Paravirt spinlock clears slowpath flag after doing unlock. > > > As explained by Linus currently it does: > > > prev = *l

[PATCH] KVM: nVMX: mask unrestricted_guest if disabled on L0

2015-02-24 Thread Radim Krčmář
2015-02-23 19:05+0100, Kashyap Chamarthy: > Tested with the _correct_ Kernel[1] (that has Radim's patch) now -- > applied it on both L0 and L1. > > Result: Same as before -- Booting L2 causes L1 to reboot. However, the > stack trace from `dmesg` on L0 is took slightly different path than >

[PATCH] vhost: drop hard-coded num_buffers size

2015-02-24 Thread Michael S. Tsirkin
The 2 that we use for copy_to_iter comes from sizeof(u16), it used to be that way before the iov iter update. Fix it up, making it obvious the size of stack access is right. Signed-off-by: Michael S. Tsirkin --- drivers/vhost/net.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --

Re: [PATCH] KVM: nVMX: mask unrestricted_guest if disabled on L0

2015-02-24 Thread Jan Kiszka
On 2015-02-24 17:30, Radim Krčmář wrote: > 2015-02-23 19:05+0100, Kashyap Chamarthy: >> Tested with the _correct_ Kernel[1] (that has Radim's patch) now -- >> applied it on both L0 and L1. >> >> Result: Same as before -- Booting L2 causes L1 to reboot. However, the >> stack trace from `dmes

Re: [PATCH] KVM: fix possible coalesced_mmio_ring page leaks.

2015-02-24 Thread Marcelo Tosatti
On Thu, Feb 12, 2015 at 12:58:21PM +0800, Xiubo Li wrote: > It forgets to free coalesced_mmio_ring page after the anon_inode_getfd > fails. > > Signed-off-by: Xiubo Li > --- > virt/kvm/kvm_main.c | 16 +++- > 1 file changed, 11 insertions(+), 5 deletions(-) > > diff --git a/virt/kvm

[PATCH] vhost: cleanup iterator update logic

2015-02-24 Thread Michael S. Tsirkin
Recent iterator-related changes in vhost made it harder to follow the logic fixing up the header. In fact, the fixup always happens at the same offset: sizeof(virtio_net_hdr): sometimes the fixup iterator is updated by copy_to_iter, sometimes-by iov_iter_advance. Rearrange code to make this obviou

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-02-24 Thread Ard Biesheuvel
On 24 February 2015 at 14:55, Andrew Jones wrote: > On Fri, Feb 20, 2015 at 04:36:26PM +0100, Andrew Jones wrote: >> On Fri, Feb 20, 2015 at 02:37:25PM +, Ard Biesheuvel wrote: >> > On 20 February 2015 at 14:29, Andrew Jones wrote: >> > > So looks like the 3 orders of magnitude greater number

Re: [PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock

2015-02-24 Thread Raghavendra K T
On 02/24/2015 08:17 PM, Ingo Molnar wrote: * Greg KH wrote: On Tue, Feb 24, 2015 at 02:54:59PM +0530, Raghavendra K T wrote: Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does: prev = *lock; add_smp(&lock->tick

Re: [PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock

2015-02-24 Thread Raghavendra K T
On 02/24/2015 08:50 PM, Greg KH wrote: On Tue, Feb 24, 2015 at 03:47:37PM +0100, Ingo Molnar wrote: * Greg KH wrote: On Tue, Feb 24, 2015 at 02:54:59PM +0530, Raghavendra K T wrote: Paravirt spinlock clears slowpath flag after doing unlock. As explained by Linus currently it does:

Re: [PATCH] KVM: nVMX: mask unrestricted_guest if disabled on L0

2015-02-24 Thread Bandan Das
Jan Kiszka writes: > On 2015-02-24 17:30, Radim Krčmář wrote: >> 2015-02-23 19:05+0100, Kashyap Chamarthy: >>> Tested with the _correct_ Kernel[1] (that has Radim's patch) now -- >>> applied it on both L0 and L1. >>> >>> Result: Same as before -- Booting L2 causes L1 to reboot. However, the >>>

Re: [PATCH for stable] x86/spinlocks/paravirt: Fix memory corruption on unlock

2015-02-24 Thread Greg KH
On Tue, Feb 24, 2015 at 11:49:13PM +0530, Raghavendra K T wrote: > On 02/24/2015 08:17 PM, Ingo Molnar wrote: > > > >* Greg KH wrote: > > > >>On Tue, Feb 24, 2015 at 02:54:59PM +0530, Raghavendra K T wrote: > >>>Paravirt spinlock clears slowpath flag after doing unlock. > >>>As explained by Linus

Re: [RFC/RFT PATCH 0/3] arm64: KVM: work around incoherency with uncached guest mappings

2015-02-24 Thread Andrew Jones
On Tue, Feb 24, 2015 at 05:47:19PM +, Ard Biesheuvel wrote: > On 24 February 2015 at 14:55, Andrew Jones wrote: > > On Fri, Feb 20, 2015 at 04:36:26PM +0100, Andrew Jones wrote: > >> On Fri, Feb 20, 2015 at 02:37:25PM +, Ard Biesheuvel wrote: > >> > On 20 February 2015 at 14:29, Andrew Jon

[PATCH] KVM: Get rid of kvm_kvfree()

2015-02-24 Thread Thomas Huth
kvm_kvfree() provides exactly the same functionality as the new common kvfree() function - so let's simply replace the kvm function with the common function. Signed-off-by: Thomas Huth --- arch/x86/kvm/x86.c |8 include/linux/kvm_host.h |1 - virt/kvm/kvm_main.c | 1

Re: [PATCH] KVM: Get rid of kvm_kvfree()

2015-02-24 Thread Bandan Das
Thomas Huth writes: > kvm_kvfree() provides exactly the same functionality as the > new common kvfree() function - so let's simply replace the > kvm function with the common function. I assumed there would be a wrapper kvzalloc as well, seems not :) > Signed-off-by: Thomas Huth > --- > arch/x

Re: [PATCH] x86: svm: don't intercept CR0 TS or MP bit write

2015-02-24 Thread Joel Schopp
>> -clr_cr_intercept(svm, INTERCEPT_CR0_WRITE); >> } else { >> set_cr_intercept(svm, INTERCEPT_CR0_READ); > (There is no point in checking fpu_active if cr0s are equal.) > >> -set_cr_intercept(svm, INTERCEPT_CR0_WRITE); > KVM uses lazy FPU and the state is

Qemu and virtio 1.0

2015-02-24 Thread Rusty Russell
OK, I am trying to experiment with virtio 1.0 support using the latest kernel and MST's qemu tree: https://git.kernel.org/cgit/virt/kvm/mst/qemu.git/?h=virtio-1.0 The first issue is that the device config endian was wrong (see attached patch). I'm now setting up a BE guest on my x86 lapt