Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Tue, Jul 17, 2012 at 07:14:52PM +0300, Michael S. Tsirkin wrote: _Seems_ racy, or _is_ racy? Please identify the race. Look at this: static inline int kvm_irq_line_state(unsigned long *irq_state, int irq_source_id, int level) { /* Logical

Biweekly KVM Test report, kernel 58d8b172... qemu 28c3a9b1..

2012-07-18 Thread Ren, Yongjie
Hi All, This is KVM upstream test result against kvm.git next branch and qemu-kvm.git master branch. kvm.git next branch: 58d8b1728ea3da391ef01c43a384ea06ce4b7c8a based on kernel 3.5.0-rc1 qemu-kvm.git master branch: 28c3a9b197900c88f27b14f8862a7a15c00dc7f0 We found no new

Re: [PATCH 0/5] Add vhost-blk support

2012-07-18 Thread Asias He
On 07/17/2012 07:11 PM, Stefan Hajnoczi wrote: On Tue, Jul 17, 2012 at 10:21 AM, Asias He as...@redhat.com wrote: On 07/17/2012 04:52 PM, Paolo Bonzini wrote: Il 17/07/2012 10:29, Asias He ha scritto: So, vhost-blk at least saves ~6 syscalls for us in each request. Are they really 6? If

Re: Re: How to get the real device in guest os after attached a disk?

2012-07-18 Thread Stefan Hajnoczi
On Wed, Jul 18, 2012 at 5:01 AM, Wangpan hzwang...@corp.netease.com wrote: But how can I get the serial info in the guest os? General documentation on persistent block device naming (just grabbed the first useful link of Google):

Re: [PATCH 0/5] Add vhost-blk support

2012-07-18 Thread Stefan Hajnoczi
On Wed, Jul 18, 2012 at 9:12 AM, Asias He as...@redhat.com wrote: On 07/17/2012 07:11 PM, Stefan Hajnoczi wrote: On Tue, Jul 17, 2012 at 10:21 AM, Asias He as...@redhat.com wrote: On 07/17/2012 04:52 PM, Paolo Bonzini wrote: Il 17/07/2012 10:29, Asias He ha scritto: So, vhost-blk at

RE: [PATCH] qemu kvm: Recognize PCID feature

2012-07-18 Thread Mao, Junjie
Hi, Avi Any comments on this patch? :) -Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of Mao, Junjie Sent: Friday, July 13, 2012 12:58 PM To: 'kvm@vger.kernel.org' Subject: [PATCH] qemu kvm: Recognize PCID feature This patch makes

Re: [PATCH 0/5] Add vhost-blk support

2012-07-18 Thread Asias He
On 07/17/2012 09:02 PM, Paolo Bonzini wrote: Il 17/07/2012 14:48, Michael S. Tsirkin ha scritto: On Tue, Jul 17, 2012 at 01:03:39PM +0100, Stefan Hajnoczi wrote: On Tue, Jul 17, 2012 at 12:54 PM, Michael S. Tsirkin m...@redhat.com wrote: Knowing the answer to that is important before anyone

[PATCH] x86, hyper: fix build with !CONFIG_KVM_GUEST

2012-07-18 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kernel/cpu/hypervisor.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/cpu/hypervisor.c b/arch/x86/kernel/cpu/hypervisor.c index 6d6dd7a..a8f8fa9 100644 --- a/arch/x86/kernel/cpu/hypervisor.c +++

Re: [PATCH 5/7 v6] introduce a new qom device to deal with panicked event

2012-07-18 Thread Jan Kiszka
On 2012-07-18 03:54, Wen Congyang wrote: At 07/06/2012 07:05 PM, Jan Kiszka Wrote: On 2012-07-06 11:41, Wen Congyang wrote: If the target is x86/x86_64, the guest's kernel will write 0x01 to the port KVM_PV_PORT when it is panciked. This patch introduces a new qom device kvm_pv_ioport to

Re: vga passthrough // questions about pci passthrough

2012-07-18 Thread Jan Kiszka
On 2012-07-18 07:45, Martin Wolf wrote: Hello, i was able to passthrough an AMD 7870 videocard to my win7 guest machine. Would you add it to http://www.linux-kvm.org/page/VGA_device_assignment? my host is ubuntu 12.04 with stock kernel. my system contains: dq67sw q67 mainboard i5-2400s

Re: [PATCH 5/7 v6] introduce a new qom device to deal with panicked event

2012-07-18 Thread Jan Kiszka
On 2012-07-18 11:19, Jan Kiszka wrote: On 2012-07-18 03:54, Wen Congyang wrote: At 07/06/2012 07:05 PM, Jan Kiszka Wrote: On 2012-07-06 11:41, Wen Congyang wrote: If the target is x86/x86_64, the guest's kernel will write 0x01 to the port KVM_PV_PORT when it is panciked. This patch introduces

Re: [PATCH] qemu kvm: Recognize PCID feature

2012-07-18 Thread Jan Kiszka
On 2012-07-18 10:44, Mao, Junjie wrote: Hi, Avi Any comments on this patch? :) Always include qemu-devel when your are changing QEMU, qemu-kvm is just staging for the latter. This patch can actually go into upstream directly, maybe even via qemu-trivial as it just makes that flag selectable.

[PATCH 2/2 v3] KVM: PPC: booke: Add watchdog emulation

2012-07-18 Thread Bharat Bhushan
This patch adds the watchdog emulation in KVM. The watchdog emulation is enabled by KVM_ENABLE_CAP(KVM_CAP_PPC_WDT) ioctl. The kernel timer are used for watchdog emulation and emulates h/w watchdog state machine. On watchdog timer expiry, it exit to QEMU if TCR.WRC is non ZERO. QEMU can

[PATCH 2/2 v4] KVM: PPC: booke: Add watchdog emulation

2012-07-18 Thread Bharat Bhushan
This patch adds the watchdog emulation in KVM. The watchdog emulation is enabled by KVM_ENABLE_CAP(KVM_CAP_PPC_WDT) ioctl. The kernel timer are used for watchdog emulation and emulates h/w watchdog state machine. On watchdog timer expiry, it exit to QEMU if TCR.WRC is non ZERO. QEMU can

Re: [PATCH 0/5] Add vhost-blk support

2012-07-18 Thread Ronen Hod
On 07/17/2012 12:21 PM, Asias He wrote: On 07/17/2012 04:52 PM, Paolo Bonzini wrote: Il 17/07/2012 10:29, Asias He ha scritto: So, vhost-blk at least saves ~6 syscalls for us in each request. Are they really 6? If I/O is coalesced by a factor of 3, for example (i.e. each exit processes 3

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 09:27:42AM +0300, Gleb Natapov wrote: On Tue, Jul 17, 2012 at 07:14:52PM +0300, Michael S. Tsirkin wrote: _Seems_ racy, or _is_ racy? Please identify the race. Look at this: static inline int kvm_irq_line_state(unsigned long *irq_state,

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:20:29PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 09:27:42AM +0300, Gleb Natapov wrote: On Tue, Jul 17, 2012 at 07:14:52PM +0300, Michael S. Tsirkin wrote: _Seems_ racy, or _is_ racy? Please identify the race. Look at this: static

Re: [PATCH v5 2/4] kvm: KVM_EOIFD, an eventfd for EOIs

2012-07-18 Thread Michael S. Tsirkin
On Tue, Jul 17, 2012 at 08:44:04PM -0600, Alex Williamson wrote: On Wed, 2012-07-18 at 01:24 +0300, Michael S. Tsirkin wrote: On Tue, Jul 17, 2012 at 04:09:25PM -0600, Alex Williamson wrote: On Wed, 2012-07-18 at 00:23 +0300, Michael S. Tsirkin wrote: On Tue, Jul 17, 2012 at 02:03:05PM

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 01:27:39PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:20:29PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 09:27:42AM +0300, Gleb Natapov wrote: On Tue, Jul 17, 2012 at 07:14:52PM +0300, Michael S. Tsirkin wrote: _Seems_ racy, or _is_ racy?

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:33:35PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:27:39PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:20:29PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 09:27:42AM +0300, Gleb Natapov wrote: On Tue, Jul 17, 2012 at

Re: UIO: missing resource mapping

2012-07-18 Thread Dominic Eschweiler
Am Montag, den 16.07.2012, 23:58 +0200 schrieb Hans J. Koch: Try to hack up a patch to add generic BAR mapping to uio_pci_generic.c and post it for review. Here we go ... Signed-off-by: Dominic Eschweiler eschwei...@fias.uni-frankfurt.de diff --git a/drivers/uio/uio_pci_generic.c

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Mon, Jul 16, 2012 at 02:33:47PM -0600, Alex Williamson wrote: In order to inject a level interrupt from an external source using an irqfd, we need to allocate a new irq_source_id. This allows us to assert and (later) de-assert an interrupt line independently from users of KVM_IRQ_LINE and

Re: [PATCH v5 0/4] kvm: level irqfd and new eoifd

2012-07-18 Thread Michael S. Tsirkin
On Mon, Jul 16, 2012 at 02:33:38PM -0600, Alex Williamson wrote: v5: - irqfds now have a one-to-one mapping with eoifds to prevent users from consuming all of kernel memory by repeatedly creating eoifds from a single irqfd. - implement a kvm_clear_irq() which does a test_and_clear_bit

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:41:14PM +0300, Michael S. Tsirkin wrote: On Mon, Jul 16, 2012 at 02:33:47PM -0600, Alex Williamson wrote: In order to inject a level interrupt from an external source using an irqfd, we need to allocate a new irq_source_id. This allows us to assert and (later)

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 01:44:29PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:41:14PM +0300, Michael S. Tsirkin wrote: On Mon, Jul 16, 2012 at 02:33:47PM -0600, Alex Williamson wrote: In order to inject a level interrupt from an external source using an irqfd, we need to

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:48:44PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:44:29PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:41:14PM +0300, Michael S. Tsirkin wrote: On Mon, Jul 16, 2012 at 02:33:47PM -0600, Alex Williamson wrote: In order to inject a

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 01:36:08PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:33:35PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:27:39PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:20:29PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 01:49:06PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:48:44PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:44:29PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:41:14PM +0300, Michael S. Tsirkin wrote: On Mon, Jul 16, 2012 at

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:51:05PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:36:08PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:33:35PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:27:39PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 01:53:11PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:49:06PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:48:44PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:44:29PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at

Ubuntu 12.04 (kvm host) Centos6.3 (guest) , rebooting from inside centos6.3 VM - gets stuck on seabios/grub loop - previous kernels fine - occurs on multiple servers

2012-07-18 Thread Morgan Cox
I have a really annoying bug, I can reproduce often (although it is a bit random). I have an Ubuntu 12.04 KVM server , using Centos 6 guests - when I install the latest kernel for centos 6.3 -2.6.32-279.1.1.el6 - if you reboot from inside a Centos6 vm it gets stuck in a loop between seabios/grub

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 01:53:15PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:51:05PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:36:08PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:33:35PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 01:55:30PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:53:11PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:49:06PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:48:44PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 02:22:19PM +0300, Michael S. Tsirkin wrote: So as was discussed kvm_set_irq under spinlock is bad for scalability with multiple VCPUs. Why do we need a spinlock simply to protect level_asserted? Let's use an atomic test and set/test and clear

Re: [PATCH RESEND 0/5] Add vhost-blk support

2012-07-18 Thread Stefan Hajnoczi
On Tue, Jul 17, 2012 at 4:09 PM, Michael S. Tsirkin m...@redhat.com wrote: On Fri, Jul 13, 2012 at 04:55:06PM +0800, Asias He wrote: Hi folks, [I am resending to fix the broken thread in the previous one.] This patchset adds vhost-blk support. vhost-blk is a in kernel virito-blk device

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 02:39:10PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 02:22:19PM +0300, Michael S. Tsirkin wrote: So as was discussed kvm_set_irq under spinlock is bad for scalability with multiple VCPUs. Why do we need a spinlock simply to

Re: [PATCH v5 3/4] kvm: Create kvm_clear_irq()

2012-07-18 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 02:08:43PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:53:15PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 01:51:05PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 01:36:08PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 02:48:44PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 02:39:10PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 02:22:19PM +0300, Michael S. Tsirkin wrote: So as was discussed kvm_set_irq under spinlock is bad for scalability

Re: vga passthrough // questions about pci passthrough

2012-07-18 Thread Martin Wolf
On 18.07.2012 11:26, Jan Kiszka wrote: On 2012-07-18 07:45, Martin Wolf wrote: Hello, i was able to passthrough an AMD 7870 videocard to my win7 guest machine. Would you add it to http://www.linux-kvm.org/page/VGA_device_assignment? sure, i will prepare something my host is ubuntu 12.04

Re: kvm build error: undefined reference to `x86_hyper_kvm'

2012-07-18 Thread Prarit Bhargava
On 07/17/2012 10:42 PM, Ren, Yongjie wrote: kvm.git next branch commit: ebf7d2e9 arch/x86/built-in.o: In function `init_hypervisor_platform': (.init.text+0x56b1): undefined reference to `x86_hyper_kvm' arch/x86/built-in.o: In function `init_hypervisor_platform': (.init.text+0x56bc):

Re: kvm build error: undefined reference to `x86_hyper_kvm'

2012-07-18 Thread Prarit Bhargava
On 07/17/2012 10:42 PM, Ren, Yongjie wrote: kvm.git next branch commit: ebf7d2e9 arch/x86/built-in.o: In function `init_hypervisor_platform': (.init.text+0x56b1): undefined reference to `x86_hyper_kvm' arch/x86/built-in.o: In function `init_hypervisor_platform': (.init.text+0x56bc):

Re: vga passthrough // questions about pci passthrough

2012-07-18 Thread Martin Wolf
soundcard logs added On 18.07.2012 14:08, Martin Wolf wrote: On 18.07.2012 11:26, Jan Kiszka wrote: On 2012-07-18 07:45, Martin Wolf wrote: Hello, i was able to passthrough an AMD 7870 videocard to my win7 guest machine. Would you add it to

Re: [RFC-v3 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 12:59:28AM +, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org Hi folks, The following is the RFC-v3 series of tcm_vhost target fabric driver code currently in-flight for-3.6 mainline code. With the merge window opening soon, the

Re: [RFC-v3 3/4] vhost: Add vhost_scsi specific defines

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 12:59:31AM +, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@risingtidesystems.com This patch adds the initial vhost_scsi_ioctl() callers for VHOST_SCSI_SET_ENDPOINT and VHOST_SCSI_CLEAR_ENDPOINT respectively, and also adds struct vhost_vring_target

[PATCH RFC V5 0/3] kvm: Improving directed yield in PLE handler

2012-07-18 Thread Raghavendra K T
Currently Pause Loop Exit (PLE) handler is doing directed yield to a random vcpu on pl-exit. We already have filtering while choosing the candidate to yield_to. This change adds more checks while choosing a candidate to yield_to. On a large vcpu guests, there is a high probability of yielding to

[PATCH RFC V5 1/3] kvm/config: Add config to support ple or cpu relax optimzation

2012-07-18 Thread Raghavendra K T
From: Raghavendra K T raghavendra...@linux.vnet.ibm.com Suggested-by: Avi Kivity a...@redhat.com Signed-off-by: Raghavendra K T raghavendra...@linux.vnet.ibm.com --- arch/s390/kvm/Kconfig |1 + arch/x86/kvm/Kconfig |1 + virt/kvm/Kconfig |3 +++ 3 files changed, 5

[PATCH RFC V5 3/3] kvm: Choose better candidate for directed yield

2012-07-18 Thread Raghavendra K T
From: Raghavendra K T raghavendra...@linux.vnet.ibm.com Currently, on a large vcpu guests, there is a high probability of yielding to the same vcpu who had recently done a pause-loop exit or cpu relax intercepted. Such a yield can lead to the vcpu spinning again and hence degrade the performance.

[PATCH RFC V5 2/3] kvm: Note down when cpu relax intercepted or pause loop exited

2012-07-18 Thread Raghavendra K T
From: Raghavendra K T raghavendra...@linux.vnet.ibm.com Noting pause loop exited vcpu or cpu relax intercepted helps in filtering right candidate to yield. Wrong selection of vcpu; i.e., a vcpu that just did a pl-exit or cpu relax intercepted may contribute to performance degradation.

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Anthony Liguori
On 07/17/2012 04:50 PM, Nicholas A. Bellinger wrote: On Tue, 2012-07-17 at 13:55 -0500, Anthony Liguori wrote: On 07/17/2012 10:05 AM, Michael S. Tsirkin wrote: On Wed, Jul 11, 2012 at 09:15:00PM +, Nicholas A. Bellinger wrote: SNIP It still seems not 100% clear whether this driver

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Paolo Bonzini
Il 18/07/2012 15:42, Anthony Liguori ha scritto: If you add support for a new command, you need to provide userspace a way to disable this command. If you change what gets reported for VPD, you need to provide userspace a way to make VPD look like what it did in a previous version. The QEMU

Re: vga passthrough // questions about pci passthrough

2012-07-18 Thread Alex Williamson
On Wed, 2012-07-18 at 14:37 +0200, Martin Wolf wrote: soundcard logs added On 18.07.2012 14:08, Martin Wolf wrote: On 18.07.2012 11:26, Jan Kiszka wrote: On 2012-07-18 07:45, Martin Wolf wrote: Hello, i was able to passthrough an AMD 7870 videocard to my win7 guest machine.

Re: [PATCH RESEND 5/5] vhost-blk: Add vhost-blk support

2012-07-18 Thread Jeff Moyer
Asias He as...@redhat.com writes: On 07/18/2012 03:10 AM, Jeff Moyer wrote: Asias He as...@redhat.com writes: vhost-blk is a in kernel virito-blk device accelerator. This patch is based on Liu Yuan's implementation with various improvements and bug fixes. Notably, this patch makes guest

Re: [PATCH RFC V5 3/3] kvm: Choose better candidate for directed yield

2012-07-18 Thread Raghavendra K T
On 07/18/2012 07:08 PM, Raghavendra K T wrote: From: Raghavendra K Traghavendra...@linux.vnet.ibm.com +bool kvm_vcpu_eligible_for_directed_yield(struct kvm_vcpu *vcpu) +{ + bool eligible; + + eligible = !vcpu-spin_loop.in_spin_loop || +

Re: [PATCH RESEND 5/5] vhost-blk: Add vhost-blk support

2012-07-18 Thread Asias He
On 07/18/2012 10:31 PM, Jeff Moyer wrote: Asias He as...@redhat.com writes: On 07/18/2012 03:10 AM, Jeff Moyer wrote: Asias He as...@redhat.com writes: vhost-blk is a in kernel virito-blk device accelerator. This patch is based on Liu Yuan's implementation with various improvements and bug

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Alex Williamson
On Wed, 2012-07-18 at 15:07 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 02:48:44PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 02:39:10PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 02:22:19PM +0300, Michael S. Tsirkin wrote: So as was discussed

[RFC v9 00/27] virtio: virtio-blk data plane

2012-07-18 Thread Stefan Hajnoczi
This series implements a dedicated thread for virtio-blk processing using Linux AIO for raw image files only. It is based on qemu-kvm.git a0bc8c3 and somewhat old but I wanted to share it on the list since it has been mentioned on mailing lists and IRC recently. These patches can be used for

[RFC v9 02/27] virtio-blk: Set up host notifier for data plane

2012-07-18 Thread Stefan Hajnoczi
Set up the virtqueue notify ioeventfd that the data plane will monitor. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/virtio-blk.c | 37 + 1 file changed, 37 insertions(+) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index

[RFC v9 03/27] virtio-blk: Data plane thread event loop

2012-07-18 Thread Stefan Hajnoczi
Add a simple event handling loop based on epoll(2). The data plane thread now receives virtqueue notify and Linux AIO completion events. The data plane thread currently does not shut down. Either it needs to be a detached thread or have clean shutdown support. Most of the data plane start/stop

[RFC v9 05/27] virtio-blk: Do cheapest possible memory mapping

2012-07-18 Thread Stefan Hajnoczi
Instead of using QEMU memory access functions, grab the host address of guest physical address zero and simply add to this base address. This not only simplifies vring mapping but will also make virtqueue element access cheap by avoiding QEMU memory access functions in the I/O code path.

[RFC v9 04/27] virtio-blk: Map vring

2012-07-18 Thread Stefan Hajnoczi
Map the vring to host memory so it can be accessed without the overhead of the QEMU memory functions. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/virtio-blk.c | 44 1 file changed, 44 insertions(+) diff --git a/hw/virtio-blk.c

[RFC v9 01/27] virtio-blk: Remove virtqueue request handling code

2012-07-18 Thread Stefan Hajnoczi
Start with a clean slate, a virtio-blk device that supports virtio lifecycle operations and configuration but doesn't do any actual I/O. The I/O is going to happen in a separate optimized data plane thread. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/virtio-blk.c | 496

[RFC v9 08/27] virtio-blk: Read requests from the vring

2012-07-18 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/dataplane/vring.h |8 +-- hw/virtio-blk.c | 62 ++ 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/hw/dataplane/vring.h b/hw/dataplane/vring.h index

[RFC v9 09/27] virtio-blk: Add Linux AIO queue

2012-07-18 Thread Stefan Hajnoczi
Requests read from the vring will be placed in a queue where they can be merged as necessary. Once all requests have been read from the vring, the queue can be submitted. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/dataplane/ioq.h | 104

[RFC v9 12/27] virtio-blk: Add workaround for BUG_ON() dependency in virtio_ring.h

2012-07-18 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/dataplane/vring.h |5 + 1 file changed, 5 insertions(+) diff --git a/hw/dataplane/vring.h b/hw/dataplane/vring.h index 3eab4b4..44ef4a9 100644 --- a/hw/dataplane/vring.h +++ b/hw/dataplane/vring.h @@ -1,6 +1,11 @@ #ifndef

[RFC v9 11/27] virtio-blk: Indirect vring and flush support

2012-07-18 Thread Stefan Hajnoczi
RHEL6 and other new guest kernels use indirect vring descriptors to increase the number of requests that can be batched. This fundamentally changes vring from a scheme that requires fixed resources to something more dynamic (although there is still an absolute maximum number of descriptors).

[RFC v9 16/27] virtio-blk: Kick data plane thread using event notifier set

2012-07-18 Thread Stefan Hajnoczi
--- hw/virtio-blk.c |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 1616be5..d75c187 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -339,8 +339,7 @@ static void virtio_blk_handle_output(VirtIODevice *vdev, VirtQueue *vq)

[RFC v9 06/27] virtio-blk: Take PCI memory range into account

2012-07-18 Thread Stefan Hajnoczi
Support 4 GB physical memory accesses. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/virtio-blk.c |7 +++ 1 file changed, 7 insertions(+) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index abd9386..99654f1 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -64,6

[RFC v9 15/27] notifier: Add a function to set the notifier

2012-07-18 Thread Stefan Hajnoczi
Although past users only needed to test and clear event notifiers, it is useful to be able to set them too. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- event_notifier.c |7 +++ event_notifier.h |1 + 2 files changed, 8 insertions(+) diff --git a/event_notifier.c

[RFC v9 23/27] virtio-blk: Stub out SCSI commands

2012-07-18 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/virtio-blk.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 51807b5..8734029 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -215,14

[RFC v9 13/27] virtio-blk: Increase max requests for indirect vring

2012-07-18 Thread Stefan Hajnoczi
With indirect vring descriptors, one can no longer assume that the maximum number of requests is VRING_MAX / 2 (outhdr and inhdr). Now a single indirect descriptor can contain the outhdr and inhdr so max requests becomes VRING_MAX. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com ---

[RFC v9 20/27] virtio-blk: Add ioscheduler to detect mergable requests

2012-07-18 Thread Stefan Hajnoczi
--- hw/dataplane/iosched.h | 78 hw/virtio-blk.c|5 2 files changed, 83 insertions(+) create mode 100644 hw/dataplane/iosched.h diff --git a/hw/dataplane/iosched.h b/hw/dataplane/iosched.h new file mode 100644 index

[RFC v9 25/27] msix: fix irqchip breakage in msix_try_notify_from_thread()

2012-07-18 Thread Stefan Hajnoczi
Commit bd8b215bce453706c3951460cc7e6627ccb90314 removed #ifdef KVM_CAP_IRQCHIP from hw/msix.c after it turned out linux/kvm.h is not included since msix.o is built in libhw64/. Do the same for msix_try_notify_from_thread() since we do not have access to linux/kvm.h here and hence KVM_CAP_IRQCHIP

[RFC v9 27/27] virtio-blk: add EVENT_IDX support to dataplane

2012-07-18 Thread Stefan Hajnoczi
This patch adds support for the VIRTIO_RING_F_EVENT_IDX feature for interrupt mitigation. virtio-blk doesn't do anything fancy with it so we may not see a performance improvement. This patch will allow newer guest kernels to run successfully. Signed-off-by: Stefan Hajnoczi

[RFC v9 24/27] virtio-blk: fix incorrect length

2012-07-18 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/virtio-blk.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/virtio-blk.c b/hw/virtio-blk.c index 8734029..cff2298 100644 --- a/hw/virtio-blk.c +++ b/hw/virtio-blk.c @@ -131,7 +131,7 @@ static void

[RFC v9 26/27] msix: use upstream kvm_irqchip_set_irq()

2012-07-18 Thread Stefan Hajnoczi
Commit 9507e305ec54062fccc88fcf6fccf1898a7e7141 changed the kvm_set_irq() function to kvm_irqchip_set_irq(). Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/msix.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/msix.c b/hw/msix.c index

[RFC v9 21/27] virtio-blk: Add basic request merging

2012-07-18 Thread Stefan Hajnoczi
This commit adds an I/O scheduler that sorts requests and merges adjacent requests if they have the same operation type (read/write). The code is ugly and not very well factored but it does merge successfully. --- hw/dataplane/ioq.h |3 +- hw/dataplane/iosched.h | 51

[RFC v9 22/27] virtio-blk: Fix request merging

2012-07-18 Thread Stefan Hajnoczi
Khoa Huynh k...@us.ibm.com discovered that request merging is broken. The merged iocb is not updated to reflect the total number of iovecs and the offset is also outdated. This patch fixes request merging. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/virtio-blk.c | 10

[RFC v9 19/27] virtio-blk: Disable guest-host notifies while processing vring

2012-07-18 Thread Stefan Hajnoczi
--- hw/dataplane/vring.h | 28 +++- hw/virtio-blk.c | 47 +++ 2 files changed, 58 insertions(+), 17 deletions(-) diff --git a/hw/dataplane/vring.h b/hw/dataplane/vring.h index 44ef4a9..cdd4d4a 100644 ---

[RFC v9 18/27] virtio-blk: Call ioctl() directly instead of irqfd

2012-07-18 Thread Stefan Hajnoczi
Optimize for the MSI-X enabled and vector unmasked case where it is possible to issue the KVM ioctl() directly instead of using irqfd. This patch introduces a new virtio binding function which tries to notify in a thread-safe way. If this is not possible, the function returns false. Virtio

[RFC v9 10/27] virtio-blk: Stop data plane thread cleanly

2012-07-18 Thread Stefan Hajnoczi
Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com --- hw/dataplane/event-poll.h | 79 --- hw/dataplane/ioq.h| 65 +-- hw/dataplane/vring.h |6 +- hw/virtio-blk.c | 154 +++-- 4

[RFC v9 14/27] virtio-blk: Use pthreads instead of qemu-thread

2012-07-18 Thread Stefan Hajnoczi
Using qemu-thread.h seemed like a nice idea but it has two limitations: 1. QEMU needs to be built with --enable-io-thread 2. qemu-kvm doesn't build with --enable-io-thread For now just copy the pthread_create() code straight into virtio-blk.c. Signed-off-by: Stefan Hajnoczi

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 08:42:21AM -0500, Anthony Liguori wrote: On 07/17/2012 04:50 PM, Nicholas A. Bellinger wrote: On Tue, 2012-07-17 at 13:55 -0500, Anthony Liguori wrote: On 07/17/2012 10:05 AM, Michael S. Tsirkin wrote: On Wed, Jul 11, 2012 at 09:15:00PM +, Nicholas A. Bellinger

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 08:47:23AM -0600, Alex Williamson wrote: On Wed, 2012-07-18 at 15:07 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 02:48:44PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 02:39:10PM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at

Re: [RFC v9 18/27] virtio-blk: Call ioctl() directly instead of irqfd

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:07:45PM +0100, Stefan Hajnoczi wrote: Optimize for the MSI-X enabled and vector unmasked case where it is possible to issue the KVM ioctl() directly instead of using irqfd. Why? Is an ioctl faster? This patch introduces a new virtio binding function which tries to

Re: [RFC v9 00/27] virtio: virtio-blk data plane

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:07:27PM +0100, Stefan Hajnoczi wrote: This series implements a dedicated thread for virtio-blk processing using Linux AIO for raw image files only. It is based on qemu-kvm.git a0bc8c3 and somewhat old but I wanted to share it on the list since it has been

Re: buildbot failure in kvm on next-i386

2012-07-18 Thread Avi Kivity
On 07/18/2012 08:05 AM, k...@buildbot.b1-systems.de wrote: The Buildbot has detected a new failure on builder next-i386 while building kvm. Full details are available at: http://buildbot.b1-systems.de/kvm/builders/next-i386/builds/590 It seems like the config does not include

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Alex Williamson
On Wed, 2012-07-18 at 18:38 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 08:47:23AM -0600, Alex Williamson wrote: On Wed, 2012-07-18 at 15:07 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 02:48:44PM +0300, Gleb Natapov wrote: On Wed, Jul 18, 2012 at 02:39:10PM

Re: [RFC v9 00/27] virtio: virtio-blk data plane

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:07:27PM +0100, Stefan Hajnoczi wrote: This series implements a dedicated thread for virtio-blk processing using Linux AIO for raw image files only. It is based on qemu-kvm.git a0bc8c3 and somewhat old but I wanted to share it on the list since it has been

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Christoph Hellwig
On Wed, Jul 18, 2012 at 08:42:21AM -0500, Anthony Liguori wrote: If you add support for a new command, you need to provide userspace a way to disable this command. If you change what gets reported for VPD, you need to provide userspace a way to make VPD look like what it did in a previous

Re: [PATCH v5 1/4] kvm: Extend irqfd to support level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 09:48:01AM -0600, Alex Williamson wrote: On Wed, 2012-07-18 at 18:38 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 08:47:23AM -0600, Alex Williamson wrote: On Wed, 2012-07-18 at 15:07 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 02:48:44PM

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 11:53:38AM -0400, Christoph Hellwig wrote: On Wed, Jul 18, 2012 at 08:42:21AM -0500, Anthony Liguori wrote: If you add support for a new command, you need to provide userspace a way to disable this command. If you change what gets reported for VPD, you need to

Re: [RFC-v3 4/4] tcm_vhost: Initial merge for vhost level target fabric driver

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 12:59:32AM +, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org This patch adds the initial code for tcm_vhost, a Vhost level TCM fabric driver for virtio SCSI initiators into KVM guest. This code is currently up and running on v3.5-rc2

Re: [RFC-v3 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 12:59:28AM +, Nicholas A. Bellinger wrote: From: Nicholas Bellinger n...@linux-iscsi.org Hi folks, The following is the RFC-v3 series of tcm_vhost target fabric driver code currently in-flight for-3.6 mainline code. So I sent some comments. I think it's in an

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Anthony Liguori
On 07/18/2012 10:53 AM, Christoph Hellwig wrote: On Wed, Jul 18, 2012 at 08:42:21AM -0500, Anthony Liguori wrote: If you add support for a new command, you need to provide userspace a way to disable this command. If you change what gets reported for VPD, you need to provide userspace a way to

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Rustad, Mark D
On Jul 18, 2012, at 9:00 AM, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 11:53:38AM -0400, Christoph Hellwig wrote: On Wed, Jul 18, 2012 at 08:42:21AM -0500, Anthony Liguori wrote: If you add support for a new command, you need to provide userspace a way to disable this command. If

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread James Bottomley
On Wed, 2012-07-18 at 11:00 -0500, Anthony Liguori wrote: On 07/18/2012 10:53 AM, Christoph Hellwig wrote: On Wed, Jul 18, 2012 at 08:42:21AM -0500, Anthony Liguori wrote: If you add support for a new command, you need to provide userspace a way to disable this command. If you change

Re: [Qemu-devel] [PATCH v4] Fixes related to processing of qemu's -numa option

2012-07-18 Thread Eduardo Habkost
On Mon, Jul 16, 2012 at 09:31:30PM -0700, Chegu Vinod wrote: Changes since v3: - using bitmap_set() instead of set_bit() in numa_add() routine. - removed call to bitmak_zero() since bitmap_new() also zeros' the bitmap. - Rebased to the latest qemu. Tested-by: Eduardo Habkost

Re: [RFC-v2 0/4] tcm_vhost+cmwq fabric driver code for-3.6

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:42:33PM +, Rustad, Mark D wrote: On Jul 18, 2012, at 9:00 AM, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 11:53:38AM -0400, Christoph Hellwig wrote: On Wed, Jul 18, 2012 at 08:42:21AM -0500, Anthony Liguori wrote: If you add support for a new

Re: [RFC v9 11/27] virtio-blk: Indirect vring and flush support

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:07:38PM +0100, Stefan Hajnoczi wrote: RHEL6 and other new guest kernels use indirect vring descriptors to increase the number of requests that can be batched. This fundamentally changes vring from a scheme that requires fixed resources to something more dynamic

Re: [RFC v9 06/27] virtio-blk: Take PCI memory range into account

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:07:33PM +0100, Stefan Hajnoczi wrote: Support 4 GB physical memory accesses. Signed-off-by: Stefan Hajnoczi stefa...@linux.vnet.ibm.com Need some sane APIs, this is just too scary. --- hw/virtio-blk.c |7 +++ 1 file changed, 7 insertions(+) diff

  1   2   >