Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Bandan Das
Paolo Bonzini writes: > On 10/12/2015 18:58, Bandan Das wrote: >>> > Allowing userspace to stop the guest with an emulation failure is a >> This one I don't :) Userspace started the guest after all, there are other >> ways for it to kill the guest if it wanted to. > > I mean

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 19:09, Borislav Petkov wrote: > On Thu, Dec 10, 2015 at 06:38:57PM +0100, Paolo Bonzini wrote: >> Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a >> lockdep splat. >> >> Cc: sta...@vger.kernel.org >> Reported-by: Borislav Petkov >>

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Alexander Duyck
On Thu, Dec 10, 2015 at 8:11 AM, Michael S. Tsirkin wrote: > On Thu, Dec 10, 2015 at 10:38:32PM +0800, Lan, Tianyu wrote: >> >> >> On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: >> >>Ideally, it is able to leave guest driver unmodified but it requires the >> >>>hypervisor

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Paolo Bonzini
> Paolo Bonzini writes: > > On 10/12/2015 18:58, Bandan Das wrote: > >>> > Allowing userspace to stop the guest with an emulation failure is a > >> This one I don't :) Userspace started the guest after all, there are other > >> ways for it to kill the guest if it wanted to. >

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Paolo Bonzini
On 09/12/2015 23:18, Bandan Das wrote: > Commit a2b9e6c1a35afcc09: > > KVM: x86: Don't report guest userspace emulation error to userspace > > Commit fc3a9157d314 ("KVM: X86: Don't report L2 emulation failures to > user-space") disabled the reporting of L2 (nested guest)

Re: [PATCH 3/5] x86/vdso: Get pvclock data from the vvar VMA instead of the fixmap

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 00:12, Andy Lutomirski wrote: > Signed-off-by: Andy Lutomirski > --- > arch/x86/entry/vdso/vclock_gettime.c | 20 > arch/x86/entry/vdso/vdso-layout.lds.S | 3 ++- > arch/x86/entry/vdso/vdso2c.c | 3 +++ > arch/x86/entry/vdso/vma.c

Re: [PATCH 5/5] x86/vdso: Enable vdso pvclock access on all vdso variants

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 00:12, Andy Lutomirski wrote: > Now that pvclock doesn't require access to the fixmap, all vdso > variants can use it. > > The kernel side isn't wired up for 32-bit kernels yet, but this > covers 32-bit and x32 userspace on 64-bit kernels. > > Signed-off-by: Andy Lutomirski

Re: live migration vs device assignment (motivation)

2015-12-10 Thread Michael S. Tsirkin
On Thu, Dec 10, 2015 at 11:04:54AM +0800, Lan, Tianyu wrote: > > On 12/10/2015 4:07 AM, Michael S. Tsirkin wrote: > >On Thu, Dec 10, 2015 at 12:26:25AM +0800, Lan, Tianyu wrote: > >>On 12/8/2015 12:50 AM, Michael S. Tsirkin wrote: > >>>I thought about what this is doing at the high level, and I

Re: [PATCH 4/5] x86/vdso: Remove pvclock fixmap machinery

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 00:12, Andy Lutomirski wrote: > Signed-off-by: Andy Lutomirski > --- > arch/x86/entry/vdso/vclock_gettime.c | 1 - > arch/x86/entry/vdso/vma.c| 1 + > arch/x86/include/asm/fixmap.h| 5 - > arch/x86/include/asm/pvclock.h | 5 -

Re: [PATCH 2/5] x86, vdso, pvclock: Simplify and speed up the vdso pvclock reader

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 00:12, Andy Lutomirski wrote: > From: Andy Lutomirski > > The pvclock vdso code was too abstracted to understand easily and > excessively paranoid. Simplify it for a huge speedup. > > This opens the door for additional simplifications, as the vdso no >

[Bug 107561] 4.2 breaks PCI passthrough in QEMU/KVM

2015-12-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107561 --- Comment #10 from Paolo Bonzini --- Another test on the 3GB machine: make it fast by nuking kvm_mtrr_get_guest_memory_type (return MTRR_TYPE_WRBACK), then cat /proc/mtrr from the guest. -- You are receiving this mail

[Bug 107561] 4.2 breaks PCI passthrough in QEMU/KVM

2015-12-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107561 --- Comment #11 from Paolo Bonzini --- Created attachment 197071 --> https://bugzilla.kernel.org/attachment.cgi?id=197071=edit OVMF log > 1) providing host dmesg Of course this makes no sense, you already did. And from the

