[PATCH v3 1/6] KVM: introduce KVM_MEM_SLOTS_NUM macro

2011-11-24 Thread Xiao Guangrong
From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Introduce KVM_MEM_SLOTS_NUM macro to instead of KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/include/asm/kvm_host.h |4 +++- arch/x86/kvm/mmu.c |2

[PATCH v3 0/6] KVM: optimize memslots searching

2011-11-24 Thread Xiao Guangrong
Changelog: - rebase it on current kvm tree and some cleanups This patchset is tested on x86 and build tested on powerpc and ia64 -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at

[PATCH v3 2/6] KVM: introduce update_memslots function

2011-11-24 Thread Xiao Guangrong
From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Introduce update_memslots to update slot which will be update to kvm-memslots Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/x86.c |2 +- include/linux/kvm_host.h |1 + virt/kvm/kvm_main.c

[PATCH v3 3/6] KVM: introduce kvm_for_each_memslot macro

2011-11-24 Thread Xiao Guangrong
From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Introduce kvm_for_each_memslot to walk all valid memslot Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/ia64/kvm/kvm-ia64.c |6 ++ arch/x86/kvm/mmu.c | 12 ++-- include/linux/kvm_host.h |4

[PATCH v3 4/6] KVM: introduce id_to_memslot function

2011-11-24 Thread Xiao Guangrong
From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Introduce id_to_memslot to get memslot by slot id Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/ia64/kvm/kvm-ia64.c |2 +- arch/powerpc/kvm/book3s.c |2 +- arch/x86/kvm/vmx.c|6 --

[PATCH v3 5/6] KVM: sort memslots by its size and use line search

2011-11-24 Thread Xiao Guangrong
From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Sort memslots base on its size and use line search to find it, so that the larger memslots have better fit The idea is from Avi Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- include/linux/kvm_host.h | 18 +--

[PATCH v3 6/6] KVM: introduce a table to map slot id to index in memslots array

2011-11-24 Thread Xiao Guangrong
From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com The operation of getting dirty log is frequent when framebuffer-based displays are used(for example, Xwindow), so, we introduce a mapping table to speed up id_to_memslot() Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com ---

[PATCH] KVM: IA64: fix struct redefinition

2011-11-24 Thread Xiao Guangrong
From: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com There is the same struct definition in ia64 and kvm common code: arch/ia64/kvm//kvm-ia64.c: At top level: arch/ia64/kvm//kvm-ia64.c:777:8: error: redefinition of ‘struct kvm_io_range’ include/linux/kvm_host.h:62:8: note: originally defined

Re: [PATCH] kvm-tpr-opt: Fix instruction_is_ok() for push tpr

2011-11-24 Thread Marcelo Tosatti
On Tue, Nov 22, 2011 at 10:35:59AM +0100, Markus Armbruster wrote: Missing break spotted by Coverity. Signed-off-by: Markus Armbruster arm...@redhat.com --- kvm-tpr-opt.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) Applied, thanks. -- To unsubscribe from this list: send

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Marcelo Tosatti
On Thu, Nov 17, 2011 at 12:18:44PM +0200, Sasha Levin wrote: If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still fail with -E2BIG due to wrong comparisons. Cc: Avi Kivity a...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Sasha Levin

Re: [PATCH v3 4/6] KVM: introduce id_to_memslot function

