Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots

2014-11-20 Thread Laszlo Ersek
On 11/20/14 00:32, Mario Smarduch wrote: > Hi Laszlo, > > couple observations. > > I'm wondering if access from qemu and guest won't > result in mixed memory attributes and if that's acceptable > to the CPU. Normally this would be a problem I think (Jon raised the topic of live migration).

[RFC PATCH v1 0/2] Define some VFIO interfaces for VT-d Posted-Interrupts

2014-11-20 Thread Feng Wu
VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt. With VT-d Posted-Interrupts enabled, external interrupts from direct-assigned devices can be delivered to guests without VMM intervention when guest is running in non-root mode. You can find the VT-d Posted-Interrtups Spec. in

[RFC PATCH v1 2/2] vfio: Add VFIO API vfio_msi_get_irq

2014-11-20 Thread Feng Wu
This API returns the host irq for the MSI/MSI-X interrrupts. Signed-off-by: Feng Wu --- drivers/vfio/pci/vfio_pci.c | 10 ++ include/linux/vfio.h|2 ++ 2 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci.c b/drivers/vfio/pci/vfio_pci.c

[RFC PATCH v1 1/2] vfio: Add new interrupt group for VFIO

2014-11-20 Thread Feng Wu
Add new group KVM_DEV_VFIO_INTERRUPT and command KVM_DEV_VFIO_DEVIE_POSTING_IRQ related to it. This is used for VT-d Posted-Interrupts setup. Signed-off-by: Feng Wu --- Documentation/virtual/kvm/devices/vfio.txt |8 include/uapi/linux/kvm.h | 14 ++

Re: [PATCH] KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions

2014-11-20 Thread Aneesh Kumar K.V
"Suresh E. Warrier" writes: > This patch adds trace points in the guest entry and exit code and also > for exceptions handled by the host in kernel mode - hypercalls and page > faults. The new events are added to /sys/kernel/debug/tracing/events > under a new subsystem called kvm_hv. >

[PATCH 1/1] vfio: put off the allocation of "minor" in vfio_create_group

2014-11-20 Thread Zhen Lei
The next code fragment "list_for_each_entry" is not depend on "minor". With this patch, the free of "minor" in "list_for_each_entry" can be reduced, and there is no functional change. Signed-off-by: Zhen Lei --- drivers/vfio/vfio.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions

Re: compiler bug gcc4.6/4.7 with ACCESS_ONCE and workarounds

2014-11-20 Thread Christian Borntraeger
Am 10.11.2014 um 22:07 schrieb Linus Torvalds: [...] > So before blacklisting any compilers, let's first see if > > (a) we can actually make it a real rule that we only use ACCESS_ONCE on > scalars > (b) we can somehow enforce this with a compiler warning/error for mis-uses > > For example, th

Re: [PATCH] KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions

2014-11-20 Thread Alexander Graf
On 19.11.14 22:54, Suresh E. Warrier wrote: > > > On 11/14/2014 04:56 AM, Alexander Graf wrote: >> >> >> >>> Am 14.11.2014 um 00:29 schrieb Suresh E. Warrier >>> : >>> >>> This patch adds trace points in the guest entry and exit code and also >>> for exceptions handled by the host in kernel mo

Re: [PATCH] KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions

2014-11-20 Thread Alexander Graf
On 20.11.14 11:40, Aneesh Kumar K.V wrote: > "Suresh E. Warrier" writes: > >> This patch adds trace points in the guest entry and exit code and also >> for exceptions handled by the host in kernel mode - hypercalls and page >> faults. The new events are added to /sys/kernel/debug/tracing/events

Re: [PATCH] KVM: ia64: remove

2014-11-20 Thread Radim Krčmář
2014-11-19 22:05+0100, Paolo Bonzini: > KVM for ia64 has been marked as broken not just once, but twice even, > and the last patch from the maintainer is now roughly 5 years old. > Time for it to rest in piece. > > Signed-off-by: Paolo Bonzini > --- Nice, if only every diffstat was like that! I

[PATCH] kvm: x86: move ioapic.c and irq_comm.c back to arch/x86/

2014-11-20 Thread Paolo Bonzini
ia64 does not need them anymore. Signed-off-by: Paolo Bonzini --- arch/x86/include/asm/kvm_host.h | 16 arch/x86/kvm/Makefile | 5 ++--- {virt => arch/x86}/kvm/ioapic.c | 0 {virt => arch/x86}/kvm/ioapic.h | 1 - {virt => arch/x86}/kvm/irq_comm.c | 4 ++--

