Re: [PATCH v2 00/12] Remaining improvements for HV KVM

2015-04-09 Thread Paolo Bonzini
On 09/04/2015 00:57, Alexander Graf wrote: The last patch in this series needs a definition of PPC_MSGCLR that is added by the patch powerpc/powernv: Fixes for hypervisor doorbell handling, which has now gone upstream into Linus' tree as commit 755563bc79c7 via the linuxppc-dev mailing

Re: [PATCH v2 04/10] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-04-09 Thread Andrew Jones
On Wed, Apr 01, 2015 at 05:55:29PM +0200, David Hildenbrand wrote: This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Currently any operation flag will return EINVAL. Actual Well it won't return -EINVAL if you push in KVM_GUESTDBG_ENABLE or 0. Any unsupported flag

Re: [patch -rt 0/2] use simple waitqueue for kvm vcpu waitqueue (v5)

2015-04-09 Thread Sebastian Andrzej Siewior
* Marcelo Tosatti | 2015-04-08 20:33:23 [-0300]: Sebastian, Hi Marcelo, rebased against v3.18.7-rt2 as requested. The problem: On -RT, an emulated LAPIC timer instance has the following path: 1) hard interrupt 2) ksoftirqd is scheduled 3) ksoftirqd wakes up vcpu thread 4) vcpu thread is

Re: x86: Question regarding the reset value of LINT0

2015-04-09 Thread Bandan Das
Nadav Amit nadav.a...@gmail.com writes: Avi Kivity avi.kiv...@gmail.com wrote: On 04/09/2015 09:21 PM, Nadav Amit wrote: Bandan Das b...@redhat.com wrote: Nadav Amit nadav.a...@gmail.com writes: Jan Kiszka jan.kis...@siemens.com wrote: On 2015-04-08 19:40, Nadav Amit wrote: Jan

Re: [PATCH V2 2/5] KVM: x86/vPMU: Rename pmu.c file to pmu_intel.c

