Re: Is there any consumer of virtio-balloon now?

2014-03-21 Thread Paolo Bonzini
Il 21/03/2014 05:22, Kai Huang ha scritto: Hi, I see the virtio-balloon is designed for memory auto balloon between KVM host and guest, but from latest linux kernel mainline code, looks currently there's no consumer actually using it? Would you let me know who is the consumer if there's any?

Re: Is there any consumer of virtio-balloon now?

2014-03-21 Thread Kashyap Chamarthy
On Fri, Mar 21, 2014 at 12:22:54PM +0800, Kai Huang wrote: Hi, I see the virtio-balloon is designed for memory auto balloon between KVM host and guest, but from latest linux kernel mainline code, looks currently there's no consumer actually using it? Would you let me know who is the

Re: [PATCH v2 2/5] KVM: Add per-vm capability enablement.

2014-03-21 Thread Christian Borntraeger
On 17/03/14 19:11, Cornelia Huck wrote: Allow KVM_ENABLE_CAP to act on a vm as well as on a vcpu. This makes more sense when the caller wants to enable a vm-related capability. s390 will be the first user; wire it up. Reviewed-by: Thomas Huth th...@linux.vnet.ibm.com Signed-off-by:

Re: [PATCH v2 3/5] KVM: s390: adapter interrupt sources

2014-03-21 Thread Christian Borntraeger
On 17/03/14 19:11, Cornelia Huck wrote: Add a new interface to register/deregister sources of adapter interrupts identified by an unique id via the flic. Adapters may also be maskable and carry a list of pinned pages. These adapters will be used by irq routing later. Signed-off-by:

[PATCH v2 4/4] KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP

2014-03-21 Thread Paolo Bonzini
After the previous patches, an interrupt whose bit is set in the IRR register will never be in the LAPIC's IRR and has never been injected on the migration source. So inject it on the destination. This fixes migration of Windows guests without HPET (they use the RTC to trigger the scheduler

[PATCH v2 3/4] KVM: ioapic: extract body of kvm_ioapic_set_irq

2014-03-21 Thread Paolo Bonzini
We will reuse it to process a nonzero IRR that is passed to KVM_SET_IRQCHIP. Reviewed-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: more comments change argument name from level to irq_level virt/kvm/ioapic.c |

[PATCH v2 0/4] KVM: cleanup ioapic and fix KVM_SET_IRQCHIP with irr != 0

2014-03-21 Thread Paolo Bonzini
Unlike the old qemu-kvm, which really never did that, with new QEMU it is for some reason somewhat likely to migrate a VM with a nonzero IRR in the ioapic. In the case of ISA edge-triggered interrupts, this represents an interrupt that has not left the IOAPIC, which would be okay but it is not

[PATCH v2 1/4] KVM: ioapic: merge ioapic_deliver into ioapic_service

2014-03-21 Thread Paolo Bonzini
Commonize the handling of masking, which was absent for kvm_ioapic_set_irq. Setting remote_irr does not need a separate function either, and merging the two functions avoids confusion. Reviewed-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com ---

[PATCH v2 2/4] KVM: ioapic: clear IRR for edge-triggered interrupts at delivery

2014-03-21 Thread Paolo Bonzini
This ensures that IRR bits are set in the KVM_GET_IRQCHIP result only if the interrupt is still sitting in the IOAPIC. After the next patches, it avoids spurious reinjection of the interrupt when KVM_SET_IRQCHIP is called. Reviewed-by: Alex Williamson alex.william...@redhat.com Signed-off-by:

Re: [PATCH v2 4/5] KVM: s390: irq routing for adapter interrupts.

2014-03-21 Thread Christian Borntraeger
On 17/03/14 19:11, Cornelia Huck wrote: Introduce a new interrupt class for s390 adapter interrupts and enable irqfds for s390. This is depending on a new s390 specific vm capability, KVM_CAP_S390_IRQCHIP, that needs to be enabled by userspace. Signed-off-by: Cornelia Huck

[PATCH RFC V2 4/4] tools: virtio: add a top-like utility for displaying vhost satistics

2014-03-21 Thread Jason Wang
This patch adds simple python to display vhost satistics of vhost, the codes were based on kvm_stat script from qemu. As work function has been recored, filters could be used to distinguish which kinds of work are being executed or queued: vhost statistics vhost_virtio_update_used_idx

[PATCH RFC V2 3/4] vhost_net: add basic tracepoints for vhost_net