Re: [PATCH] KVM: ia64: remove

2014-11-20 Thread Paolo Bonzini
On 20/11/2014 14:38, Radim Krčmář wrote: > I propose another removal. > (The reasoning below wasn't confirmed with ia64 compiler. > I'd remove the ioctls even if they worked.) Checked and applied, thanks. Paolo > ---8<--- > KVM: remove buggy ia64 specific ioctls > > IA64 is no longer present

Re: [PATCH] KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions

2014-11-20 Thread Steven Rostedt
On Thu, 20 Nov 2014 13:10:12 +0100 Alexander Graf wrote: > > > On 20.11.14 11:40, Aneesh Kumar K.V wrote: > > "Suresh E. Warrier" writes: > > > >> This patch adds trace points in the guest entry and exit code and also > >> for exceptions handled by the host in kernel mode - hypercalls and pag

Re: [PATCH v9 01/19] vfio/platform: initial skeleton of VFIO support for platform devices

2014-11-20 Thread Antonios Motakis
On Wed, Nov 12, 2014 at 5:49 PM, Alex Williamson wrote: > > On Wed, 2014-11-12 at 11:05 +0100, Eric Auger wrote: > > Hi Antonios, > > > > On 10/27/2014 07:07 PM, Antonios Motakis wrote: > > > This patch forms the common skeleton code for platform devices support > > > with VFIO. This will include

Re: [PATCH v9 06/19] vfio/platform: return info for bound device

2014-11-20 Thread Antonios Motakis
On Wed, Nov 12, 2014 at 5:36 PM, Alex Williamson wrote: > On Wed, 2014-11-12 at 11:32 +0100, Eric Auger wrote: >> On 10/27/2014 07:07 PM, Antonios Motakis wrote: >> > A VFIO userspace driver will start by opening the VFIO device >> > that corresponds to an IOMMU group, and will use the ioctl inter

Re: [PATCH v9 03/19] vfio: platform: add the VFIO PLATFORM module to Kconfig

2014-11-20 Thread Antonios Motakis
On Thu, Nov 13, 2014 at 9:05 AM, Hongbo Zhang wrote: > On 12 November 2014 17:57, Antonios Motakis > wrote: >> Hello Hongbo, >> >> On Wed, Nov 12, 2014 at 10:52 AM, Hongbo Zhang >> wrote: >>> On 28 October 2014 02:07, Antonios Motakis >>> wrote: Enable building the VFIO PLATFORM driv

Re: [PATCH v9 06/19] vfio/platform: return info for bound device

2014-11-20 Thread Eric Auger
On 11/20/2014 03:10 PM, Antonios Motakis wrote: > On Wed, Nov 12, 2014 at 5:36 PM, Alex Williamson > wrote: >> On Wed, 2014-11-12 at 11:32 +0100, Eric Auger wrote: >>> On 10/27/2014 07:07 PM, Antonios Motakis wrote: A VFIO userspace driver will start by opening the VFIO device that corre

Re: [RFC PATCH 0/6] ARM64: KVM: PMU infrastructure support

2014-11-20 Thread Anup Patel
On Wed, Nov 19, 2014 at 8:59 PM, Christoffer Dall wrote: > On Tue, Nov 11, 2014 at 02:48:25PM +0530, Anup Patel wrote: >> Hi All, >> >> I have second thoughts about rebasing KVM PMU patches >> to Marc's irq-forwarding patches. >> >> The PMU IRQs (when virtualized by KVM) are not exactly >> forward

Re: [PATCH 1/1] vfio: put off the allocation of "minor" in vfio_create_group

2014-11-20 Thread Alex Williamson
On Thu, 2014-11-20 at 19:25 +0800, Zhen Lei wrote: > The next code fragment "list_for_each_entry" is not depend on "minor". With > this > patch, the free of "minor" in "list_for_each_entry" can be reduced, and there > is > no functional change. A reasonable micro-optimization, but I'm curious if

Re: [RFC PATCH v1 1/2] vfio: Add new interrupt group for VFIO

2014-11-20 Thread Alex Williamson
On Thu, 2014-11-20 at 17:05 +0800, Feng Wu wrote: > Add new group KVM_DEV_VFIO_INTERRUPT and command > KVM_DEV_VFIO_DEVIE_POSTING_IRQ related to it. > > This is used for VT-d Posted-Interrupts setup. Eric proposed an interface for ARM forwarded interrupts[1] using group KVM_DEV_VFIO_DEVICE with a

