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

2014-11-13 Thread Hongbo Zhang
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 driver that allows to use Linux platform >>> devices with VFIO. >>> >>

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Andrew Jones
On Thu, Nov 13, 2014 at 12:44:39AM -0200, Marcelo Tosatti wrote: > > The periodic kvmclock sync can be an undesired source of latencies. > > Signed-off-by: Marcelo Tosatti > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c > index 0033df3..be56fd3 100644 > --- a/arch/x86/kvm/x86.c > +++ b

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Andrew Jones
On Thu, Nov 13, 2014 at 09:40:41AM +0100, Andrew Jones wrote: > On Thu, Nov 13, 2014 at 12:44:39AM -0200, Marcelo Tosatti wrote: > > > > The periodic kvmclock sync can be an undesired source of latencies. > > > > Signed-off-by: Marcelo Tosatti > > > > diff --git a/arch/x86/kvm/x86.c b/arch/x86/

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Nikolay Nikolaev
On Mon, Nov 10, 2014 at 6:27 PM, Christoffer Dall wrote: > On Mon, Nov 10, 2014 at 05:09:07PM +0200, Nikolay Nikolaev wrote: >> Hello, >> >> On Fri, Mar 28, 2014 at 9:09 PM, Christoffer Dall >> wrote: >> > >> > On Thu, Mar 13, 2014 at 04:57:26PM +0100, Antonios Motakis wrote: >> > > On an unhandl

Re: [PATCH] kvm: svm: move WARN_ON in svm_adjust_tsc_offset

2014-11-13 Thread Paolo Bonzini
On 13/11/2014 04:00, Chris J Arges wrote: > When running the tsc_adjust kvm-unit-test on an AMD processor with the > IA32_TSC_ADJUST feature enabled, the WARN_ON in svm_adjust_tsc_offset can be > triggered. This WARN_ON checks for a negative adjustment in case __scale_tsc > is called; however it ma

Re: [RFC PATCH] x86, entry: Switch stacks on a paranoid entry from userspace

