Re: [PATCH 0/4] KVM: Dirty logging optimization using rmap

2011-11-16 Thread Takuya Yoshikawa
Adding qemu-devel to Cc. (2011/11/14 21:39), Avi Kivity wrote: On 11/14/2011 12:56 PM, Takuya Yoshikawa wrote: (2011/11/14 19:25), Avi Kivity wrote: On 11/14/2011 11:20 AM, Takuya Yoshikawa wrote: This is a revised version of my previous work. I hope that the patches are more self

Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout

2011-11-16 Thread Sasha Levin
On Wed, 2011-11-16 at 09:21 +0200, Michael S. Tsirkin wrote: On Wed, Nov 16, 2011 at 10:28:52AM +1030, Rusty Russell wrote: On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin levinsasha...@gmail.com wrote: On Fri, Nov 11, 2011 at 6:24 AM, Rusty Russell ru...@rustcorp.com.au wrote:

Re: [PATCH 0/4] KVM: Dirty logging optimization using rmap

2011-11-16 Thread Avi Kivity
On 11/16/2011 06:28 AM, Takuya Yoshikawa wrote: (2011/11/14 21:39), Avi Kivity wrote: There was a patchset from Peter Zijlstra that converted mmu notifiers to be preemptible, with that, we can convert the mmu spinlock to a mutex, I'll see what happened to it. Interesting! There is a third

Re: [PATCHv2 RFC] virtio-spec: flexible configuration layout

2011-11-16 Thread Michael S. Tsirkin
On Wed, Nov 16, 2011 at 10:17:39AM +0200, Sasha Levin wrote: On Wed, 2011-11-16 at 09:21 +0200, Michael S. Tsirkin wrote: On Wed, Nov 16, 2011 at 10:28:52AM +1030, Rusty Russell wrote: On Fri, 11 Nov 2011 09:39:13 +0200, Sasha Levin levinsasha...@gmail.com wrote: On Fri, Nov 11, 2011

Re: [RFC] kvm tools: Implement multiple VQ for virtio-net

2011-11-16 Thread Krishna Kumar2
jason wang jasow...@redhat.com wrote on 11/16/2011 11:40:45 AM: Hi Jason, Have any thought in mind to solve the issue of flow handling? So far nothing concrete. Maybe some performance numbers first is better, it would let us know where we are. During the test of my patchset, I find big

Re: [PATCH 0/2] Introduce iommu_commit() function

2011-11-16 Thread Avi Kivity
On 06/23/2011 06:38 PM, David Woodhouse wrote: On Thu, 2011-06-23 at 17:31 +0200, Joerg Roedel wrote: David, I think especially VT-d can benefit from such a callback. I will implement support for it in the AMD IOMMU driver and post a patch-set soon. Any comments, thoughts? Ick. We

Re: [RFC] kvm tools: Implement multiple VQ for virtio-net

2011-11-16 Thread jason wang
On 11/16/2011 05:09 PM, Krishna Kumar2 wrote: jason wang jasow...@redhat.com wrote on 11/16/2011 11:40:45 AM: Hi Jason, Have any thought in mind to solve the issue of flow handling? So far nothing concrete. Maybe some performance numbers first is better, it would let us know where we are.

[PATCH 1/2] kvm tools: Add optional callbacks for VQs

2011-11-16 Thread Sasha Levin
This patch adds optional callbacks which get called when the VQ gets assigned an eventfd for notifications, and when it gets assigned with a GSI. This allows the device to pass the eventfds to 3rd parties which can use them to notify and get notifications regarding the VQ. Signed-off-by: Sasha

[PATCH 2/2] kvm tools: Add vhost-net support

2011-11-16 Thread Sasha Levin
This patch adds support to using the vhost-net device when using a tap backed virtio-net device. Activating vhost-net is done by appending a 'vhost=1' flag to the net device configuration. For example: 'kvm run -n mode=tap,vhost=1' Cc: Michael S. Tsirkin m...@redhat.com Signed-off-by:

Re: [PATCH 2/2] kvm tools: Add vhost-net support