Re: [PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko

2015-12-10 Thread Alex Bennée
Stefan Hajnoczi writes: > From: Asias He > > VM sockets virtio transport implementation. This module runs in guest > kernel. checkpatch warns on a bunch of whitespace/tab issues. > > Signed-off-by: Asias He > Signed-off-by: Stefan

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Bandan Das
Paolo Bonzini writes: >> Paolo Bonzini writes: >> > On 10/12/2015 18:58, Bandan Das wrote: >> >>> > Allowing userspace to stop the guest with an emulation failure is a >> >> This one I don't :) Userspace started the guest after all, there are other >>

[Bug 107561] 4.2 breaks PCI passthrough in QEMU/KVM

2015-12-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107561 --- Comment #9 from Paolo Bonzini --- Can you try the following on HostA: 1) providing *host* dmesg 2) disabling each MTRR starting from the first, until things are fast again. Then reboot and try disabling only the MTRR that

[Bug 107561] 4.2 breaks PCI passthrough in QEMU/KVM

2015-12-10 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107561 --- Comment #12 from Paolo Bonzini --- Created attachment 197081 --> https://bugzilla.kernel.org/attachment.cgi?id=197081=edit patch to be tested The bug happens when the VM is created with a maxphyaddr that doesn't match the

[PATCH] KVM: arm/arm64: vgic: Fix kvm_vgic_map_is_active's dist check

2015-12-10 Thread Christoffer Dall
External inputs to the vgic from time to time need to poke into the state of a virtual interrupt, the prime example is the architected timer code. Since the IRQ's active state can be represented in two places; the LR or the distributor, we first loop over the LRs but if not active in the LRs we

[PATCH 01/11] qapi: Rename qjson.h to qobject-json.h

2015-12-10 Thread Eric Blake
We have two different JSON visitors in the tree; and having both named 'qjson.h' can cause include confusion. Rename the qapi version. Kill trailing whitespace in the renamed tests/check-qobject-json.c to keep checkpatch.pl happy. Signed-off-by: Eric Blake --- MAINTAINERS

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Dr. David Alan Gilbert
* Yang Zhang (yang.zhang...@gmail.com) wrote: > On 2015/12/10 18:18, Dr. David Alan Gilbert wrote: > >* Lan, Tianyu (tianyu@intel.com) wrote: > >>On 12/8/2015 12:50 AM, Michael S. Tsirkin wrote: > >>>I thought about what this is doing at the high level, and I do have some > >>>value in what

Re: [PATCH v6 10/21] KVM: ARM64: Add access handler for PMEVCNTRn and PMCCNTR register

2015-12-10 Thread Shannon Zhao
Hi Marc, On 2015/12/9 0:30, Marc Zyngier wrote: > On 08/12/15 12:47, Shannon Zhao wrote: >> > From: Shannon Zhao >> > >> > Since the reset value of PMEVCNTRn or PMCCNTR is UNKNOWN, use >> > reset_unknown for its reset handler. Add access handler which emulates >> >

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Dr. David Alan Gilbert
* Lan, Tianyu (tianyu@intel.com) wrote: > On 12/8/2015 12:50 AM, Michael S. Tsirkin wrote: > >I thought about what this is doing at the high level, and I do have some > >value in what you are trying to do, but I also think we need to clarify > >the motivation a bit more. What you are saying

Re: [PATCH v6 10/21] KVM: ARM64: Add access handler for PMEVCNTRn and PMCCNTR register

2015-12-10 Thread Marc Zyngier
Hi Shannon, On 10/12/15 11:36, Shannon Zhao wrote: > Hi Marc, > > On 2015/12/9 0:30, Marc Zyngier wrote: >> On 08/12/15 12:47, Shannon Zhao wrote: From: Shannon Zhao Since the reset value of PMEVCNTRn or PMCCNTR is UNKNOWN, use reset_unknown for its

Re: [PATCH v3 1/4] VSOCK: Introduce virtio-vsock-common.ko

2015-12-10 Thread Alex Bennée
Stefan Hajnoczi writes: > From: Asias He > > This module contains the common code and header files for the following > virtio-vsock and virtio-vhost kernel modules. General comment checkpatch has a bunch of warnings about 80 character limits, extra

Re: [PATCH] vgaarb: fix signal handling in vga_get()

2015-12-10 Thread David Herrmann
Hi On Mon, Nov 30, 2015 at 3:17 AM, Kirill A. Shutemov wrote: > There are few defects in vga_get() related to signal hadning: > > - we shouldn't check for pending signals for TASK_UNINTERRUPTIBLE > case; > > - if we found pending signal we must remove ourself from

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Yang Zhang
On 2015/12/10 18:18, Dr. David Alan Gilbert wrote: * Lan, Tianyu (tianyu@intel.com) wrote: On 12/8/2015 12:50 AM, Michael S. Tsirkin wrote: I thought about what this is doing at the high level, and I do have some value in what you are trying to do, but I also think we need to clarify the

Re: freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 17:44, Borislav Petkov wrote: > Yap, > > this is clearly a qemu/kvm issue. Lemme remove ext4 folks from CC. So > here's what happens: > > I boot a kvm guest, connect to its monitor (qemu is started with > "-monitor pty") and on the monitor I issue a couple of times the "nmi" >

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Bandan Das
Paolo Bonzini writes: > On 09/12/2015 23:18, Bandan Das wrote: >> Commit a2b9e6c1a35afcc09: >> >> KVM: x86: Don't report guest userspace emulation error to userspace >> >> Commit fc3a9157d314 ("KVM: X86: Don't report L2 emulation failures to >> user-space")

Re: x86: Don't report guest userspace emulation error to userspace, why ?

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 18:58, Bandan Das wrote: >> > Allowing userspace to stop the guest with an emulation failure is a > This one I don't :) Userspace started the guest after all, there are other > ways for it to kill the guest if it wanted to. I mean allowing guest userspace to stop the guest. Paolo

Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-10 Thread Borislav Petkov
On Thu, Dec 10, 2015 at 06:38:57PM +0100, Paolo Bonzini wrote: > Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a > lockdep splat. > > Cc: sta...@vger.kernel.org > Reported-by: Borislav Petkov > Signed-off-by: Paolo Bonzini > --- >

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Alexander Duyck
On Thu, Dec 10, 2015 at 6:38 AM, Lan, Tianyu wrote: > > > On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: >>> >>> Ideally, it is able to leave guest driver unmodified but it requires the >>> >hypervisor or qemu to aware the device which means we may need a driver >>> >

Re: freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Paolo Bonzini
On 10/12/2015 17:53, Borislav Petkov wrote: > Just did, there it splats even when booting the guest, without even > injecting NMIs: > > [ 113.233992] === > [ 113.238192] [ INFO: suspicious RCU usage. ] > [ 113.242393] 4.4.0-rc4+ #1 Not tainted > [ 113.246056]

[Patch V2 1/2] x86,mce: Basic support to add LMCE support to QEMU

2015-12-10 Thread Ashok Raj
This patch adds basic enumeration, control msr's required to support Local Machine Check Exception Support (LMCE). - Added Local Machine Check definitions, changed MCG_CAP - Added support for IA32_FEATURE_CONTROL. - When delivering MCE to guest, we deliver to just a single CPU when guest OS has

[Patch V2 2/2] x86, mce: Need to translate GPA to HPA to inject error in guest.

2015-12-10 Thread Ashok Raj
From: Gong Chen When we need to test error injection to a specific address using EINJ, there needs to be a way to translate GPA to HPA. This will allow host EINJ to inject error to test how guest behavior is when a bad address is consumed. This permits guest OS to perform

Re: [PATCH v3 07/22] arm64: KVM: Implement system register save/restore

2015-12-10 Thread Mario Smarduch
Hi Marc, On 12/7/2015 2:53 AM, Marc Zyngier wrote: > Implement the system register save/restore as a direct translation of > the assembly code version. > > Signed-off-by: Marc Zyngier > Reviewed-by: Christoffer Dall > --- >

Re: [PATCH v3 1/4] VSOCK: Introduce virtio-vsock-common.ko

2015-12-10 Thread Stefan Hajnoczi
On Thu, Dec 10, 2015 at 10:17:07AM +, Alex Bennée wrote: > Stefan Hajnoczi writes: > > > From: Asias He > > > > This module contains the common code and header files for the following > > virtio-vsock and virtio-vhost kernel modules. > > General

Re: [PATCH v3 2/4] VSOCK: Introduce virtio-vsock.ko

2015-12-10 Thread Stefan Hajnoczi
On Thu, Dec 10, 2015 at 09:23:25PM +, Alex Bennée wrote: > Stefan Hajnoczi writes: > > > From: Asias He > > > > VM sockets virtio transport implementation. This module runs in guest > > kernel. > > checkpatch warns on a bunch of whitespace/tab issues.

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Yang Zhang
On 2015/12/10 19:41, Dr. David Alan Gilbert wrote: * Yang Zhang (yang.zhang...@gmail.com) wrote: On 2015/12/10 18:18, Dr. David Alan Gilbert wrote: * Lan, Tianyu (tianyu@intel.com) wrote: On 12/8/2015 12:50 AM, Michael S. Tsirkin wrote: I thought about what this is doing at the high

Re: [PATCH v6 10/21] KVM: ARM64: Add access handler for PMEVCNTRn and PMCCNTR register

2015-12-10 Thread Shannon Zhao
On 2015/12/10 20:07, Marc Zyngier wrote: > Hi Shannon, > > On 10/12/15 11:36, Shannon Zhao wrote: >> > Hi Marc, >> > >> > On 2015/12/9 0:30, Marc Zyngier wrote: >>> >> On 08/12/15 12:47, Shannon Zhao wrote: > From: Shannon Zhao > > Since the

Re: freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Borislav Petkov
On Thu, Dec 10, 2015 at 05:49:10PM +0100, Paolo Bonzini wrote: > Can you try it on Intel? Just did, there it splats even when booting the guest, without even injecting NMIs: [ 113.233992] === [ 113.238192] [ INFO: suspicious RCU usage. ] [ 113.242393] 4.4.0-rc4+ #1

[PATCH] kvm: x86: move tracepoints outside extended quiescent state

2015-12-10 Thread Paolo Bonzini
Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a lockdep splat. Cc: sta...@vger.kernel.org Reported-by: Borislav Petkov Signed-off-by: Paolo Bonzini --- arch/x86/kvm/svm.c | 4 ++-- arch/x86/kvm/vmx.c | 3 ++- arch/x86/kvm/x86.c | 2 +- 3

[PATCH v2] kvm: x86: move tracepoints outside extended quiescent state

2015-12-10 Thread Paolo Bonzini
Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a lockdep splat. Cc: sta...@vger.kernel.org Reported-by: Borislav Petkov Signed-off-by: Paolo Bonzini --- arch/x86/kvm/svm.c | 4 ++-- arch/x86/kvm/vmx.c | 3 ++- arch/x86/kvm/x86.c | 4 ++--

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Lan, Tianyu
On 12/11/2015 12:11 AM, Michael S. Tsirkin wrote: On Thu, Dec 10, 2015 at 10:38:32PM +0800, Lan, Tianyu wrote: On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: Ideally, it is able to leave guest driver unmodified but it requires the hypervisor or qemu to aware the device which means

Re: [PATCH 2/5] x86, vdso, pvclock: Simplify and speed up the vdso pvclock reader

2015-12-10 Thread Ingo Molnar
* Paolo Bonzini wrote: > > > On 10/12/2015 00:12, Andy Lutomirski wrote: > > From: Andy Lutomirski > > > > The pvclock vdso code was too abstracted to understand easily and > > excessively paranoid. Simplify it for a huge speedup. > > > > This

Re: live migration vs device assignment (motivation)

2015-12-10 Thread Lan, Tianyu
On 12/10/2015 4:38 PM, Michael S. Tsirkin wrote: Let's assume you do save state and do have a way to detect whether state matches a given hardware. For example, driver could store firmware and hardware versions in the state, and then on destination, retrieve them and compare. It will be pretty

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Lan, Tianyu
On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: Ideally, it is able to leave guest driver unmodified but it requires the >hypervisor or qemu to aware the device which means we may need a driver in >hypervisor or qemu to handle the device on behalf of guest driver. Can you answer the

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Michael S. Tsirkin
On Thu, Dec 10, 2015 at 10:38:32PM +0800, Lan, Tianyu wrote: > > > On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: > >>Ideally, it is able to leave guest driver unmodified but it requires the > >>>hypervisor or qemu to aware the device which means we may need a driver in > >>>hypervisor or

Re: [Qemu-devel] live migration vs device assignment (motivation)

2015-12-10 Thread Dr. David Alan Gilbert
* Lan, Tianyu (tianyu@intel.com) wrote: > > > On 12/10/2015 7:41 PM, Dr. David Alan Gilbert wrote: > >>Ideally, it is able to leave guest driver unmodified but it requires the > >>>hypervisor or qemu to aware the device which means we may need a driver in > >>>hypervisor or qemu to handle

Re: freeze host when injecting NMIs in the guest, at least in 4.4-rc4+

2015-12-10 Thread Borislav Petkov
Yap, this is clearly a qemu/kvm issue. Lemme remove ext4 folks from CC. So here's what happens: I boot a kvm guest, connect to its monitor (qemu is started with "-monitor pty") and on the monitor I issue a couple of times the "nmi" command. It doesn't explode immediately but it happens pretty