2015-04-09 Thread Wei Huang
On 4/9/15 14:10, Radim Krčmář wrote: 2015-04-08 12:18-0400, Wei Huang: As a preparation to unify vPMU implementation, this patch renames pmu.c to pmu_intel.c. Makefile is changed accordingly. Signed-off-by: Wei Huang w...@redhat.com --- (Since v2 does move quite a bit of it back to pmu.c, we

Re: [PATCH V2 0/5] KVM vPMU support for AMD

2015-04-09 Thread Radim Krčmář
2015-04-08 12:18-0400, Wei Huang: Currently KVM only supports vPMU for Intel platforms. This patch set enable vPMU support for AMD platform by creating a common PMU interface for x86. The PMU calls from guest VMs are dispatched to corresponding functions defined in arch specific files. V2:

Re: [PATCH V2 3/5] KVM: x86/vPMU: Create vPMU interface for VMX and SVM

2015-04-09 Thread Wei Huang
snip @@ -4918,13 +4919,13 @@ static int emulator_set_msr(struct x86_emulate_ctxt *ctxt, static int emulator_check_pmc(struct x86_emulate_ctxt *ctxt, u32 pmc) { - return kvm_pmu_check_pmc(emul_to_vcpu(ctxt), pmc); + return

Re: [PATCH] x86-run: Print a meaningful message if the qemu binary isn't found

2015-04-09 Thread Paolo Bonzini
On 02/04/2015 14:47, Paolo Bonzini wrote: On 01/04/2015 23:12, Bandan Das wrote: Before: ./x86-run ./x86/msr.flat QEMU binary has no support for test device. Exiting. After: ./x86-run ./x86/msr.flat A QEMU binary was not found, You can set a custom location by using the QEMU=path

Re: [PATCH v15 16/16] unfair qspinlock: a queue based unfair lock

2015-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2015 at 09:16:24AM -0400, Rik van Riel wrote: On 04/09/2015 03:01 AM, Peter Zijlstra wrote: On Wed, Apr 08, 2015 at 02:32:19PM -0400, Waiman Long wrote: For a virtual guest with the qspinlock patch, a simple unfair byte lock will be used if PV spinlock is not configured in

Re: [PATCH v15 16/16] unfair qspinlock: a queue based unfair lock

2015-04-09 Thread Rik van Riel
On 04/09/2015 10:13 AM, Peter Zijlstra wrote: On Thu, Apr 09, 2015 at 09:16:24AM -0400, Rik van Riel wrote: On 04/09/2015 03:01 AM, Peter Zijlstra wrote: On Wed, Apr 08, 2015 at 02:32:19PM -0400, Waiman Long wrote: For a virtual guest with the qspinlock patch, a simple unfair byte lock will

Re: [PATCH V2 3/5] KVM: x86/vPMU: Create vPMU interface for VMX and SVM

2015-04-09 Thread Radim Krčmář
2015-04-09 15:03-0500, Wei Huang: On 4/9/15 14:43, Radim Krčmář wrote: This patch introduces a lot of trailing whitespaces, please remove them. (`git am` says 15.) Some of them were carried from original pmu.c file. I will purge them in V3. (Ah, I didn't see them in kvm_intel.c and didn't

[RFC PATCH] arm64: KVM: remove fpsimd save/restore from the world switch

2015-04-09 Thread Marc Zyngier
The world switch spends quite some time dealing with the FP/SIMD registers, as the state is quite sizeable (32 128bit registers, plus some crumbs on the side). We save/restore them on each entry/exit, so that both the host and the guest always see the state they expect. But let's face it: the

Re: [PATCH] x86-run: Print a meaningful message if the qemu binary isn't found

2015-04-09 Thread Bandan Das
Bandan Das b...@redhat.com writes: ... I think we still want to print this if the user supplied qemu has no test device support. I think this is better - --- a/x86/run +++ b/x86/run @@ -8,6 +8,7 @@ qemusystem=${QEMU:-qemu-system-x86_64} if ! [ -z ${QEMU} ] then qemu=${QEMU}

Re: [PATCH V2 2/5] KVM: x86/vPMU: Rename pmu.c file to pmu_intel.c

2015-04-09 Thread Radim Krčmář
2015-04-08 12:18-0400, Wei Huang: As a preparation to unify vPMU implementation, this patch renames pmu.c to pmu_intel.c. Makefile is changed accordingly. Signed-off-by: Wei Huang w...@redhat.com --- (Since v2 does move quite a bit of it back to pmu.c, we can also decide to keep git

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-09 Thread Waiman Long
On 04/09/2015 02:23 PM, Peter Zijlstra wrote: On Thu, Apr 09, 2015 at 08:13:27PM +0200, Peter Zijlstra wrote: On Mon, Apr 06, 2015 at 10:55:44PM -0400, Waiman Long wrote: +#define PV_HB_PER_LINE (SMP_CACHE_BYTES / sizeof(struct pv_hash_bucket)) +static struct qspinlock **pv_hash(struct

Re: [PATCH v2 07/10] KVM: arm64: guest debug, add support for single-step

2015-04-09 Thread Andrew Jones
On Tue, Mar 31, 2015 at 04:08:05PM +0100, Alex Bennée wrote: This adds support for single-stepping the guest. As userspace can and will manipulate guest registers before restarting any tweaking of the registers has to occur just before control is passed back to the guest. Furthermore while

Re: x86: Question regarding the reset value of LINT0

2015-04-09 Thread Nadav Amit
Avi Kivity avi.kiv...@gmail.com wrote: On 04/09/2015 09:21 PM, Nadav Amit wrote: Bandan Das b...@redhat.com wrote: Nadav Amit nadav.a...@gmail.com writes: Jan Kiszka jan.kis...@siemens.com wrote: On 2015-04-08 19:40, Nadav Amit wrote: Jan Kiszka jan.kis...@siemens.com wrote: On

Re: vfio-pci: dvb-s2 pcie card stopped working after a short time

2015-04-09 Thread Alex Williamson
On Thu, 2015-04-09 at 15:13 +0200, Wolfgang Nothdurft wrote: Hi, I'm using kvm + libvirt + pci pass-through (vfio-pci) for virtualizing my mythtv server. hostdev mode='subsystem' type='pci' managed='yes' driver name='vfio'/ source address domain='0x'

Re: [PATCH] KVM: arm/arm64: avoid using kvm_run for in-kernel emulation

2015-04-09 Thread Andre Przywara
Hej Christoffer, On 09/04/15 14:30, Christoffer Dall wrote: On Sat, Mar 28, 2015 at 01:48:20AM +, Andre Przywara wrote: Our in-kernel VGIC emulation still uses struct kvm_run briefly before writing back the emulation result into the guest register. Using a userspace mapped data structure

Re: [PATCH] x86-run: Print a meaningful message if the qemu binary isn't found

2015-04-09 Thread Paolo Bonzini
On 09/04/2015 19:14, Bandan Das wrote: Paolo Bonzini pbonz...@redhat.com writes: ... This breaks QEMU=... ./x86-run ./x86/msr.flat Fixed as follows: diff --git a/x86/run b/x86/run index d5adf8d..219a93b 100755 --- a/x86/run +++ b/x86/run @@ -20,16 +20,15 @@ else

Re: [PATCH v2 07/10] KVM: arm64: guest debug, add support for single-step

2015-04-09 Thread Alex Bennée
Andrew Jones drjo...@redhat.com writes: On Tue, Mar 31, 2015 at 04:08:05PM +0100, Alex Bennée wrote: This adds support for single-stepping the guest. As userspace can and will manipulate guest registers before restarting any tweaking of the registers has to occur just before control is

Re: [PATCH v2 05/10] KVM: arm: introduce kvm_arch_setup/clear_debug()

2015-04-09 Thread Alex Bennée
Andrew Jones drjo...@redhat.com writes: On Wed, Apr 01, 2015 at 06:28:55PM +0200, David Hildenbrand wrote: This is a precursor for later patches which will need to do more to setup debug state before entering the hyp.S switch code. The existing functionality for setting mdcr_el2 has been

Re: [PATCH v2 04/10] KVM: arm: guest debug, add stub KVM_SET_GUEST_DEBUG ioctl

2015-04-09 Thread Alex Bennée
Andrew Jones drjo...@redhat.com writes: On Wed, Apr 01, 2015 at 05:55:29PM +0200, David Hildenbrand wrote: This commit adds a stub function to support the KVM_SET_GUEST_DEBUG ioctl. Currently any operation flag will return EINVAL. Actual Well it won't return -EINVAL if you push in

Re: [PATCH v15 16/16] unfair qspinlock: a queue based unfair lock

2015-04-09 Thread Rik van Riel
On 04/09/2015 03:01 AM, Peter Zijlstra wrote: On Wed, Apr 08, 2015 at 02:32:19PM -0400, Waiman Long wrote: For a virtual guest with the qspinlock patch, a simple unfair byte lock will be used if PV spinlock is not configured in or the hypervisor isn't either KVM or Xen. The byte lock works

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2015 at 08:13:27PM +0200, Peter Zijlstra wrote: On Mon, Apr 06, 2015 at 10:55:44PM -0400, Waiman Long wrote: +#define PV_HB_PER_LINE (SMP_CACHE_BYTES / sizeof(struct pv_hash_bucket)) +static struct qspinlock **pv_hash(struct qspinlock *lock, struct pv_node *node)

Re: [PATCH v15 09/15] pvqspinlock: Implement simple paravirt support for the qspinlock

2015-04-09 Thread Peter Zijlstra
On Mon, Apr 06, 2015 at 10:55:44PM -0400, Waiman Long wrote: +++ b/kernel/locking/qspinlock_paravirt.h @@ -0,0 +1,321 @@ +#ifndef _GEN_PV_LOCK_SLOWPATH +#error do not include this file +#endif + +/* + * Implement paravirt qspinlocks; the general idea is to halt the vcpus instead + * of

Re: [PATCH V2 3/5] KVM: x86/vPMU: Create vPMU interface for VMX and SVM

2015-04-09 Thread Wei Huang
On 4/9/15 14:43, Radim Krčmář wrote: 2015-04-08 12:18-0400, Wei Huang: This patch converts existing Intel specific vPMU code into a common vPMU interface with the following steps: - A large portion of Intel vPMU code is now moved to pmu.c file. The rest is re-arranged and hooked up with

Re: [PATCH V2 3/5] KVM: x86/vPMU: Create vPMU interface for VMX and SVM

2015-04-09 Thread Radim Krčmář
2015-04-08 12:18-0400, Wei Huang: This patch converts existing Intel specific vPMU code into a common vPMU interface with the following steps: - A large portion of Intel vPMU code is now moved to pmu.c file. The rest is re-arranged and hooked up with the newly-defined intel_pmu_ops. -

Re: x86: Question regarding the reset value of LINT0

2015-04-09 Thread Nadav Amit
Bandan Das b...@redhat.com wrote: Nadav Amit nadav.a...@gmail.com writes: Jan Kiszka jan.kis...@siemens.com wrote: On 2015-04-08 19:40, Nadav Amit wrote: Jan Kiszka jan.kis...@siemens.com wrote: On 2015-04-08 18:59, Nadav Amit wrote: Jan Kiszka jan.kis...@siemens.com wrote: On

[PATCH] vfio-pci: Attempt bus/slot reset on open

2015-04-09 Thread Alex Williamson
Apply the same logic we use in vfio_pci_try_bus_reset() to perform a bus or slot reset as devices are released to the device open path. This not only improves our chances of handing the device to the user in a clean state, but we can also avoid duplicate resets if the device is released and

Re: vfio-pci: dvb-s2 pcie card stopped working after a short time

2015-04-09 Thread Wolfgang Nothdurft
Am 09.04.2015 um 17:40 schrieb Alex Williamson: On Thu, 2015-04-09 at 15:13 +0200, Wolfgang Nothdurft wrote: Hi, I'm using kvm + libvirt + pci pass-through (vfio-pci) for virtualizing my mythtv server. hostdev mode='subsystem' type='pci' managed='yes' driver name='vfio'/

Re: [PATCH v15 13/15] pvqspinlock: Only kick CPU at unlock time

2015-04-09 Thread Peter Zijlstra
On Mon, Apr 06, 2015 at 10:55:48PM -0400, Waiman Long wrote: @@ -219,24 +236,30 @@ static void pv_wait_node(struct mcs_spinlock *node) } /* + * Called after setting next-locked = 1 lock acquired. + * Check if the the CPU has been halted. If so, set the _Q_SLOW_VAL flag + * and put an

Re: [PATCH v15 13/15] pvqspinlock: Only kick CPU at unlock time

2015-04-09 Thread Peter Zijlstra
On Thu, Apr 09, 2015 at 09:57:21PM +0200, Peter Zijlstra wrote: On Mon, Apr 06, 2015 at 10:55:48PM -0400, Waiman Long wrote: @@ -219,24 +236,30 @@ static void pv_wait_node(struct mcs_spinlock *node) } /* + * Called after setting next-locked = 1 lock acquired. + * Check if the

Re: [PATCH V2 0/5] KVM vPMU support for AMD

2015-04-09 Thread Wei Huang
On 4/9/15 14:05, Radim Krčmář wrote: 2015-04-08 12:18-0400, Wei Huang: Currently KVM only supports vPMU for Intel platforms. This patch set enable vPMU support for AMD platform by creating a common PMU interface for x86. The PMU calls from guest VMs are dispatched to corresponding functions

Re: [PATCH v2 00/12] Remaining improvements for HV KVM

2015-04-09 Thread Paolo Bonzini
On 09/04/2015 00:57, Alexander Graf wrote: The last patch in this series needs a definition of PPC_MSGCLR that is added by the patch powerpc/powernv: Fixes for hypervisor doorbell handling, which has now gone upstream into Linus' tree as commit 755563bc79c7 via the linuxppc-dev mailing

Re: Running KVM version ?

2015-04-09 Thread Radim Krčmář
2015-04-09 15:27+0200, Florent B: Hi everyone, This list seems to be a developer list, I didn't find any users list. I don't think it exists, KVM is used mostly by programs and they are not sophisticated enough to communicate. (or they are, which is why humans aren't invited) So please

Re: [PATCH v2 05/10] KVM: arm: introduce kvm_arch_setup/clear_debug()

2015-04-09 Thread Andrew Jones
On Tue, Mar 31, 2015 at 04:08:03PM +0100, Alex Bennée wrote: This is a precursor for later patches which will need to do more to setup debug state before entering the hyp.S switch code. The existing functionality for setting mdcr_el2 has been moved out of hyp.S and now uses the value kept in

Re: [PATCH v2 05/10] KVM: arm: introduce kvm_arch_setup/clear_debug()

2015-04-09 Thread Andrew Jones
On Wed, Apr 01, 2015 at 06:28:55PM +0200, David Hildenbrand wrote: This is a precursor for later patches which will need to do more to setup debug state before entering the hyp.S switch code. The existing functionality for setting mdcr_el2 has been moved out of hyp.S and now uses the value

Re: [PATCH v15 16/16] unfair qspinlock: a queue based unfair lock

2015-04-09 Thread Peter Zijlstra
On Wed, Apr 08, 2015 at 02:32:19PM -0400, Waiman Long wrote: For a virtual guest with the qspinlock patch, a simple unfair byte lock will be used if PV spinlock is not configured in or the hypervisor isn't either KVM or Xen. The byte lock works fine with small guest of just a few vCPUs. On a

vfio-pci: dvb-s2 pcie card stopped working after a short time

2015-04-09 Thread Wolfgang Nothdurft
Hi, I'm using kvm + libvirt + pci pass-through (vfio-pci) for virtualizing my mythtv server. hostdev mode='subsystem' type='pci' managed='yes' driver name='vfio'/ source address domain='0x' bus='0x01' slot='0x00' function='0x0'/ /source address

Re: x86: Question regarding the reset value of LINT0

2015-04-09 Thread Avi Kivity
On 04/09/2015 09:21 PM, Nadav Amit wrote: Bandan Das b...@redhat.com wrote: Nadav Amit nadav.a...@gmail.com writes: Jan Kiszka jan.kis...@siemens.com wrote: On 2015-04-08 19:40, Nadav Amit wrote: Jan Kiszka jan.kis...@siemens.com wrote: On 2015-04-08 18:59, Nadav Amit wrote: Jan Kiszka

Re: [PATCH] KVM: arm/arm64: avoid using kvm_run for in-kernel emulation

2015-04-09 Thread Christoffer Dall
On Sat, Mar 28, 2015 at 01:48:20AM +, Andre Przywara wrote: Our in-kernel VGIC emulation still uses struct kvm_run briefly before writing back the emulation result into the guest register. Using a userspace mapped data structure within the kernel sounds dodgy, also we do some extra copying

Re: [PATCH] x86-run: Print a meaningful message if the qemu binary isn't found

2015-04-09 Thread Bandan Das
Paolo Bonzini pbonz...@redhat.com writes: ... This breaks QEMU=... ./x86-run ./x86/msr.flat Fixed as follows: diff --git a/x86/run b/x86/run index d5adf8d..219a93b 100755 --- a/x86/run +++ b/x86/run @@ -20,16 +20,15 @@ else break fi done -fi -