2011-11-16 Thread Sasha Levin
On Wed, 2011-11-16 at 14:24 +0200, Sasha Levin wrote: This patch adds support to using the vhost-net device when using a tap backed virtio-net device. Activating vhost-net is done by appending a 'vhost=1' flag to the net device configuration. For example: 'kvm run -n

Re: [PATCH 0/2] Introduce iommu_commit() function

2011-11-16 Thread Joerg Roedel
On Wed, Nov 16, 2011 at 11:00:56AM +0900, KyongHo Cho wrote: On Wed, Jun 29, 2011 at 2:51 PM, Joerg Roedel j...@8bytes.org wrote: In the 'next' branch of http://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git, I found that iommu_commit() is removed. Why is it removed? It was never

Re: [RFC] kvm tools: Add support for virtio-mmio

2011-11-16 Thread Pawel Moll
On Tue, 2011-11-15 at 17:56 +, Sasha Levin wrote: Hmm... If thats the plan, it should probably be a virtio thing (not virtio-mmio specific). Either way, it could also use some clarification in the spec. Well, the spec (p. 2.1) says: The Subsystem Vendor ID should reflect the PCI Vendor

Re: [RFC] kvm tools: Add support for virtio-mmio

2011-11-16 Thread Sasha Levin
On Wed, 2011-11-16 at 13:21 +, Pawel Moll wrote: On Tue, 2011-11-15 at 17:56 +, Sasha Levin wrote: Hmm... If thats the plan, it should probably be a virtio thing (not virtio-mmio specific). Either way, it could also use some clarification in the spec. Well, the spec (p. 2.1)

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-16 Thread Konrad Rzeszutek Wilk
On Fri, Nov 11, 2011 at 03:10:56PM -0700, Alex Williamson wrote: Thanks Konrad! Comments inline. On Fri, 2011-11-11 at 12:51 -0500, Konrad Rzeszutek Wilk wrote: On Thu, Nov 03, 2011 at 02:12:24PM -0600, Alex Williamson wrote: VFIO provides a secure, IOMMU based interface for user space

[ANNOUNCE] qemu-kvm-1.0-rc2

2011-11-16 Thread Avi Kivity
qemu-kvm-1.0-rc2 is now available. This release is based on the upstream qemu 1.0-rc2, plus kvm-specific enhancements. This release can be used with the kvm kernel modules provided by your distribution kernel, or by the modules in the kvm-kmod package, such as kvm-kmod-3.1.

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-16 Thread Scott Wood
On 11/11/2011 04:10 PM, Alex Williamson wrote: Thanks Konrad! Comments inline. On Fri, 2011-11-11 at 12:51 -0500, Konrad Rzeszutek Wilk wrote: On Thu, Nov 03, 2011 at 02:12:24PM -0600, Alex Williamson wrote: +When supported, as indicated by the device flags, reset the device. + +#define

[PATCH 0/6] pci-assign: Multiple fixes and cleanups

2011-11-16 Thread Alex Williamson
These patches are all independent. Patch 1 2 fix serious usability bugs. Patches 3-6 are more subtle things that Markus was able to find with Coverity. Patch 1 fixes https://bugs.launchpad.net/qemu/+bug/875723 I also tested https://bugs.launchpad.net/qemu/+bug/877155 but I'm unable to

[PATCH 1/6] pci-assign: Fix device removal

2011-11-16 Thread Alex Williamson
We're destroying the memory container before we remove the subregions it holds. This fixes: https://bugs.launchpad.net/qemu/+bug/875723 Signed-off-by: Alex Williamson alex.william...@redhat.com --- hw/device-assignment.c | 13 + 1 files changed, 13 insertions(+), 0 deletions(-)

[PATCH 2/6] pci-assign: Fix I/O port

2011-11-16 Thread Alex Williamson
The old_portio structure seems broken. Throw it away and switch to the new style. This was hitting an assert when trying to make use of I/O port regions. Signed-off-by: Alex Williamson alex.william...@redhat.com --- hw/device-assignment.c | 103

[PATCH 3/6] pci-assign: Fix PCI_EXP_FLAGS_TYPE shift