Re: [RFC PATCH v1 1/2] vfio: Add new interrupt group for VFIO

2014-11-20 Thread Eric Auger
On 11/20/2014 04:53 PM, Alex Williamson wrote: > On Thu, 2014-11-20 at 17:05 +0800, Feng Wu wrote: >> Add new group KVM_DEV_VFIO_INTERRUPT and command >> KVM_DEV_VFIO_DEVIE_POSTING_IRQ related to it. >> >> This is used for VT-d Posted-Interrupts setup. > > Eric proposed an interface for ARM forwar

Re: [RFC PATCH v1 2/2] vfio: Add VFIO API vfio_msi_get_irq

2014-11-20 Thread Alex Williamson
On Thu, 2014-11-20 at 17:05 +0800, Feng Wu wrote: > This API returns the host irq for the MSI/MSI-X interrrupts. > > Signed-off-by: Feng Wu > --- > drivers/vfio/pci/vfio_pci.c | 10 ++ > include/linux/vfio.h|2 ++ > 2 files changed, 12 insertions(+), 0 deletions(-) > > dif

Re: [RFC PATCH v1 2/2] vfio: Add VFIO API vfio_msi_get_irq

2014-11-20 Thread Eric Auger
On 11/20/2014 05:05 PM, Alex Williamson wrote: > On Thu, 2014-11-20 at 17:05 +0800, Feng Wu wrote: >> This API returns the host irq for the MSI/MSI-X interrrupts. >> >> Signed-off-by: Feng Wu >> --- >> drivers/vfio/pci/vfio_pci.c | 10 ++ >> include/linux/vfio.h|2 ++ >> 2 f

KVM causes #GP on XRSTORS

2014-11-20 Thread Nadav Amit
Fenghua, I got KVM (v3.17) crashing on a machine that supports XRSTORS - It appears to get a #GP when it is trying to load the guest FPU. One reason for the #GP is that XCOMP_BV[63] is zeroed on the guest_fpu, but I am not sure it is the only problem. Was KVM ever tested with XRSTORS? Thanks, N

Re: can I make this work… (Foundation for accessibility project)

2014-11-20 Thread Eric S. Johansson
On 11/18/2014 9:57 AM, Eric S. Johansson wrote: That's great to know. I will spin up a version of Windows 7 and give it a try given that I'm not looking at it, I can strip it down to the barest user interface elements and improve performance significantly. I tried it and it took me approxim

Re: [PATCH] KVM: PPC: Book3S HV: Add missing HPTE unlock

2014-11-20 Thread Alexander Graf
On 05.11.14 02:21, Paul Mackerras wrote: > From: "Aneesh Kumar K.V" > > In kvm_test_clear_dirty(), if we find an invalid HPTE we move on to the > next HPTE without unlocking the invalid one. In fact we should never > find an invalid and unlocked HPTE in the rmap chain, but for robustness > we

Re: [PATCH] KVM: PPC: Book3S HV: ptes are big endian

2014-11-20 Thread Alexander Graf
On 03.11.14 16:35, Cédric Le Goater wrote: > When being restored from qemu, the kvm_get_htab_header are in native > endian, but the ptes are big endian. > > This patch fixes restore on a KVM LE host. Qemu also needs a fix for > this : > > http://lists.nongnu.org/archive/html/qemu-ppc/2014

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

2014-11-20 Thread Andrea Arcangeli
Hi, On Fri, Oct 31, 2014 at 12:39:32PM -0700, Peter Feiner wrote: > On Fri, Oct 31, 2014 at 11:29:49AM +0800, zhanghailiang wrote: > > Agreed, but for doing live memory snapshot (VM is running when do > > snapsphot), > > we have to do this (block the write action), because we have to save the >

Re: [PATCH 2/5] KVM: PPC: Book3S HV: Fix an issue where guest is paused on receiving HMI

2014-11-20 Thread Alexander Graf
On 03.11.14 05:51, Paul Mackerras wrote: > From: Mahesh Salgaonkar > > When we get an HMI (hypervisor maintenance interrupt) while in a > guest, we see that guest enters into paused state. The reason is, in > kvmppc_handle_exit_hv it falls through default path and returns to > host instead of

Exposing host debug capabilities to userspace

2014-11-20 Thread Alex Bennée
Hi, I've almost finished the ARMv8 guest debug support but I have one problem left to solve. userspace needs to know how many hardware debug registers are available for GDB to use. This information is available from the ID_AA64DFR0_EL1 register. Currently I abuse GET_ONE_REG to fetch it's value ho

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Check wait conditions before sleeping in kvmppc_vcore_blocked