2014-11-13 Thread Borislav Petkov
On Thu, Nov 13, 2014 at 12:31:30AM +, Luck, Tony wrote: > > Is this something I can try under KVM? > > I don't know if KVM has a way to simulate a machine check event. I've been thinking about it recently too - adding MCA functionality to qemu/kvm could be very useful, especially the threshol

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Christoffer Dall
On Thu, Nov 13, 2014 at 12:45:42PM +0200, Nikolay Nikolaev wrote: [...] > >> > >> Going through the vgic_handle_mmio we see that it will require large > >> refactoring: > >> - there are 15 MMIO ranges for the vgic now - each should be > >> registered as a separate device > >> - the handler of e

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Christoffer Dall
[resending to Andre's actual e-mail address] On Thu, Nov 13, 2014 at 12:20 PM, Christoffer Dall wrote: > On Thu, Nov 13, 2014 at 12:45:42PM +0200, Nikolay Nikolaev wrote: > > [...] > >> >> >> >> Going through the vgic_handle_mmio we see that it will require large >> >> refactoring: >> >> - there

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Andrew Jones
On Thu, Nov 13, 2014 at 11:44:02AM +0100, Andrew Jones wrote: > On Thu, Nov 13, 2014 at 09:40:41AM +0100, Andrew Jones wrote: > > On Thu, Nov 13, 2014 at 12:44:39AM -0200, Marcelo Tosatti wrote: > > > > > > The periodic kvmclock sync can be an undesired source of latencies. > > > > > > Signed-off

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Andre Przywara
Hi Nikolay, On 13/11/14 11:37, Marc Zyngier wrote: > [fixing Andre's email address] > > On 13/11/14 11:20, Christoffer Dall wrote: >> On Thu, Nov 13, 2014 at 12:45:42PM +0200, Nikolay Nikolaev wrote: >> >> [...] >> > > Going through the vgic_handle_mmio we see that it will require large >

Re: [PATCH net] Revert "drivers/net: Disable UFO through virtio" in macvtap and tun

2014-11-13 Thread Jelle de Jong
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/11/14 20:02, Stefan Hajnoczi wrote: > On Tue, Nov 11, 2014 at 05:12:58PM +, Ben Hutchings wrote: >> This reverts commit 88e0e0e5aa722b193c8758c8b45d041de5316924 for >> the tap drivers, but leaves UFO disabled in virtio_net. >> >> libvirt at

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Nikolay Nikolaev
On Thu, Nov 13, 2014 at 1:52 PM, Andre Przywara wrote: > Hi Nikolay, > > On 13/11/14 11:37, Marc Zyngier wrote: >> [fixing Andre's email address] >> >> On 13/11/14 11:20, Christoffer Dall wrote: >>> On Thu, Nov 13, 2014 at 12:45:42PM +0200, Nikolay Nikolaev wrote: >>> >>> [...] >>> >> >> G

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Andre Przywara
Hi Nikolay, On 13/11/14 12:29, Nikolay Nikolaev wrote: > On Thu, Nov 13, 2014 at 1:52 PM, Andre Przywara > wrote: >> Hi Nikolay, >> >> On 13/11/14 11:37, Marc Zyngier wrote: >>> [fixing Andre's email address] >>> >>> On 13/11/14 11:20, Christoffer Dall wrote: On Thu, Nov 13, 2014 at 12:45:4

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Michael Tokarev
13.11.2014 05:44, Marcelo Tosatti wrote: > The periodic kvmclock sync can be an undesired source of latencies. Shouldn't this be a per-vm property, not global host property? Maybe it's better to control frequency of syncs (with 0=disabled)? Thanks, /mjt -- To unsubscribe from this list: send the

[PATCH] virt: kvm: arm: vgic: Process the failure case when kvm_register_device_ops() fails

2014-11-13 Thread Chen Gang
When kvm_register_device_ops() fails, also need call free_percpu_irq() just like others have down within kvm_vgic_hyp_init(). Signed-off-by: Chen Gang --- virt/kvm/arm/vgic.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Nikolay Nikolaev
On Thu, Nov 13, 2014 at 4:23 PM, Eric Auger wrote: > On 11/13/2014 03:16 PM, Eric Auger wrote: >> On 11/13/2014 11:45 AM, Nikolay Nikolaev wrote: >>> On Mon, Nov 10, 2014 at 6:27 PM, Christoffer Dall >>> wrote: On Mon, Nov 10, 2014 at 05:09:07PM +0200, Nikolay Nikolaev wrote: > Hello, >>

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Christoffer Dall
Hi Nikolay, On Thu, Nov 13, 2014 at 4:02 PM, Nikolay Nikolaev wrote: [...] >> >> >> We're reconsidering ioeventfds patchseries and we tried to evaluate >> what you suggested here. >> >>> >>> this special-casing of the vgic is now really terrible. Is there >>> any

Re: [PATCH] virt: kvm: arm: vgic: Process the failure case when kvm_register_device_ops() fails

2014-11-13 Thread Marc Zyngier
On 13/11/14 15:04, Chen Gang wrote: > When kvm_register_device_ops() fails, also need call free_percpu_irq() > just like others have down within kvm_vgic_hyp_init(). > > Signed-off-by: Chen Gang > --- > virt/kvm/arm/vgic.c | 10 -- > 1 file changed, 8 insertions(+), 2 deletions(-) > > d

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Andre Przywara
On 13/11/14 15:02, Nikolay Nikolaev wrote: > On Thu, Nov 13, 2014 at 4:23 PM, Eric Auger wrote: >> On 11/13/2014 03:16 PM, Eric Auger wrote: >>> On 11/13/2014 11:45 AM, Nikolay Nikolaev wrote: On Mon, Nov 10, 2014 at 6:27 PM, Christoffer Dall wrote: > On Mon, Nov 10, 2014 at 05:09

Re: [RFC PATCH 1/4] ARM: KVM: on unhandled IO mem abort, route the call to the KVM MMIO bus

2014-11-13 Thread Eric Auger
On 11/13/2014 04:31 PM, Andre Przywara wrote: > > > On 13/11/14 15:02, Nikolay Nikolaev wrote: >> On Thu, Nov 13, 2014 at 4:23 PM, Eric Auger wrote: >>> On 11/13/2014 03:16 PM, Eric Auger wrote: On 11/13/2014 11:45 AM, Nikolay Nikolaev wrote: > On Mon, Nov 10, 2014 at 6:27 PM, Christoff

[PATCH] kvm: memslots: replace heap sort with insertion sort

2014-11-13 Thread Igor Mammedov
memslots is a sorted array, when slot changes in it with current heapsort it would take O(n log n) time to update array, while using insertion sort like algorithm on array with 1 item out of order will take only O(n) time. Replace current heapsort with custom sort that takes advantage of memslots

trying to use vfio to pass VGA card and getting operation not permitted error

2014-11-13 Thread Steven DuChene
I am trying to use VFIO and pci-bind to pass a NVidia VGA card and it's companion audio device through to a VM I am trying to start up. I am trying this on two different hardware platforms, a HP zbook 15 and a HP z800 workstation. Both systems are running Ubuntu 14.04. Each time I try to star

Re: [PATCH] kvm: memslots: replace heap sort with insertion sort

2014-11-13 Thread Paolo Bonzini
On 13/11/2014 17:31, Igor Mammedov wrote: > memslots is a sorted array, when slot changes in it > with current heapsort it would take O(n log n) time > to update array, while using insertion sort like > algorithm on array with 1 item out of order will > take only O(n) time. > > Replace current h

Re: trying to use vfio to pass VGA card and getting operation not permitted error

2014-11-13 Thread Alex Williamson
On Thu, 2014-11-13 at 11:50 -0500, Steven DuChene wrote: > I am trying to use VFIO and pci-bind to pass a NVidia VGA card and it's > companion audio device through to a VM I am trying to start up. > > I am trying this on two different hardware platforms, a HP zbook 15 and > a HP z800 workstation

Re: trying to use vfio to pass VGA card and getting operation not permitted error

2014-11-13 Thread Steven DuChene
Alex: Thanks for the quick reply. Yes, I am using qemu:args in the xml file. I looked around via google for an example of how to use hostdev in the xml file for the audio or video devices. I seem to recall the only example I could find was a hostdev section in the libvirt wiki for a NIC card. Do

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Radim Krčmář
2014-11-13 12:32+0100, Andrew Jones: > On Thu, Nov 13, 2014 at 11:44:02AM +0100, Andrew Jones wrote: > > On Thu, Nov 13, 2014 at 09:40:41AM +0100, Andrew Jones wrote: > > > On Thu, Nov 13, 2014 at 12:44:39AM -0200, Marcelo Tosatti wrote: > > > > The periodic kvmclock sync can be an undesired source

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Paolo Bonzini
On 13/11/2014 18:46, Radim Krčmář wrote: > Yes, or add callbacks to sysfs writes that would schedule/cancel this > work. (But having a for_every_vm loop is quite ugly.) > > I'd be happy with a 'const kvmclock_periodic_sync'. > (Having useless timers is weird if we care about latencies.) I agre

Re: trying to use vfio to pass VGA card and getting operation not permitted error

2014-11-13 Thread Alex Williamson
On Thu, 2014-11-13 at 12:36 -0500, Steven DuChene wrote: > Alex: > Thanks for the quick reply. > Yes, I am using qemu:args in the xml file. > I looked around via google for an example of how to use hostdev in the > xml file for the audio or video devices. > I seem to recall the only example I coul

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Andrew Jones
On Thu, Nov 13, 2014 at 06:47:40PM +0100, Paolo Bonzini wrote: > > > On 13/11/2014 18:46, Radim Krčmář wrote: > > Yes, or add callbacks to sysfs writes that would schedule/cancel this > > work. (But having a for_every_vm loop is quite ugly.) > > > > I'd be happy with a 'const kvmclock_periodic_

Re: KVM: x86: add module parameter to disable periodic kvmclock sync

2014-11-13 Thread Radim Krčmář
2014-11-13 18:57+0100, Andrew Jones: > On Thu, Nov 13, 2014 at 06:47:40PM +0100, Paolo Bonzini wrote: > > > > > > On 13/11/2014 18:46, Radim Krčmář wrote: > > > Yes, or add callbacks to sysfs writes that would schedule/cancel this > > > work. (But having a for_every_vm loop is quite ugly.) > > >

[PULL] vhost: cleanups and fixes

2014-11-13 Thread Michael S. Tsirkin
The following changes since commit 206c5f60a3d902bc4b56dab2de3e88de5eb06108: Linux 3.18-rc4 (2014-11-09 14:55:29 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus for you to fetch changes up to 65eca3a20264a8999570c2694

Re: [RFC PATCH] x86, entry: Switch stacks on a paranoid entry from userspace

2014-11-13 Thread Borislav Petkov
On Thu, Nov 13, 2014 at 11:59:37AM +0100, Borislav Petkov wrote: > I've been thinking about it recently too - adding MCA functionality to > qemu/kvm could be very useful, especially the thresholding stuff, for > testing RAS kernel code. Btw, qemu monitor has a mce injection command with which I wa

[PATCH v2] kvm: memslots: replace heap sort with insertion sort

2014-11-13 Thread Igor Mammedov
memslots is a sorted array, when slot changes in it with current heapsort it would take O(n log n) time to update array, while using insertion sort like algorithm on array with 1 item out of order will take only O(n) time. Replace current heapsort with custom sort that takes advantage of memslots

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

2014-11-13 Thread 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 mode - hypercalls and page faults. The new events are added to /sys/kernel/debug/tracing/events under a new subsystem called kvm_hv. Acked-by: Paul Mackerras Signed-off-by: Suresh W

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

2014-11-13 Thread Wanpeng Li
Hi Tang, On Tue, Nov 11, 2014 at 01:35:29PM +0800, Tang Chen wrote: >Hi Wanpeng, > Sorry for the late. >I think I have totally missed this thread. >I opened lockdep and RCU debug, and tried on 3.18-rc1. But I didn't >get the warning. I also opened lockdep and RCU debug, and tried 3.18.0-rc2 on a

[PATCH v14 2/7] KVM: Add generic support for dirty page logging

2014-11-13 Thread Mario Smarduch
kvm_get_dirty_log() provides generic handling of dirty bitmap, currently reused by several architectures. Building on that we intrdoduce kvm_get_dirty_log_protect() adding write protection to mark these pages dirty for future write access, before next KVM_GET_DIRTY_LOG ioctl call from user space.

[PATCH v14 1/7] KVM: Add architecture-defined TLB flush support

2014-11-13 Thread Mario Smarduch
Allow architectures to override the generic kvm_flush_remote_tlbs() function via HAVE_KVM_ARCH_TLB_FLUSH_ALL. ARMv7 will need this to provide its own TLB flush interface. Reviewed-by: Marc Zyngier Reviewed-by: Paolo Bonzini Signed-off-by: Mario Smarduch --- virt/kvm/Kconfig|3 +++ virt

[PATCH v14 0/7] KVM/arm/x86: dirty page logging for ARMv7 (3.17.0-rc1)

2014-11-13 Thread Mario Smarduch
Patch series adds support for ARMv7 and generic dirty page logging support. As we try to move towards generic dirty page logging additional logic is moved to generic code. Initially x86, armv7 KVM_GET_DIRTY_LOG reuses generic code, shortly followed by armv8 patches. Testing: - Generally live mi

[PATCH v14 3/7] KVM: x86: switch to kvm_get_dirty_log_protect

2014-11-13 Thread Mario Smarduch
From: Paolo Bonzini We now have a generic function that does most of the work of kvm_vm_ioctl_get_dirty_log, now use it. Signed-off-by: Mario Smarduch --- arch/x86/include/asm/kvm_host.h |3 -- arch/x86/kvm/Kconfig|1 + arch/x86/kvm/mmu.c |4 +-- arch/x86/k

[PATCH v14 4/7] KVM: arm: Add ARMv7 API to flush TLBs

2014-11-13 Thread Mario Smarduch
This patch adds ARMv7 architecture TLB Flush function. Acked-by: Marc Zyngier Acked-by: Christoffer Dall Signed-off-by: Mario Smarduch --- arch/arm/include/asm/kvm_asm.h |1 + arch/arm/include/asm/kvm_host.h | 12 arch/arm/kvm/Kconfig|1 + arch/arm/kvm/inter

[PATCH v14 5/7] KVM: arm: Add initial dirty page locking support

2014-11-13 Thread Mario Smarduch
Add support for initial write protection of VM memslots. This patch series assumes that huge PUDs will not be used in 2nd stage tables, which is always valid on ARMv7. Signed-off-by: Mario Smarduch --- arch/arm/include/asm/kvm_host.h |2 + arch/arm/include/asm/kvm_mmu.h| 20 +

[PATCH v14 6/7] KVM: arm: dirty logging write protect support

2014-11-13 Thread Mario Smarduch
Add support to track dirty pages between user space KVM_GET_DIRTY_LOG ioctl calls. We call kvm_get_dirty_log_protect() function to do most of the work. Reviewed-by: Marc Zyngier Signed-off-by: Mario Smarduch --- arch/arm/kvm/Kconfig |1 + arch/arm/kvm/arm.c | 46

[PATCH v14 7/7] KVM: arm: page logging 2nd stage fault handling

2014-11-13 Thread Mario Smarduch
This patch adds support for handling 2nd stage page faults during migration, it disables faulting in huge pages, and dissolves huge pages to page tables. In case migration is canceled huge pages are used again. Reviewed-by: Christoffer Dall Signed-off-by: Mario Smarduch --- arch/arm/kvm/mmu.c |

Re: [PATCH v14 3/7] KVM: x86: switch to kvm_get_dirty_log_protect

2014-11-13 Thread Mario Smarduch
Hi Paolo, I changed your patch a little to use a Kconfig symbol, hope that's fine with you. - Mario On 11/13/2014 05:57 PM, Mario Smarduch wrote: > From: Paolo Bonzini > > We now have a generic function that does most of the work of > kvm_vm_ioctl_get_dirty_log, now use it. > > Signed-off-b

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

2014-11-13 Thread Tang Chen
Thanks for the sharing. Will do more tests. :) On 11/14/2014 07:39 AM, Wanpeng Li wrote: Hi Tang, On Tue, Nov 11, 2014 at 01:35:29PM +0800, Tang Chen wrote: Hi Wanpeng, Sorry for the late. I think I have totally missed this thread. I opened lockdep and RCU debug, and tried on 3.18-rc1. But