2011-11-16 Thread Alex Williamson
Coverity found that we're doing (uint16_t)type 0xf0 8. This is obviously always 0x0, so our attempt to filter out some device types thinks everything is an endpoint. Fix shift amount. Signed-off-by: Alex Williamson alex.william...@redhat.com --- hw/device-assignment.c |2 +- 1 files

[PATCH 4/6] pci-assign: Fix PCIe lnkcap

2011-11-16 Thread Alex Williamson
Another Coverity found issue, lnkcap is a 32bit register and we're masking bits 16 17. Fix to uin32_t. Signed-off-by: Alex Williamson alex.william...@redhat.com --- hw/device-assignment.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/device-assignment.c

[PATCH 5/6] pci-assign: Remove bogus PCIe lnkcap wmask setting

2011-11-16 Thread Alex Williamson
All the fields of lnkcap are read-only and this is setting it with mask values from LNKCTL. Just below it, we indicate link control is read only, so this appears to be a stray chunk left in from development. Trivial comment fix while we're here. Signed-off-by: Alex Williamson

[PATCH 6/6] pci-assign: Harden I/O port test

2011-11-16 Thread Alex Williamson
Markus Armbruster points out that we're missing a 0 check from pread while trying to probe for pci-sysfs io-port resource support. We don't expect a short read, but we should harden the test to abort if we get one so we're not potentially looking at a stale errno. Signed-off-by: Alex Williamson

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-16 Thread Alex Williamson
On Tue, 2011-11-15 at 16:29 -0600, Scott Wood wrote: On 11/15/2011 03:40 PM, Aaron Fabbri wrote: On 11/15/11 12:10 PM, Scott Wood scottw...@freescale.com wrote: On 11/15/2011 12:34 AM, David Gibson wrote: snip +static int allow_unsafe_intrs;

[RFC PATCH 11/11] KVM: PPC: Eliminate global spinlock in kvmppc_h_enter

2011-11-16 Thread Paul Mackerras
From dfd5bcfac841f8a36593edf60d9fb15e0d633287 Mon Sep 17 00:00:00 2001 From: Paul Mackerras pau...@samba.org Date: Mon, 14 Nov 2011 13:30:38 +1100 Subject: Currently, kvmppc_h_enter takes a spinlock that is global to the guest, kvm-mmu_lock, in order to check for pending PTE invalidations

Re: [RFC PATCH] vfio: VFIO Driver core framework

2011-11-16 Thread David Gibson
On Tue, Nov 15, 2011 at 11:01:28AM -0700, Alex Williamson wrote: On Tue, 2011-11-15 at 17:34 +1100, David Gibson wrote: On Thu, Nov 03, 2011 at 02:12:24PM -0600, Alex Williamson wrote: diff --git a/Documentation/vfio.txt b/Documentation/vfio.txt new file mode 100644 index

kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.

2011-11-16 Thread David Evensky
There was a patch (quoted below) that changed networking at the end of September. When I try to set the guest_mac from the usage in the patch and an admittaly too brief a look at the code, the guest's mac address isn't being set. I'm using: sudo /path/to/linux-kvm/tools/kvm/kvm run -c 1 -m 256

Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.

2011-11-16 Thread Sasha Levin
On Wed, 2011-11-16 at 16:42 -0800, David Evensky wrote: There was a patch (quoted below) that changed networking at the end of September. When I try to set the guest_mac from the usage in the patch and an admittaly too brief a look at the code, the guest's mac address isn't being set. I'm

Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.

2011-11-16 Thread Pekka Enberg
On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin levinsasha...@gmail.com wrote: Also, when I start the guest I sometimes get the following error message:   # kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757 KVM_GET_SUPPORTED_CPUID failed: Argument list too long Heh, we were

Re: kvm-tools: can't seem to set guest_mac and KVM_GET_SUPPORTED_CPUID failed.

2011-11-16 Thread Sasha Levin
On Thu, 2011-11-17 at 08:53 +0200, Pekka Enberg wrote: On Thu, Nov 17, 2011 at 8:07 AM, Sasha Levin levinsasha...@gmail.com wrote: Also, when I start the guest I sometimes get the following error message: # kvm run -k /path/to/bzImage-3.0.8 -m 256 -c 1 --name guest-15757