2011-11-24 Thread Takuya Yoshikawa
(2011/11/24 18:40), Xiao Guangrong wrote: ... --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3521,7 +3521,7 @@ int kvm_vm_ioctl_get_dirty_log(struct kvm *kvm, if (log-slot= KVM_MEMORY_SLOTS) goto out; - memslot =kvm-memslots-memslots[log-slot]; +

Re: [PATCH v3 4/6] KVM: introduce id_to_memslot function

2011-11-24 Thread Takuya Yoshikawa
(2011/11/24 19:15), Takuya Yoshikawa wrote: (2011/11/24 18:40), Xiao Guangrong wrote: You can eliminate this if you use old_slot and new_slot for the two memory slots. Or old_bitmap and new_bitmap. Anyway, calling id_to_memslot() for getting the same slot twice is not good, IMO.

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Sasha Levin
On Thu, 2011-11-24 at 08:09 -0200, Marcelo Tosatti wrote: On Thu, Nov 17, 2011 at 12:18:44PM +0200, Sasha Levin wrote: If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still fail with -E2BIG due to wrong comparisons. Cc: Avi Kivity a...@redhat.com Cc: Marcelo Tosatti

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Avi Kivity
On 11/24/2011 12:31 PM, Sasha Levin wrote: The protocol goes like try size x, if it fails with -E2BIG, increase x, try again. Its awkward. We can set nent to be the amount of entries required like we do in the opposite case where we passed too many entries. There's no point, since

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Sasha Levin
On Thu, 2011-11-24 at 12:33 +0200, Avi Kivity wrote: On 11/24/2011 12:31 PM, Sasha Levin wrote: The protocol goes like try size x, if it fails with -E2BIG, increase x, try again. Its awkward. We can set nent to be the amount of entries required like we do in the opposite case

Re: [PATCH 1/2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Avi Kivity
On 11/24/2011 12:37 PM, Sasha Levin wrote: On Thu, 2011-11-24 at 12:33 +0200, Avi Kivity wrote: On 11/24/2011 12:31 PM, Sasha Levin wrote: The protocol goes like try size x, if it fails with -E2BIG, increase x, try again. Its awkward. We can set nent to be the amount of

[PATCH v2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Sasha Levin
If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still fail with -E2BIG due to wrong comparisons. Cc: Avi Kivity a...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Sasha Levin levinsasha...@gmail.com --- arch/x86/kvm/x86.c |2 +- 1 files changed, 1

Re: [PATCH v2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Avi Kivity
On 11/24/2011 12:45 PM, Sasha Levin wrote: If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still fail with -E2BIG due to wrong comparisons. Cc: Avi Kivity a...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Sasha Levin levinsasha...@gmail.com ---

[Qemu-devel] [PATCH] ivshmem: fix guest unable to start with ioeventfd

2011-11-24 Thread zanghongyong
From: Hongyong Zang zanghongy...@huawei.com When a guest boots with ioeventfd, an error (by gdb) occurs: Program received signal SIGSEGV, Segmentation fault. 0x006009cc in setup_ioeventfds (s=0x171dc40) at /home/louzhengwei/git_source/qemu-kvm/hw/ivshmem.c:363 363

Re: [PATCH v3 4/6] KVM: introduce id_to_memslot function

2011-11-24 Thread Xiao Guangrong
On 11/24/2011 06:23 PM, Takuya Yoshikawa wrote: (2011/11/24 19:15), Takuya Yoshikawa wrote: (2011/11/24 18:40), Xiao Guangrong wrote: You can eliminate this if you use old_slot and new_slot for the two memory slots. Or old_bitmap and new_bitmap. Anyway, calling id_to_memslot() for

Re: [PATCH v2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Sasha Levin
On Thu, 2011-11-24 at 12:48 +0200, Avi Kivity wrote: On 11/24/2011 12:45 PM, Sasha Levin wrote: If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still fail with -E2BIG due to wrong comparisons. Cc: Avi Kivity a...@redhat.com Cc: Marcelo Tosatti mtosa...@redhat.com

Re: [PATCH v2] KVM: Don't fail KVM_GET_SUPPORTED_CPUID if nent is just right

2011-11-24 Thread Avi Kivity
On 11/24/2011 01:53 PM, Sasha Levin wrote: On Thu, 2011-11-24 at 12:48 +0200, Avi Kivity wrote: On 11/24/2011 12:45 PM, Sasha Levin wrote: If we pass just enough entries to KVM_GET_SUPPORTED_CPUID, we would still fail with -E2BIG due to wrong comparisons. Cc: Avi Kivity

RE: Changing IOMMU-API for generic DMA-mapping supported by the hardware

2011-11-24 Thread Marek Szyprowski
Hello, On Friday, November 11, 2011 2:17 PM Joerg Roedel wrote: Okay, seperate thread for this one. If possible, I would like to be CCed: in the next mails in this topic. For a last few months I've been working on DMA-mapping changes on ARM architecture in order to add support for

Re: [PATCH 02/10] nEPT: MMU context for nested EPT

2011-11-24 Thread Avi Kivity
On 11/23/2011 05:44 PM, Nadav Har'El wrote: On Wed, Nov 23, 2011, Nadav Har'El wrote about Re: [PATCH 02/10] nEPT: MMU context for nested EPT: +static int nested_ept_init_mmu_context(struct kvm_vcpu *vcpu) +{ + int r = kvm_init_shadow_mmu(vcpu, vcpu-arch.mmu); + +

Re: nested virtualization on Intel and needed cpu flags to pass

2011-11-24 Thread Gianluca Cecchi
Resend, because probably it didn't reach the ml due to attachments size... I'm posting now links instead... On Wed, Nov 23, 2011 at 12:01 PM, Nadav Har'El wrote: Unfortunately, this is a known bug - which I promised to work on, but haven't yet got around to :( nested-vmx.txt explictly lists

Re: Changing IOMMU-API for generic DMA-mapping supported by the hardware

2011-11-24 Thread 'Joerg Roedel'
On Thu, Nov 24, 2011 at 01:52:33PM +0100, Marek Szyprowski wrote: In my DMA-mapping IOMMU integration I've used a dma_iommu_mapping structure, which contains a pointer to iommu domain, a bitmap and a lock. Maybe we should consider extending iommu domain with allocation bitmap (or other

Re: [Qemu-devel] [PATCH] ivshmem: fix guest unable to start with ioeventfd

2011-11-24 Thread Cam Macdonell
On Thu, Nov 24, 2011 at 3:05 AM, zanghongy...@huawei.com wrote: From: Hongyong Zang zanghongy...@huawei.com When a guest boots with ioeventfd, an error (by gdb) occurs:  Program received signal SIGSEGV, Segmentation fault.  0x006009cc in setup_ioeventfds (s=0x171dc40)      at

[PATCH 0] A series patches for kvmqemu to enable vcpu destruction in kvm

2011-11-24 Thread Liu Ping Fan
A series of patches from kvm, qemu to guest. These patches will finally enable vcpu destruction in kvm instance and let vcpu thread exit in qemu. Currently, the vcpu online feature enables the dynamical creation of vcpu and vcpu thread, while the offline feature can not destruct the vcpu and

[PATCH 1/2] kvm: make vcpu life cycle separated from kvm instance

2011-11-24 Thread Liu Ping Fan
From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vcpu can be destructed only when kvm instance destroyed. Change this to vcpu as a refer to kvm, and then vcpu MUST and CAN be destroyed before kvm's destroy. Qemu will take advantage of this to exit the vcpu thread if the thread is no

[PATCH] PCI: Can continually add funcs after adding func0

2011-11-24 Thread Amos Kong
Boot up a KVM guest, and hotplug multifunction devices(func1,func2,func0,func3) to guest. for i in 1 2 0 3;do qemu-img create /tmp/resize$i.qcow2 1G -f qcow2 (qemu) drive_add 0x11.$i id=drv11$i,if=none,file=/tmp/resize$i.qcow2 (qemu) device_add

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

2011-11-24 Thread Mathieu Desnoyers
Hi Stephen, Benjamin forwarded me your email stating: I have been playing with userspace-rcu which has a number of neat lockless routines for queuing and hashing. But there aren't kernel versions and several of them may require cmpxchg to work. Just FYI, I made sure a few years ago that