[PATCH 0/7] KVM: optimize memslots searching and cache GPN to GFN

2011-02-22 Thread Xiao Guangrong
I noticed paging64/32_walk_addr_generic and gfn_to_memslot are very hot in kvm modules: # perf report # Events: 38K cycles # # Overhead Command Shared Object Symbol # ... .. .. # 6.73% qemu-system-x86 [kernel.kallsyms] [k]

[PATCH 1/7] KVM: cleanup memslot_id function

2011-02-22 Thread Xiao Guangrong
We can get memslot id from memslot-id directly Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- include/linux/kvm_host.h |7 ++- virt/kvm/kvm_main.c | 17 - 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/include/linux/kvm_host.h

[PATCH 2/7] KVM: introduce KVM_MEM_SLOTS_NUM macro

2011-02-22 Thread Xiao Guangrong
Introduce KVM_MEM_SLOTS_NUM macro to instead of KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |3 ++- arch/x86/kvm/mmu.c |2 +- include/linux/kvm_host.h|7 +--

[PATCH 1/3] KVM: introduce memslots_updated function

2011-02-22 Thread Xiao Guangrong
Introduce memslots_updated function which is called after memslots updated Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/x86.c |2 +- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c | 15 +-- 3 files changed, 11 insertions(+), 7

[PATCH 4/7] KVM: sort memslots and use binary search to search the right slot

2011-02-22 Thread Xiao Guangrong
Sort memslots then search the slot with binary search to speed up the slot searching Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- include/linux/kvm_host.h |2 + virt/kvm/kvm_main.c | 85 ++ 2 files changed, 65

[PATCH 5/7] KVM: cache the last used slot

2011-02-22 Thread Xiao Guangrong
Cache the last used slot, the hit ratio is more than 35% during my test Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c | 11 +-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git

[PATCH 6/7] KVM: cleanup traversal used slots

2011-02-22 Thread Xiao Guangrong
We can get all used slots from memslots-slots_sort[], then memslots-nmemslots is only used when memslots is sorted, this operation is not frequency i think, so it can be removed Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/ia64/kvm/kvm-ia64.c |3 +-- arch/x86/kvm/mmu.c

[PATCH 7/7] KVM: MMU: cache guest page number to guest frame number

2011-02-22 Thread Xiao Guangrong
Cache guest page number to guest frame number to avoid walk guest page table frequently, the 'vtlb' idea is from Xen. Note: we can't use vtlb in ept guests since the guest tlb invalid operation is not intercept(reload CR3, invlpg), also can't used in L2 nnpt guest for the same reason, but we can

Re: [PATCH] kvm: allow RO page when atomic !write_fault

2011-02-22 Thread Lai Jiangshan
On 02/21/2011 05:47 PM, Gleb Natapov wrote: On Mon, Feb 21, 2011 at 11:47:36AM +0800, Lai Jiangshan wrote: Atomic-able hva_to_pfn() patches and allow-read-only-page patches are merged almost the same time. But hva_to_pfn() does not handle these two issues well together. When @atomic

Re: PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2

2011-02-22 Thread James Neave
On Tue, Feb 22, 2011 at 1:51 AM, Chris Wright chr...@sous-sol.org wrote: * James Neave (robo...@gmail.com) wrote: Finally, here is the very latest dmesg: http://pastebin.com/9HE61K62 OK, this is an AMD IOMMU box. [0.00] ACPI: IVRS cfcf9830 000E0 (v01 AMD RD890S

Re: PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2

2011-02-22 Thread Roedel, Joerg
On Tue, Feb 22, 2011 at 04:18:20AM -0500, James Neave wrote: On Tue, Feb 22, 2011 at 1:51 AM, Chris Wright chr...@sous-sol.org wrote: I added capability sys_rawio to the libvirtd apparmor profile, restarted apparmor and libvirt-bin and it just complained about the apparmor profile. The only

Re: [PATCH 0/6] KVM support for TSC scaling

2011-02-22 Thread Avi Kivity
On 02/21/2011 07:28 PM, Roedel, Joerg wrote: - what's the cost of wrmsr(TSC_MULT)? Hard to tell by now because I only have numbers for pre-production hardware. Can you ask your hardware people what the cost will likely be? msrs are often expensive, and here we have two in the lightweight

Re: PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2

