Re: [Qemu-devel] [RFC patch 0/6] vfio based pci pass-through for qemu/KVM on s390

2014-10-02 Thread Frank Blaschka
On Wed, Oct 01, 2014 at 11:26:51AM -0600, Alex Williamson wrote: > On Wed, 2014-10-01 at 11:11 +0200, Frank Blaschka wrote: > > On Fri, Sep 26, 2014 at 01:59:40PM -0600, Alex Williamson wrote: > > > On Fri, 2014-09-26 at 08:45 +0200, Frank Blaschka wrote: > > > > On Wed, Sep 24, 2014 at 10:05:57AM

Re: [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit

2014-10-02 Thread Heiko Carstens
On Wed, Oct 01, 2014 at 08:27:38PM +0200, Christian Borntraeger wrote: > On 10/01/2014 04:17 PM, Alexander Graf wrote: > > > > > > On 01.10.14 16:02, Christian Borntraeger wrote: > >> There is nothing to do for KVM to support TOD-CLOCK steering. > >> > >> Signed-off-by: Christian Borntraeger > >

Re: [GIT PULL 1/2] KVM: s390/facilities: allow TOD-CLOCK steering facility bit

2014-10-02 Thread Christian Borntraeger
Am 02.10.2014 10:22, schrieb Heiko Carstens: > On Wed, Oct 01, 2014 at 08:27:38PM +0200, Christian Borntraeger wrote: >> On 10/01/2014 04:17 PM, Alexander Graf wrote: >>> >>> >>> On 01.10.14 16:02, Christian Borntraeger wrote: There is nothing to do for KVM to support TOD-CLOCK steering.

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

2014-10-02 Thread Paolo Bonzini
Il 01/10/2014 09:40, Jan Kiszka ha scritto: > [50764.182615] Call Trace: > [50764.182633] [] vmx_vcpu_reset+0x20c/0x3b0 [kvm_intel] > [50764.182697] [] kvm_arch_vcpu_setup+0x2c/0x50 [kvm] > [50764.182734] [] kvm_vm_ioctl_create_vcpu+0x84/0x1e0 [kvm] > [50764.182753] [] kvm_vm_ioctl+0x37b/0x520

Re: [GIT PULL 0/2] KVM: s390: Small enhancements for 3.18 (next)

2014-10-02 Thread Paolo Bonzini
Il 01/10/2014 16:02, Christian Borntraeger ha scritto: > git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux.git > tags/kvm-s390-next-20141001 Pulled, thanks. Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org

[PATCH] kvm: do not handle APIC access page if in-kernel irqchip is not in use

2014-10-02 Thread Paolo Bonzini
This fixes the following OOPS: loaded kvm module (v3.17-rc1-168-gcec26bc) BUG: unable to handle kernel paging request at fffe IP: [] put_page+0x9/0x30 PGD 1e15067 PUD 1e17067 PMD 0 Oops: [#1] PREEMPT SMP [] ? kvm_vcpu_reload_apic_access_page+0x5d/0x70 [kvm]

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

2014-10-02 Thread Jan Kiszka
On 2014-10-02 12:12, Paolo Bonzini wrote: > Il 01/10/2014 09:40, Jan Kiszka ha scritto: >> [50764.182615] Call Trace: >> [50764.182633] [] vmx_vcpu_reset+0x20c/0x3b0 [kvm_intel] >> [50764.182697] [] kvm_arch_vcpu_setup+0x2c/0x50 [kvm] >> [50764.182734] [] kvm_vm_ioctl_create_vcpu+0x84/0x1e0 >>

Re: RFC: get_user_pages_locked|unlocked to leverage VM_FAULT_RETRY

2014-10-02 Thread Andrea Arcangeli
On Wed, Oct 01, 2014 at 05:36:11PM +0200, Peter Zijlstra wrote: > For all these and the other _fast() users, is there an actual limit to > the nr_pages passed in? Because we used to have the 64 pages limit from > DIO, but without that we get rather long IRQ-off latencies. Ok, I would tend to think

Re: [PATCH 2/4] mm: gup: add get_user_pages_locked and get_user_pages_unlocked

2014-10-02 Thread Andrea Arcangeli
On Wed, Oct 01, 2014 at 10:06:27AM -0700, Andres Lagar-Cavilla wrote: > On Wed, Oct 1, 2014 at 8:51 AM, Peter Feiner wrote: > > On Wed, Oct 01, 2014 at 10:56:35AM +0200, Andrea Arcangeli wrote: > >> + /* VM_FAULT_RETRY cannot return errors */ > >> + if (!*locked) { > >> +

Re: RFC: get_user_pages_locked|unlocked to leverage VM_FAULT_RETRY

2014-10-02 Thread Peter Zijlstra
On Thu, Oct 02, 2014 at 02:31:17PM +0200, Andrea Arcangeli wrote: > On Wed, Oct 01, 2014 at 05:36:11PM +0200, Peter Zijlstra wrote: > > For all these and the other _fast() users, is there an actual limit to > > the nr_pages passed in? Because we used to have the 64 pages limit from > > DIO, but wit

Re: RFC: get_user_pages_locked|unlocked to leverage VM_FAULT_RETRY

2014-10-02 Thread Peter Zijlstra
On Thu, Oct 02, 2014 at 02:50:52PM +0200, Peter Zijlstra wrote: > On Thu, Oct 02, 2014 at 02:31:17PM +0200, Andrea Arcangeli wrote: > > On Wed, Oct 01, 2014 at 05:36:11PM +0200, Peter Zijlstra wrote: > > > For all these and the other _fast() users, is there an actual limit to > > > the nr_pages pas

[Bug 81841] amd-iommu: kernel BUG & lockup after shutting down KVM guest using PCI passthrough/PCIe bridge

2014-10-02 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=81841 --- Comment #22 from Marti Raudsepp --- Since I did not get further confirmation from Mr. Schopp, I decided to push it and submit a patch: https://lkml.org/lkml/2014/10/2/223 The phrases "Not sure what is going on here" and "should also be isolat

Problems using vfio pcie passthrough (pci-assign works)

2014-10-02 Thread Bruce Cran
I have a PCIe card that's behind an Intel E3-1200 PCIe x16 controller bridge that I want to use in VMs: it works when using the pci-assign driver, but something goes wrong when trying to use vfio-pci - my driver in the guest gets so far through loading before failing to talk to the hardware, so

Re: [RFC] vPMU support for AMD system

2014-10-02 Thread Radim Krčmář
2014-09-30 21:07-0500, Wei Huang: > Hi Paolo and Gleb, > 2. CURRENT DESIGN > The design is similar to existing vPMU support. Many data structures such as > "struct kvm_pmc" and "struct kvm_pmu" are re-used for this design. > > Original pmu.c code was designed with Intel PMU in mind. To avoid the >

Re: [RFC] vPMU support for AMD system

2014-10-02 Thread Wei Huang
(if-else forest is daunting.) I think this approach is quite acceptable, except that there will be many if-else in the code. Not clean enough. (b) Convert intel-pmu.c => vmx.c and convert amd-pmu.c => svm.c * PMU function pointers will be created in kvm_x86_ops; * The entry functions will be c

Re: Problems using vfio pcie passthrough (pci-assign works)

2014-10-02 Thread Alex Williamson
On Thu, 2014-10-02 at 07:39 -0600, Bruce Cran wrote: > I have a PCIe card that's behind an Intel E3-1200 PCIe x16 controller > bridge that I want to use in VMs: it works when using the pci-assign > driver, but something goes wrong when trying to use vfio-pci - my driver > in the guest gets so fa

Re: [Bug 85441] New: [vfio] [lockdep] Deadlock when attempting to unbind device from a running VM

2014-10-02 Thread Bjorn Helgaas
[+ Alex, linux-pci, kvm] On Thu, Oct 2, 2014 at 4:11 AM, wrote: > https://bugzilla.kernel.org/show_bug.cgi?id=85441 > > Bug ID: 85441 >Summary: [vfio] [lockdep] Deadlock when attempting to unbind > device from a running VM >Product: Drivers

Re: [Bug 85441] New: [vfio] [lockdep] Deadlock when attempting to unbind device from a running VM

2014-10-02 Thread Alex Williamson
On Thu, 2014-10-02 at 08:26 -0600, Bjorn Helgaas wrote: > [+ Alex, linux-pci, kvm] > > On Thu, Oct 2, 2014 at 4:11 AM, wrote: > > https://bugzilla.kernel.org/show_bug.cgi?id=85441 > > > > I retried the same using kernel 3.17-rc7; the Python process messing with > > /sys > > fs still hangs. I ha

Re: [PATCH 3/6] KVM: x86: NoBigReal was mistakenly considering la instead of ea

2014-10-02 Thread Nadav Amit
On Oct 1, 2014, at 6:58 PM, Radim Krčmář wrote: > 2014-09-30 20:49+0300, Nadav Amit: >> NoBigReal emulation should consider the effective address is between 0 and >> 0x instead of checking the logical address. Currently there are no >> instructions which are marked with NoBigReal flag, so t

Re: Problems using vfio pcie passthrough (pci-assign works)

2014-10-02 Thread Bruce Cran
On 10/2/2014 8:25 AM, Alex Williamson wrote: What's the device you're trying to assign and the scripts you're using to do so? vfio-pci is fully supported, but I'd recommend a kernel newer than 3.11 (maybe a newer QEMU too, you didn't specify a version) unless openSUSE is specifically pulling vfi

Re: Problems using vfio pcie passthrough (pci-assign works)

2014-10-02 Thread Alex Williamson
On Thu, 2014-10-02 at 09:42 -0600, Bruce Cran wrote: > On 10/2/2014 8:25 AM, Alex Williamson wrote: > > What's the device you're trying to assign and the scripts you're using > > to do so? vfio-pci is fully supported, but I'd recommend a kernel newer > > than 3.11 (maybe a newer QEMU too, you didn

Re: RFC: get_user_pages_locked|unlocked to leverage VM_FAULT_RETRY

2014-10-02 Thread Andrea Arcangeli
On Thu, Oct 02, 2014 at 02:56:38PM +0200, Peter Zijlstra wrote: > On Thu, Oct 02, 2014 at 02:50:52PM +0200, Peter Zijlstra wrote: > > On Thu, Oct 02, 2014 at 02:31:17PM +0200, Andrea Arcangeli wrote: > > > On Wed, Oct 01, 2014 at 05:36:11PM +0200, Peter Zijlstra wrote: > > > > For all these and the

Re: [PATCH] kvm: do not handle APIC access page if in-kernel irqchip is not in use

2014-10-02 Thread Jan Kiszka
On 2014-10-02 14:00, Paolo Bonzini wrote: > This fixes the following OOPS: > >loaded kvm module (v3.17-rc1-168-gcec26bc) >BUG: unable to handle kernel paging request at fffe >IP: [] put_page+0x9/0x30 >PGD 1e15067 PUD 1e17067 PMD 0 >Oops: [#1] PREEMPT SMP >

[PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-02 Thread Cédric Le Goater
Saving and restoring guests on a KVM little endian host is currently broken because qemu assumes that htabs are big endian. This patch modifies kvm_htab_read and kvm_htab_write to make sure that the endianness expected by qemu is enforced on big and little endian hosts. Signed-off-by: Cédric L

Re: Problems using vfio pcie passthrough (pci-assign works)

2014-10-02 Thread Bruce Cran
On 10/2/2014 9:54 AM, Alex Williamson wrote: Yes, try on 3.16 with QEMU 2.1 and let's go from there. Upgrading to 3.16 fixed it and it all works fine now. -- Bruce -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majo

Re: [PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-02 Thread Alexander Graf
On 02.10.14 18:58, Cédric Le Goater wrote: > Saving and restoring guests on a KVM little endian host is currently > broken because qemu assumes that htabs are big endian. > > This patch modifies kvm_htab_read and kvm_htab_write to make sure > that the endianness expected by qemu is enforced o

Re: Problems using vfio pcie passthrough (pci-assign works)

2014-10-02 Thread Alex Williamson
On Thu, 2014-10-02 at 11:03 -0600, Bruce Cran wrote: > On 10/2/2014 9:54 AM, Alex Williamson wrote: > > Yes, try on 3.16 with QEMU 2.1 and let's go from there. > > Upgrading to 3.16 fixed it and it all works fine now. Great! -- To unsubscribe from this list: send the line "unsubscribe kvm" in th

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

2014-10-02 Thread Nadav Amit
KVM does not deliver x2APIC broadcast messages with physical mode. Intel SDM (10.12.9 ICR Operation in x2APIC Mode) states: "A destination ID value of _H is used for broadcast of interrupts in both logical destination and physical destination modes." In addition, the local-apic enables cl

[PATCH 4/5] KVM: vmx: Unavailable DR4/5 is checked before CPL

2014-10-02 Thread Nadav Amit
If DR4/5 is accessed when it is unavailable (since CR4.DE is set), then #UD should be generated even if CPL>0. This is according to Intel SDM Table 6-2: "Priority Among Simultaneous Exceptions and Interrupts". Note, that this may happen on the first DR access, even if the host does not sets debug

[PATCH 1/5] KVM: x86: Clear DR7.LE during task-switch

2014-10-02 Thread Nadav Amit
DR7.LE should be cleared during task-switch. This feature is poorly documented. For reference, see: http://pdos.csail.mit.edu/6.828/2005/readings/i386/s12_02.htm Signed-off-by: Nadav Amit --- arch/x86/kvm/vmx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/vmx.

[PATCH 2/5] KVM: x86: Emulator performs code segment checks on read access

2014-10-02 Thread Nadav Amit
When read access is performed using a readable code segment, the "conforming" and "non-conforming" checks should not be done. As a result, read using non-conforming readable code segment fails. This is according to Intel SDM 5.6.1 ("Accessing Data in Code Segments"). The fix is not to perform th

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

2014-10-02 Thread 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 on the first page. As a result, fetch of long insturctions may fail, and thereby cause the decoding to fail as well. Signed-off-by: Nadav Amit --- arch/x86/

[PATCH 0/5] KVM: x86: Various bug fixes

2014-10-02 Thread Nadav Amit
This patch-set includes various bug fixes. The most notable bug is the wrong decoding of guest instructions which cross page boundary. I am surprised it does not happen in real-systems. Please review carefully the changes the DR4/5 bug-fix introduces to SVM part. Since I do not have AMD machine I

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

2014-10-02 Thread Nadav Amit
Setting the TSC deadline MSR that are initiated by the host (using ioctl's) may cause superfluous interrupt. This occurs in the following case: 1. A TSC deadline timer interrupt is pending. 2. TSC deadline was still not cleared (which happens during vcpu_run). 3. Userspace uses KVM_GET_MSRS/KVM_S