2014-03-21 Thread Jason Wang
To help performance analyze and debugging, this patch introduces tracepoints for vhost_net. Two tracepoints were introduced, packets sending and receiving. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/vhost/net.c | 5 + drivers/vhost/net_trace.h | 53

[PATCH RFC V2 2/4] vhost: basic tracepoints

2014-03-21 Thread Jason Wang
To help for the performance optimizations and debugging, this patch tracepoints for vhost. Two kinds of activities were traced: virtio and vhost work queuing/wakeup. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/vhost/net.c | 1 + drivers/vhost/trace.h | 175

[PATCH RFC V2 0/4] Adding tracepoints to vhost/net

2014-03-21 Thread Jason Wang
Recent debugging on vhost net zerocopy shows the need of tracepoints. So to help in vhost{net} debugging and performance analyzing, the following series adding basic tracepoints to vhost. Operations of both vhost and vhost_net were traced in current implementation. A top-like satistics displaying

[PATCH RFC V2 1/4] vhost: introduce queue_index for tracing

2014-03-21 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/vhost/net.c | 1 + drivers/vhost/vhost.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index a0fa5de..85d666c 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -708,6 +708,7

Re: [PATCH v2 3/5] KVM: s390: adapter interrupt sources

2014-03-21 Thread Cornelia Huck
On Fri, 21 Mar 2014 10:26:35 +0100 Christian Borntraeger borntrae...@de.ibm.com wrote: On 17/03/14 19:11, Cornelia Huck wrote: Add a new interface to register/deregister sources of adapter interrupts identified by an unique id via the flic. Adapters may also be maskable and carry a list of

Re: [PATCH v2 4/5] KVM: s390: irq routing for adapter interrupts.

2014-03-21 Thread Cornelia Huck
On Fri, 21 Mar 2014 10:32:03 +0100 Christian Borntraeger borntrae...@de.ibm.com wrote: On 17/03/14 19:11, Cornelia Huck wrote: Introduce a new interrupt class for s390 adapter interrupts and enable irqfds for s390. This is depending on a new s390 specific vm capability,

[PATCH v4] core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors

2014-03-21 Thread Zoltan Kiss
skb_zerocopy can copy elements of the frags array between skbs, but it doesn't orphan them. Also, it doesn't handle errors, so this patch takes care of that as well, and modify the callers accordingly. skb_tx_error() is also added to the callers so they will signal the failed delivery towards the

Re: [PATCH v3] core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors

2014-03-21 Thread Zoltan Kiss
On 20/03/14 22:22, Thomas Graf wrote: On 03/20/2014 05:02 PM, Zoltan Kiss wrote: --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -464,7 +464,9 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb, } nla-nla_len = nla_attr_size(skb-len);

Re: [PATCH v4] core, nfqueue, openvswitch: Orphan frags in skb_zerocopy and handle errors

2014-03-21 Thread Thomas Graf
On 03/21/2014 11:31 AM, Zoltan Kiss wrote: skb_zerocopy can copy elements of the frags array between skbs, but it doesn't orphan them. Also, it doesn't handle errors, so this patch takes care of that as well, and modify the callers accordingly. skb_tx_error() is also added to the callers so they

[PATCH v3 4/5] s390x/virtio-ccw: reference-counted indicators

2014-03-21 Thread Cornelia Huck
Make code using the same indicators point to a single allocated structure that is freed when the last user goes away. This will be used by the irqfd code to unmap addresses after the last user is gone. Reviewed-by: Thomas Huth th...@linux.vnet.ibm.com Signed-off-by: Cornelia Huck

[PATCH v3 0/5] qemu: irqfds for s390x

2014-03-21 Thread Cornelia Huck
Here's the next iteration of the qemu patchset enabling irqfds for s390x, again a companion patchset for KVM: irqfds for s390. Changes from v2: - rebased against current master - use object_resolve_path() to grab the flic - more explicit return code check for enabling KVM_CAP_S390_IRQCHIP

[PATCH v3 3/4] KVM: s390: irq routing for adapter interrupts.

2014-03-21 Thread Cornelia Huck
Introduce a new interrupt class for s390 adapter interrupts and enable irqfds for s390. This is depending on a new s390 specific vm capability, KVM_CAP_S390_IRQCHIP, that needs to be enabled by userspace. Acked-by: Christian Borntraeger borntrae...@de.ibm.com Signed-off-by: Cornelia Huck

[PATCH v3 1/5] linux-headers: add new interfaces