2011-02-22 Thread James Neave
2011/2/22 Roedel, Joerg joerg.roe...@amd.com: On Tue, Feb 22, 2011 at 04:18:20AM -0500, James Neave wrote: On Tue, Feb 22, 2011 at 1:51 AM, Chris Wright chr...@sous-sol.org wrote: I added capability sys_rawio to the libvirtd apparmor profile, restarted apparmor and libvirt-bin and it just

Re: [PATCH 0/6] KVM support for TSC scaling

2011-02-22 Thread Roedel, Joerg
On Tue, Feb 22, 2011 at 05:11:42AM -0500, Avi Kivity wrote: On 02/21/2011 07:28 PM, Roedel, Joerg wrote: - what's the cost of wrmsr(TSC_MULT)? Hard to tell by now because I only have numbers for pre-production hardware. Can you ask your hardware people what the cost will likely be?

Re: [PATCH 0/6] KVM support for TSC scaling

2011-02-22 Thread Avi Kivity
On 02/22/2011 12:35 PM, Roedel, Joerg wrote: This doesn't really work, since we don't know on what host the TSC calibration loop ran: - start guest on host H1 - migrate it around, now it's on host H2 - guest reboots, reruns calibration loop - migrate it around some more, now it's on

Re: [PATCH 0/6] KVM support for TSC scaling

2011-02-22 Thread Roedel, Joerg
On Tue, Feb 22, 2011 at 05:41:53AM -0500, Avi Kivity wrote: On 02/22/2011 12:35 PM, Roedel, Joerg wrote: This doesn't really work, since we don't know on what host the TSC calibration loop ran: - start guest on host H1 - migrate it around, now it's on host H2 - guest

Re: [PATCH 1/6] KVM: SVM: Advance instruction pointer in dr_intercept

2011-02-22 Thread Roedel, Joerg
On Wed, Feb 09, 2011 at 12:29:39PM -0500, Joerg Roedel wrote: In the dr_intercept function a new cpu-feature called decode-assists is implemented and used when available. This code-path does not advance the guest-rip causing the guest to dead-loop over mov-dr instructions. This is fixed by

Re: Passthrough of 2 PCI devices works 80% (Kernel 2.6.37, Debian Squeeze, Win7 VM)