[RFC PATCH] kvm tools, qcow: Add the support for copy-on-write clusters

2011-11-16 Thread Lan Tianyu
When meeting request to write the cluster without copied flag, allocate a new cluster and write original data with modification to the new cluster. This also can add support for the writing operation of the qcow2 compressed image. Signed-off-by: Lan Tianyu tianyu@intel.com ---

[RFC PATCH 10/11] KVM: PPC: Implement MMU notifiers

2011-11-16 Thread Paul Mackerras
This implements the low-level functions called by the MMU notifiers in the generic KVM code, and defines KVM_ARCH_WANT_MMU_NOTIFIER if CONFIG_KVM_BOOK3S_64_HV so that the generic KVM MMU notifiers get included. That means we also have to take notice of when PTE invalidations are in progress, as

[RFC PATCH 07/11] KVM: PPC: Convert do_h_register_vpa to use Linux page tables

2011-11-16 Thread Paul Mackerras
This makes do_h_register_vpa use a new helper function, kvmppc_pin_guest_page, to pin the page containing the virtual processor area that the guest wants to register. The logic of whether to use the userspace Linux page tables or the slot_pfns array is thus hidden in kvmppc_pin_guest_page. There

[PATCH 02/11] KVM: PPC: Keep a record of HV guest view of hashed page table entries

2011-11-16 Thread Paul Mackerras
This adds an array that parallels the guest hashed page table (HPT), that is, it has one entry per HPTE, used to store the guest's view of the second doubleword of the corresponding HPTE. The first doubleword in the HPTE is the same as the guest's idea of it, so we don't need to store a copy, but

[RFC PATCH 08/11] KVM: PPC: Add a page fault handler function

2011-11-16 Thread Paul Mackerras
This adds a kvmppc_book3s_hv_page_fault function that is capable of handling the fault we get if the guest tries to access a non-present page (one that we have marked with storage key 31 and no-execute), and either doing MMIO emulation, or making the page resident and rewriting the guest HPTE to

[PATCH 03/11] KVM: PPC: Allow use of small pages to back guest memory

2011-11-16 Thread Paul Mackerras
From: Nishanth Aravamudan n...@us.ibm.com This puts the page frame numbers for the memory backing the guest in the slot-rmap array for each slot, rather than using the ram_pginfo array. Since the rmap array is vmalloc'd, we use real_vmalloc_addr() to access it when we access it in real mode in

[RFC PATCH 06/11] KVM: PPC: Use Linux page tables in h_enter and map_vrma

2011-11-16 Thread Paul Mackerras
This changes kvmppc_h_enter() and kvmppc_map_vrma to get the real page numbers that they put into the guest HPT from the Linux page tables for our userspace as an alternative to getting them from the slot_pfns arrays. In future this will enable us to avoid pinning all of guest memory on POWER7,

[RFC PATCH 09/11] KVM: PPC: Maintain a doubly-linked list of guest HPTEs for each gfn

2011-11-16 Thread Paul Mackerras
This expands the reverse mapping array to contain two links for each HPTE which are used to link together HPTEs that correspond to the same guest logical page. Each circular list of HPTEs is pointed to by the rmap array entry for the guest logical page, pointed to by the relevant memslot. Links

[PATCH 05/11] KVM: PPC: Use a separate vmalloc'd array to store pfns

2011-11-16 Thread Paul Mackerras
This changes the book3s_hv code to store the page frame numbers in a separate vmalloc'd array, pointed to by an array in struct kvm_arch, rather than the memslot-rmap arrays. This frees up the rmap arrays to be used later to store reverse mapping information. For large page regions, we now store

[PATCH 01/11] KVM: PPC: Add memory-mapping support for PCI passthrough and emulation

2011-11-16 Thread Paul Mackerras
From: Benjamin Herrenschmidt b...@kernel.crashing.org This adds support for adding PCI device I/O regions to the guest memory map, and for trapping guest accesses to emulated MMIO regions and delivering them to qemu for MMIO emulation. To trap guest accesses to emulated MMIO regions, we reserve