2014-03-21 Thread Cornelia Huck
Per-vm capability enablement, adapter interrupt sources, irq routing on s390. Reviewed-by: Thomas Huth th...@linux.vnet.ibm.com Signed-off-by: Cornelia Huck cornelia.h...@de.ibm.com --- linux-headers/asm-s390/kvm.h | 24 linux-headers/linux/kvm.h| 17

[PATCH v3 2/5] kvm: add kvm_enable_cap_{vm,vcpu}

2014-03-21 Thread Cornelia Huck
Provide helper functions for enabling capabilities (on a vcpu and on a vm). Reviewed-by: Thomas Huth th...@linux.vnet.ibm.com Signed-off-by: Cornelia Huck cornelia.h...@de.ibm.com --- include/sysemu/kvm.h |4 kvm-all.c| 19 ++- 2 files changed, 22

[PATCH v3 0/4] KVM: irqfds for s390

2014-03-21 Thread Cornelia Huck
Hi, here's the next iteration of my patchset introducing irqfds for s390. Changes from v2: - rebased against current kvm/queue - kvm common code lock fix is already in queue - move some changes that belonged in patch 2 from patch 3 - add a limit for mapped pages to patch 2 - collected some acks

[PATCH v3 5/5] s390x/virtio-ccw: Wire up irq routing and irqfds.

2014-03-21 Thread Cornelia Huck
Make use of the new s390 adapter irq routing support to enable real in-kernel irqfds for virtio-ccw with adapter interrupts. Note that s390 doesn't provide the common KVM_CAP_IRQCHIP capability, but rather needs KVM_CAP_S390_IRQCHIP to be enabled. This is to ensure backward compatibility.

[PATCH v3 3/5] s390x: Add I/O adapter registration.

2014-03-21 Thread Cornelia Huck
Register an I/O adapter interrupt source for when virtio-ccw devices start using adapter interrupts. Reviewed-by: Thomas Huth th...@linux.vnet.ibm.com Signed-off-by: Cornelia Huck cornelia.h...@de.ibm.com --- hw/intc/s390_flic.c | 59 +

[PATCH v3 4/4] KVM: Bump KVM_MAX_IRQ_ROUTES for s390

2014-03-21 Thread Cornelia Huck
The maximum number for irq routes is currently 1024, which is a bit on the small size for s390: We support up to 4 x 64k virtual devices with up to 64 queues, and we need one route for each of the queues if we want to operate it via irqfd. Let's bump this to 4k on s390 for now, as this at least

[PATCH v3 2/4] KVM: s390: adapter interrupt sources

2014-03-21 Thread Cornelia Huck
Add a new interface to register/deregister sources of adapter interrupts identified by an unique id via the flic. Adapters may also be maskable and carry a list of pinned pages. These adapters will be used by irq routing later. Acked-by: Christian Borntraeger borntrae...@de.ibm.com

[PATCH v3 1/4] KVM: Add per-vm capability enablement.

2014-03-21 Thread Cornelia Huck
Allow KVM_ENABLE_CAP to act on a vm as well as on a vcpu. This makes more sense when the caller wants to enable a vm-related capability. s390 will be the first user; wire it up. Reviewed-by: Thomas Huth th...@linux.vnet.ibm.com Reviewed-by: Christian Borntraeger borntrae...@de.ibm.com

Re: [PATCH v2 4/4] KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP

2014-03-21 Thread Alex Williamson
On Fri, 2014-03-21 at 10:28 +0100, Paolo Bonzini wrote: After the previous patches, an interrupt whose bit is set in the IRR register will never be in the LAPIC's IRR and has never been injected on the migration source. So inject it on the destination. This fixes migration of Windows guests

Re: [PATCH v4 00/10] KVM Support for MIPS32 Processors

2014-03-21 Thread James Hogan
On 20/03/14 12:44, Paolo Bonzini wrote: Il 20/03/2014 11:00, James Hogan ha scritto: Just a few comments. With what version of the kernel can this be tested? KVM support was added in v3.10, including defconfigs and a CONFIG_KVM_GUEST to ensure the kernel is linked to the different address.

Re: [PATCH v2 1/4] KVM: ioapic: merge ioapic_deliver into ioapic_service

2014-03-21 Thread Eduardo Habkost
On Fri, Mar 21, 2014 at 10:27:58AM +0100, Paolo Bonzini wrote: Commonize the handling of masking, which was absent for kvm_ioapic_set_irq. Setting remote_irr does not need a separate function either, and merging the two functions avoids confusion. Reviewed-by: Alex Williamson