2011-02-22 Thread Da Powah
Alex Williamson alex.williamson at redhat.com writes: On Tue, 2011-02-15 at 20:57 +, Da Powah wrote: Hi, i`ve got a question about pci passthrogh of 2 pci devices (2x DVB-S2 PCI cards with Saa7146 PCI Bridge from Technotrend: S2-3200). I am using squeeze with a 2.6.37

Re: [Qemu-devel] KVM Agenda for Feb 22

2011-02-22 Thread Luiz Capitulino
On Mon, 21 Feb 2011 14:13:04 -0600 Anthony Liguori anth...@codemonkey.ws wrote: On 02/21/2011 11:12 AM, Juan Quintela wrote: please send in any agenda items you are interested in covering. - 0.14.0 release is out, thanks to everyone that participated! Let's discuss what worked

Re: [PATCH 1/6] KVM: SVM: Advance instruction pointer in dr_intercept

2011-02-22 Thread Avi Kivity
On 02/22/2011 01:14 PM, Roedel, Joerg wrote: On Wed, Feb 09, 2011 at 12:29:39PM -0500, Joerg Roedel wrote: In the dr_intercept function a new cpu-feature called decode-assists is implemented and used when available. This code-path does not advance the guest-rip causing the guest to

Re: [PATCH 0/6] KVM support for TSC scaling

2011-02-22 Thread Avi Kivity
On 02/22/2011 01:11 PM, Roedel, Joerg wrote: Ok, so your scenario is - boot on host H1 - no intervening migrations - migrate to host Hnew - all succeeding migrations are only to new hosts or back to H1 This is somewhat artificial, and not very different from an all-new cluster.

Re: [PATCH 4/7] KVM: sort memslots and use binary search to search the right slot

2011-02-22 Thread Avi Kivity
On 02/22/2011 10:12 AM, Xiao Guangrong wrote: Sort memslots then search the slot with binary search to speed up the slot searching I'm not sure if a binary search is the right algorithm here. It introduces a lot of branches which may be mispredicted. Options we've discussed are: - Sort

Re: [PATCH 5/7] KVM: cache the last used slot

2011-02-22 Thread Avi Kivity
On 02/22/2011 10:13 AM, Xiao Guangrong wrote: Cache the last used slot, the hit ratio is more than 35% during my test If we sort the slots by size, or use a weighted balanced tree, this should come for free. -- error compiling committee.c: too many arguments to function -- To unsubscribe

Re: [PATCH 7/7] KVM: MMU: cache guest page number to guest frame number

2011-02-22 Thread Avi Kivity
On 02/22/2011 10:16 AM, Xiao Guangrong wrote: Cache guest page number to guest frame number to avoid walk guest page table frequently, the 'vtlb' idea is from Xen. Note: we can't use vtlb in ept guests since the guest tlb invalid operation is not intercept(reload CR3, invlpg), also can't used

Re: [PATCH 1/6] KVM: SVM: Advance instruction pointer in dr_intercept

2011-02-22 Thread Roedel, Joerg
On Tue, Feb 22, 2011 at 09:01:51AM -0500, Avi Kivity wrote: On 02/22/2011 01:14 PM, Roedel, Joerg wrote: On Wed, Feb 09, 2011 at 12:29:39PM -0500, Joerg Roedel wrote: In the dr_intercept function a new cpu-feature called decode-assists is implemented and used when available. This

Re: [PATCH 4/7] KVM: sort memslots and use binary search to search the right slot

2011-02-22 Thread Alex Williamson
On Tue, 2011-02-22 at 16:25 +0200, Avi Kivity wrote: On 02/22/2011 10:12 AM, Xiao Guangrong wrote: Sort memslots then search the slot with binary search to speed up the slot searching I'm not sure if a binary search is the right algorithm here. It introduces a lot of branches which

[PATCH] KVM test: Remove last references to env variables on unattended setup

2011-02-22 Thread Lucas Meneghel Rodrigues
In the conversion from stand alone script to KVM autotest infrastructure, we missed to convert some places inside the code that looked for environment variables. Fix it so providing windows CD keys gets the keys written on the answer file again. Signed-off-by: Lucas Meneghel Rodrigues

KVM call minutes for Feb 22

2011-02-22 Thread Michael S. Tsirkin
Looks like Chris will send minutes too, so I didn't do much to polish this, I didn't realise he's doing it until I had this, so here's the braindump: hope it helps. 1. 0.14 postmortem - what went well wiki for planning testing - what can be improved rc - cycle could be

KVM call minutes for Feb 22

2011-02-22 Thread Chris Wright
0.14 recap - keeping schedule on wiki was helpful - changelog was helpful - testing (could even more emphasis could be improved) - -rc cycles - -rc2 and final release just hours 0.15 - tentative date July 1st - qapi - qed features - virtagent? - depends on whether to terminate in qemu vs

[ANNOUNCE] qemu-kvm-0.14.0

2011-02-22 Thread Avi Kivity
qemu-kvm-0.14.0 is now available. This release is based on the upstream qemu 0.14.0, plus kvm-specific enhancements. Please see the original qemu 0.14.0 release announcement for details. This release can be used with the kvm kernel modules provided by your distribution kernel, or by the

Re: [Qemu-devel] KVM call minutes for Feb 22

2011-02-22 Thread Alon Levy
On Tue, Feb 22, 2011 at 06:06:22PM +0200, Michael S. Tsirkin wrote: Looks like Chris will send minutes too, so I didn't do much to polish this, I didn't realise he's doing it until I had this, so here's the braindump: hope it helps. 1. 0.14 postmortem - what went well wiki for

Re: [Qemu-devel] KVM call minutes for Feb 22

2011-02-22 Thread Anthony Liguori
On 02/22/2011 11:32 AM, Alon Levy wrote: On Tue, Feb 22, 2011 at 06:06:22PM +0200, Michael S. Tsirkin wrote: Looks like Chris will send minutes too, so I didn't do much to polish this, I didn't realise he's doing it until I had this, so here's the braindump: hope it helps. 1. 0.14

[RFC PATCH 0/3] Weight-balanced binary tree + KVM growable memory slots using wbtree

2011-02-22 Thread Alex Williamson
This series introduces a new weight-balanced binary tree (wbtree) for general use. It's largely leveraged from the rbtree, copying it's rotate functions, while introducing different rebalance and erase functions. This tree is particularly useful for managing memory ranges, where it's desirable

[RFC PATCH 1/3] Weight-balanced tree

2011-02-22 Thread Alex Williamson
Signed-off-by: Alex Williamson alex.william...@redhat.com --- include/linux/wbtree.h | 55 lib/Makefile |3 + lib/wbtree.c | 170 3 files changed, 227 insertions(+), 1 deletions(-) create mode 100644

[RFC PATCH 2/3] kvm: Allow memory slot array to grow on demand

2011-02-22 Thread Alex Williamson
Remove fixed KVM_MEMORY_SLOTS limit, allowing the slot array to grow on demand. Private slots are now allocated at the front instead of the end. Only x86 seems to use private slots, so this is now zero for all other archs. The memslots pointer is already updated using rcu, so changing the size

[RFC PATCH 3/3] kvm: Use weight-balanced tree for memory slot management

2011-02-22 Thread Alex Williamson
Rather than search linearly through an unordered slot array, we can embed a tree node into each element. We can still do RCU tree updates by applying the pointer offset to each element in the new copy of the tree. Signed-off-by: Alex Williamson alex.william...@redhat.com ---

Re: [PATCH 0/4 v9] MSI-X MMIO support for KVM

2011-02-22 Thread Marcelo Tosatti
On Fri, Feb 18, 2011 at 04:53:09PM +0800, Sheng Yang wrote: Sorry for the long delay, just come back from vacation... Change from v8: 1. Update struct kvm_run to contain MSI-X routing update exit specific information. 2. Fix a mmio_nr counting bug. Notice this patchset still based on

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-22 Thread Marcelo Tosatti
On Fri, Feb 18, 2011 at 04:15:38PM +0800, Sheng Yang wrote: Why allow this ioctl to succeed if there's an entry already present? This case is broken as mmio_dev-mmio_nr is increased below. Oh, It's a bug to let mmio_nr increase even with MMIO found. I've fixed it. The reason we allow

Re: [PATCH] kvm: allow RO page when atomic !write_fault

2011-02-22 Thread Marcelo Tosatti
On Mon, Feb 21, 2011 at 11:47:36AM +0800, Lai Jiangshan wrote: Atomic-able hva_to_pfn() patches and allow-read-only-page patches are merged almost the same time. But hva_to_pfn() does not handle these two issues well together. When @atomic !@write_fault host-is-read-only-page-mapped the

Re: [PATCH v2 00/15] [uq/master] Patch queue, part IV (MCE edition)

2011-02-22 Thread Marcelo Tosatti
On Fri, Feb 18, 2011 at 11:11:11AM +0100, Jan Kiszka wrote: Round 2 of this part, primarily addressing review comments: - Reworked CPU_INTERRUPT_MCE - exection translation (now done in kvm_arch_process_async_events, indeed much cleaner) - Add missing cpu_synchronize_state on pending MCE

Re: [v3 RFC PATCH 0/4] Implement multiqueue virtio-net

2011-02-22 Thread Simon Horman
On Wed, Oct 20, 2010 at 02:24:52PM +0530, Krishna Kumar wrote: Following set of patches implement transmit MQ in virtio-net. Also included is the user qemu changes. MQ is disabled by default unless qemu specifies it. Hi Krishna, I have a few questions about the results below: 1. Are the

Re: PCI Passthrough, error: The driver 'pci-stub' is occupying your device 0000:08:06.2

2011-02-22 Thread Chris Wright
* James Neave (robo...@gmail.com) wrote: On Tue, Feb 22, 2011 at 1:51 AM, Chris Wright chr...@sous-sol.org wrote: * James Neave (robo...@gmail.com) wrote: Does anybody know the debug kernel switches for iommu? Two helpful kernel commandline options are: amd_iommu_dump debug (and drop

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-22 Thread Alex Williamson
On Sun, 2011-01-30 at 13:11 +0800, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. Looks pretty good overall. A few comments below. It seems like we should be able to hook this into vfio with a small stub in kvm. We just need to be able to communicate

Re: [PATCH 4/7] KVM: sort memslots and use binary search to search the right slot

2011-02-22 Thread Xiao Guangrong
On 02/22/2011 10:25 PM, Avi Kivity wrote: On 02/22/2011 10:12 AM, Xiao Guangrong wrote: Sort memslots then search the slot with binary search to speed up the slot searching I'm not sure if a binary search is the right algorithm here. It introduces a lot of branches which may be

Re: [PATCH 7/7] KVM: MMU: cache guest page number to guest frame number

2011-02-22 Thread Xiao Guangrong
On 02/22/2011 10:32 PM, Avi Kivity wrote: On 02/22/2011 10:16 AM, Xiao Guangrong wrote: Cache guest page number to guest frame number to avoid walk guest page table frequently, the 'vtlb' idea is from Xen. Note: we can't use vtlb in ept guests since the guest tlb invalid operation is not

Re: [RFC PATCH 0/3] Weight-balanced binary tree + KVM growable memory slots using wbtree

2011-02-22 Thread Alex Williamson
On Tue, 2011-02-22 at 11:54 -0700, Alex Williamson wrote: This series introduces a new weight-balanced binary tree (wbtree) for general use. It's largely leveraged from the rbtree, copying it's rotate functions, while introducing different rebalance and erase functions. This tree is

Re: [Qemu-devel] Re: [PATCH 07/18] Introduce fault tolerant VM transaction QEMUFile and ft_mode.

2011-02-22 Thread Yoshiaki Tamura
2011/2/23 ya su suya94...@gmail.com: Yoshi:    thanks for your explaining.    if you introduce a new stage as 3, I think stage 1 also need to change as it will mark all pages dirty.    looking forward to your new patch update. Unless there're strong comments from others, I won't put it in

Re: [v3 RFC PATCH 0/4] Implement multiqueue virtio-net

2011-02-22 Thread Krishna Kumar2
Simon Horman ho...@verge.net.au wrote on 02/22/2011 01:17:09 PM: Hi Simon, I have a few questions about the results below: 1. Are the (%) comparisons between non-mq and mq virtio? Yes - mainline kernel with transmit-only MQ patch. 2. Was UDP or TCP used? TCP. I had done some initial

Re: [v3 RFC PATCH 0/4] Implement multiqueue virtio-net

2011-02-22 Thread Michael S. Tsirkin
On Wed, Feb 23, 2011 at 10:52:09AM +0530, Krishna Kumar2 wrote: Simon Horman ho...@verge.net.au wrote on 02/22/2011 01:17:09 PM: Hi Simon, I have a few questions about the results below: 1. Are the (%) comparisons between non-mq and mq virtio? Yes - mainline kernel with

Re: [v3 RFC PATCH 0/4] Implement multiqueue virtio-net

2011-02-22 Thread Krishna Kumar2
Michael S. Tsirkin m...@redhat.com wrote on 02/23/2011 12:09:15 PM: Hi Michael, Yes. Michael Tsirkin had wanted to see how the MQ RX patch would look like, so I was in the process of getting the two working together. The patch is ready and is being tested. Should I send a RFC patch at

Re: [PATCH 2/3] KVM: Emulate MSI-X table in kernel

2011-02-22 Thread Sheng Yang
On Wednesday 23 February 2011 08:19:21 Alex Williamson wrote: On Sun, 2011-01-30 at 13:11 +0800, Sheng Yang wrote: Then we can support mask bit operation of assigned devices now. Looks pretty good overall. A few comments below. It seems like we should be able to hook this into vfio with a

[PATCH] Fix build system so pci.o isn't included on targets not depending on PCI

2011-02-22 Thread klondike
2010-11-10Francisco Blas Izquierdo Riera klond...@xiscosoft.es Somehow pci.o was added so it was needed on all targets breaking NO_PCI ones. This patch intends to fix that This error appeared during a merge with the main tree so it may have been caused by some oddity in that

Is PCI pass-through possible with host+kvm on latest linux but guest on an older linux?

2011-02-22 Thread Chigurupati, Chaks
Hi folks, If my hardware is VT-d capable and the host is latest linux+kvm with all the needed VT-d support but the guest is an older linux (say 2.6.27), will I be able to use PCI pass-through to hot-plug a PCI device from one guest to another guest? Any comments/thoughts are appreciated. Thx

Re: [ANNOUNCE] qemu-kvm-0.14.0

2011-02-22 Thread Nikola Ciprich
Hello Avi, when trying to compile(link) various targets, I get: LINK sparc-softmmu/qemu-system-sparc pci-stub.o: In function `do_pci_info_print': /usr/src/redhat/BUILD/qemu-kvm-0.14.0/hw/pci-stub.c:36: multiple definition of `do_pci_info_print'