2014-11-20 Thread Alexander Graf
On 03.11.14 05:52, Paul Mackerras wrote: > From: "Suresh E. Warrier" > > The kvmppc_vcore_blocked() code does not check for the wait condition > after putting the process on the wait queue. This means that it is > possible for an external interrupt to become pending, but the vcpu to > remain as

Re: [PATCH 0/5] Some fixes for HV KVM on PPC

2014-11-20 Thread Alexander Graf
On 03.11.14 05:51, Paul Mackerras wrote: > Here are fixes for five bugs which were found in the testing of our > PowerKVM product. The bugs range from guest performance issues to > guest crashes and memory corruption. Please apply. Thanks, applied patches 1-4 to kvm-ppc-queue. Alex -- To uns

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

2014-11-20 Thread Andrea Arcangeli
Hi, On Thu, Nov 20, 2014 at 10:54:29AM +0800, zhanghailiang wrote: > Yes, you are right. This is what i really want, bypass all non-present faults > and only track strict wrprotect faults. ;) > > So, do you plan to support that in the userfault API? Yes I think it's good idea to support wrprotec

Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots

2014-11-20 Thread Mario Smarduch
On 11/20/2014 12:08 AM, Laszlo Ersek wrote: > On 11/20/14 00:32, Mario Smarduch wrote: >> Hi Laszlo, >> >> couple observations. >> >> I'm wondering if access from qemu and guest won't >> result in mixed memory attributes and if that's acceptable >> to the CPU. > > Normally this would be a pro

Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots

2014-11-20 Thread Peter Maydell
On 20 November 2014 18:35, Mario Smarduch wrote: > I think beyond consistency, there should be no double mappings with > conflicting attributes at any time or CPU state is undefined. The situation is not so bleak as this. See section B2.9 "Mismatched memory attributes" in the ARMv8 ARM ARM (DDI04

Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots

2014-11-20 Thread Mario Smarduch
On 11/20/2014 10:40 AM, Peter Maydell wrote: > On 20 November 2014 18:35, Mario Smarduch wrote: >> I think beyond consistency, there should be no double mappings with >> conflicting attributes at any time or CPU state is undefined. > > The situation is not so bleak as this. See section B2.9 "Mism

Re: [PATCH 5/5] KVM: PPC: Book3S HV: Check wait conditions before sleeping in kvmppc_vcore_blocked

2014-11-20 Thread Suresh E. Warrier
On 11/20/2014 11:36 AM, Alexander Graf wrote: > > > On 03.11.14 05:52, Paul Mackerras wrote: >> From: "Suresh E. Warrier" >> >> The kvmppc_vcore_blocked() code does not check for the wait condition >> after putting the process on the wait queue. This means that it is >> possible for an externa

Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots

2014-11-20 Thread Jon Masters
On 11/20/2014 01:40 PM, Peter Maydell wrote: > On 20 November 2014 18:35, Mario Smarduch wrote: >> I think beyond consistency, there should be no double mappings with >> conflicting attributes at any time or CPU state is undefined. > > The situation is not so bleak as this. See section B2.9 "Mism

Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots

2014-11-20 Thread Peter Maydell
On 20 November 2014 19:49, Jon Masters wrote: > On 11/20/2014 01:40 PM, Peter Maydell wrote: >> The situation is not so bleak as this. See section B2.9 "Mismatched >> memory attributes" in the ARMv8 ARM ARM (DDI0487A.d), which lays >> out in some detail what the results of mismatched attributes ar

Re: compiler bug gcc4.6/4.7 with ACCESS_ONCE and workarounds

2014-11-20 Thread Linus Torvalds
On Thu, Nov 20, 2014 at 3:39 AM, Christian Borntraeger wrote: > > So It looks like we could make a change to ACCESS_ONCE. Would something like > > CONFIG_ARCH_SCALAR_ACCESS_ONCE be a good start? No, if it's just a handful of places to be fixed, let's not add config options for broken cases. > Th

Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots

2014-11-20 Thread Laszlo Ersek
On 11/20/14 21:10, Peter Maydell wrote: > On 20 November 2014 19:49, Jon Masters wrote: >> On 11/20/2014 01:40 PM, Peter Maydell wrote: >>> The situation is not so bleak as this. See section B2.9 "Mismatched >>> memory attributes" in the ARMv8 ARM ARM (DDI0487A.d), which lays >>> out in some detai

Re: can I make this work… (Foundation for accessibility project)

2014-11-20 Thread Paolo Bonzini
On 20/11/2014 17:28, Eric S. Johansson wrote: > I'm accustomed to lesser performance on virtual machines. That's the > hazard of a running on old and slow laptop (dell e6400 (2.2ghz core > duo, 8gb ram)[1]) but even virtual box is not this slow. So what am I > doing wrong? It would be nice to u

Re: [PATCH 3/3] arm, arm64: KVM: handle potential incoherency of readonly memslots

2014-11-20 Thread Peter Maydell
On 20 November 2014 21:13, Laszlo Ersek wrote: > On 11/20/14 21:10, Peter Maydell wrote: >> I think in practice for a well-behaved guest we can arrange >> that everything is fine (roughly, the guest has to treat >> DMA-capable devices as doing coherent-dma, which we can tell >> them to do via DT b

RE: KVM causes #GP on XRSTORS

2014-11-20 Thread Yu, Fenghua
> From: Nadav Amit [mailto:nadav.a...@gmail.com] > Sent: Thursday, November 20, 2014 8:34 AM > To: Paolo Bonzini; Yu, Fenghua > Cc: kvm list > Subject: KVM causes #GP on XRSTORS > > Fenghua, > > I got KVM (v3.17) crashing on a machine that supports XRSTORS - It appears > to get a #GP when it is t

Re: can I make this work… (Foundation for accessibility project)

2014-11-20 Thread Eric S. Johansson
On 11/20/2014 4:48 PM, Paolo Bonzini wrote: On 20/11/2014 17:28, Eric S. Johansson wrote: I'm accustomed to lesser performance on virtual machines. That's the hazard of a running on old and slow laptop (dell e6400 (2.2ghz core duo, 8gb ram)[1]) but even virtual box is not this slow. So what

[PATCH v2] KVM: PPC: Book3S HV: ptes are big endian

2014-11-20 Thread Cédric Le Goater
When being restored from qemu, the kvm_get_htab_header are in native endian, but the ptes are big endian. This patch fixes restore on a KVM LE host. Qemu also needs a fix for this : http://lists.nongnu.org/archive/html/qemu-ppc/2014-11/msg8.html Signed-off-by: Cédric Le Goater Cc: Pau

Re: KVM causes #GP on XRSTORS

2014-11-20 Thread Wanpeng Li
Hi Nadav, On Thu, Nov 20, 2014 at 06:34:04PM +0200, Nadav Amit wrote: >Fenghua, > >I got KVM (v3.17) crashing on a machine that supports XRSTORS - It appears to >get a #GP when it is trying to load the guest FPU. >One reason for the #GP is that XCOMP_BV[63] is zeroed on the guest_fpu, but I >am n

Re: KVM causes #GP on XRSTORS

2014-11-20 Thread Nadav Amit
> On Nov 21, 2014, at 02:10, Wanpeng Li wrote: > > Hi Nadav, > On Thu, Nov 20, 2014 at 06:34:04PM +0200, Nadav Amit wrote: >> Fenghua, >> >> I got KVM (v3.17) crashing on a machine that supports XRSTORS - It appears >> to get a #GP when it is trying to load the guest FPU. >> One reason for the

Re: [PATCH 1/1] vfio: put off the allocation of "minor" in vfio_create_group

2014-11-20 Thread leizhen
On 2014/11/20 23:37, Alex Williamson wrote: > On Thu, 2014-11-20 at 19:25 +0800, Zhen Lei wrote: >> The next code fragment "list_for_each_entry" is not depend on "minor". With >> this >> patch, the free of "minor" in "list_for_each_entry" can be reduced, and >> there is >> no functional change. >

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

2014-11-20 Thread Wanpeng Li
Hi Tang, On Fri, Nov 21, 2014 at 02:41:57PM +0800, Tang Chen wrote: >Hi Wanpeng, > >Sorry, it is about this problem again. > >I booted 3.18.0-rc2, without Paolo's patch. lockdep and RCU debug >were all opened. > >Then I started a qemu vm with the following options: > >/usr/libexec/qemu-kvm -hda rhe

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

2014-11-20 Thread zhanghailiang
On 2014/11/21 1:38, Andrea Arcangeli wrote: Hi, On Thu, Nov 20, 2014 at 10:54:29AM +0800, zhanghailiang wrote: Yes, you are right. This is what i really want, bypass all non-present faults and only track strict wrprotect faults. ;) So, do you plan to support that in the userfault API? Yes I