[PATCH] realmode: add performance test

2014-03-21 Thread Paolo Bonzini
There's room for speeding up emulation of invalid guest state. Let's track our progress by adding a very small performance test. Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- x86/realmode.c | 25 + 1 file changed, 25 insertions(+) diff --git a/x86/realmode.c

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Peter Wu
cc'ing kvm people and list. On Friday 21 March 2014 18:42:40 Peter Wu wrote: Hi, While trying to run QEMU with `-enable-kvm -host cpu`, I get a GPF in intel_pmu_lbr_reset(): [0.024000] general protection fault: [#1] [0.024000] CPU: 0 PID: 1 Comm: swapper Not tainted

Re: [PATCH v2 2/4] KVM: ioapic: clear IRR for edge-triggered interrupts at delivery

2014-03-21 Thread Eduardo Habkost
On Fri, Mar 21, 2014 at 10:27:59AM +0100, Paolo Bonzini wrote: This ensures that IRR bits are set in the KVM_GET_IRQCHIP result only if the interrupt is still sitting in the IOAPIC. After the next patches, it avoids spurious reinjection of the interrupt when KVM_SET_IRQCHIP is called.

Re: [PATCH v2 3/4] KVM: ioapic: extract body of kvm_ioapic_set_irq

2014-03-21 Thread Radim Krčmář
2014-03-21 10:28+0100, Paolo Bonzini: We will reuse it to process a nonzero IRR that is passed to KVM_SET_IRQCHIP. Reviewed-by: Alex Williamson alex.william...@redhat.com Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- v1-v2: more comments change argument name from

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread Venkatesh Srinivas
On Fri, Mar 21, 2014 at 10:46 AM, Peter Wu pe...@lekensteyn.nl wrote: cc'ing kvm people and list. On Friday 21 March 2014 18:42:40 Peter Wu wrote: Hi, While trying to run QEMU with `-enable-kvm -host cpu`, I get a GPF in intel_pmu_lbr_reset(): [0.024000] general protection fault:

Re: GPF in intel_pmu_lbr_reset() with qemu -cpu host

2014-03-21 Thread H. Peter Anvin
Calling this a bug in the PMU code is ridiculous. If KVM tells the system it os a specific vendor-family-model-stepping but diverges in behavior then it, by definition, is broken. On March 21, 2014 12:04:32 PM PDT, Venkatesh Srinivas venkate...@google.com wrote: On Fri, Mar 21, 2014 at 10:46

Re: [PATCH 8/9] PCI: Ignore BAR contents when firmware left decoding disabled

2014-03-21 Thread Bjorn Helgaas
[+cc kvm list] On Wed, Mar 19, 2014 at 7:32 PM, Ming Lei tom.leim...@gmail.com wrote: On Thu, Mar 20, 2014 at 12:45 AM, Bjorn Helgaas bhelg...@google.com wrote: On Tue, Mar 18, 2014 at 10:52 PM, Ming Lei tom.leim...@gmail.com wrote: Hi, Looks Sasha fixed the problem in lkvm tool[1]. Sasha,

Re: [PATCH 8/9] PCI: Ignore BAR contents when firmware left decoding disabled

2014-03-21 Thread Sasha Levin
On 03/21/2014 04:07 PM, Bjorn Helgaas wrote: I think I figured out what the problem is. In virtio_pci__init(), we allocate some address space with pci_get_io_space_block(), save its address in vpci-mmio_addr, and hook that address space up to virtio_pci__io_mmio_callback with

Re: [PATCH 8/9] PCI: Ignore BAR contents when firmware left decoding disabled

2014-03-21 Thread Bjorn Helgaas
On Fri, Mar 21, 2014 at 2:25 PM, Sasha Levin sasha.le...@oracle.com wrote: On 03/21/2014 04:07 PM, Bjorn Helgaas wrote: I think I figured out what the problem is. In virtio_pci__init(), we allocate some address space with pci_get_io_space_block(), save its address in vpci-mmio_addr, and hook

Re: [RFC] ARM VM System Sepcification

2014-03-21 Thread Christoffer Dall
On Fri, Mar 07, 2014 at 08:24:18PM +0800, Grant Likely wrote: On Thu, 6 Mar 2014 12:04:50 +, Robie Basak robie.ba...@canonical.com wrote: On Thu, Mar 06, 2014 at 12:44:57PM +0100, Laszlo Ersek wrote: If I understand correctly, the question is this: Given a hypervisor that