Re: Question about IPC statistics of vcpu thread

2011-11-27 Thread Avi Kivity
On 11/26/2011 05:09 AM, Chengjian Wen wrote: > Hi All, > > I find a problem when I test the IPC of the kvm vcpu. My question is > that when the thread is a vcpu, whether the instructions we get from > perf stat includes > the part spending on the time vcpu had enter vmx or else it only > includes t

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

2011-11-27 Thread Avi Kivity
On 11/25/2011 04:35 AM, Liu Ping Fan wrote: > From: Liu Ping Fan > > 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 thre

Re: [PATCH 2/2] kvm: exit to userspace with reason KVM_EXIT_VCPU_DEAD

2011-11-27 Thread Avi Kivity
On 11/27/2011 04:42 AM, Liu Ping Fan wrote: > From: Liu Ping Fan > > The vcpu can be safely released when > --1.guest tells us that the vcpu is not needed any longer. > --2.vcpu hits the last instruction _halt_ > > If both of the conditions are satisfied, kvm exits to userspace > with the reason v

Re: [Qemu-devel] [PATCH 2/2] kvm: exit to userspace with reason KVM_EXIT_VCPU_DEAD

2011-11-27 Thread Gleb Natapov
On Sun, Nov 27, 2011 at 12:36:55PM +0200, Avi Kivity wrote: > On 11/27/2011 04:42 AM, Liu Ping Fan wrote: > > From: Liu Ping Fan > > > > The vcpu can be safely released when > > --1.guest tells us that the vcpu is not needed any longer. > > --2.vcpu hits the last instruction _halt_ > > > > If both

Re: [Qemu-devel] [PATCH 3/5] QEMU Introduce a pci device "cpustate" to get CPU_DEAD event in guest

2011-11-27 Thread Gleb Natapov
On Sun, Nov 27, 2011 at 10:45:35AM +0800, Liu Ping Fan wrote: > From: Liu Ping Fan > > This device's driver in guest can get vcpu dead event and notify > qemu through the device. > This should be done through ACPI device. Look at how PCI hotplug works in hw/acpi_piix4.c. > Signed-off-by: Liu Pi

Re: [Qemu-devel] [PATCH] virtio: add a pci driver to notify host the CPU_DEAD event

2011-11-27 Thread Gleb Natapov
On Sun, Nov 27, 2011 at 10:47:43AM +0800, Liu Ping Fan wrote: > From: Liu Ping Fan > > A driver for qemu device "cpustate". This driver catch the guest > CPU_DEAD event, and notify host. > And if you do eject properly via ACPI this driver is replaced by 3 lines of ACPI code and works with older

Re: [PATCH for v1.0] qemu-kvm: msix: Fire mask notifier on global mask changes

2011-11-27 Thread Avi Kivity
On 11/21/2011 07:14 PM, Michael S. Tsirkin wrote: > >From: Jan Kiszka > > Also invoke the mask notifier if the global MSI-X mask is modified. For > this purpose, we push the notifier call from the per-vector mask update > to the central msix_handle_mask_update. > > Applied, thanks. -- error com

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

2011-11-27 Thread Avi Kivity
On 11/24/2011 11:36 AM, Xiao Guangrong wrote: > Changelog: > - rebase it on current kvm tree and some cleanups > > This patchset is tested on x86 and build tested on powerpc and ia64 > Thanks, applied all. -- error compiling committee.c: too many arguments to function -- To unsubscribe from thi

Re: [PATCH] KVM: IA64: fix struct redefinition

2011-11-27 Thread Avi Kivity
On 11/24/2011 12:09 PM, Xiao Guangrong wrote: > From: Xiao Guangrong > > 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

Re: [PATCH 1/2] KVM: Use kmemdup() instead of kzalloc/memcpy

2011-11-27 Thread Avi Kivity
On 11/23/2011 05:15 PM, Sasha Levin wrote: > Switch to kmemdup() in two places to shorten the code and avoid possible bugs. > Doesn't apply... -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a messag

Re: [PATCHv2] KVM: Allow aligned byte and word writes to IOAPIC registers.

2011-11-27 Thread Avi Kivity
On 11/23/2011 02:54 PM, Julian Stecklina wrote: > This fixes byte accesses to IOAPIC_REG_SELECT as mandated by at least the > ICH10 and Intel Series 5 chipset specs. It also makes ioapic_mmio_write > consistent with ioapic_mmio_read, which also allows byte and word accesses. > Applied, thanks. --

Re: [PATCH 1/2] KVM: Use kmemdup() instead of kzalloc/memcpy

2011-11-27 Thread Sasha Levin
On Sun, 2011-11-27 at 14:25 +0200, Avi Kivity wrote: > On 11/23/2011 05:15 PM, Sasha Levin wrote: > > Switch to kmemdup() in two places to shorten the code and avoid possible > > bugs. > > > > Doesn't apply... > Needs rebasing due to the memslot patch. I'll resend. -- Sasha. -- To unsubscri

[PATCH v2 1/2] KVM: Use kmemdup() instead of kmalloc/memcpy

2011-11-27 Thread Sasha Levin
Switch to kmemdup() in two places to shorten the code and avoid possible bugs. Cc: Avi Kivity Cc: Marcelo Tosatti Signed-off-by: Sasha Levin --- arch/x86/kvm/x86.c |5 +++-- virt/kvm/kvm_main.c |7 +++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/x86

[PATCH v2 2/2] KVM: Use memdup_user instead of kmalloc/copy_from_user

2011-11-27 Thread Sasha Levin
Switch to using memdup_user when possible. This makes code more smaller and compact, and prevents errors. Cc: Avi Kivity Cc: Marcelo Tosatti Signed-off-by: Sasha Levin --- arch/x86/kvm/x86.c | 82 +- virt/kvm/kvm_main.c | 29 +++-

Re: [PATCH] KVM: Refactor and simplify kvm_dev_ioctl_get_supported_cpuid

2011-11-27 Thread Avi Kivity
On 11/25/2011 10:12 AM, Sasha Levin wrote: > This patch cleans and simplifies kvm_dev_ioctl_get_supported_cpuid by using a > table > instead of duplicating code as Avi suggested. > > This patch also fixes a bug where kvm_dev_ioctl_get_supported_cpuid would > return > -E2BIG when amount of entries

Re: [PATCH] KVM: Refactor and simplify kvm_dev_ioctl_get_supported_cpuid

2011-11-27 Thread Sasha Levin
On Sun, 2011-11-27 at 16:44 +0200, Avi Kivity wrote: > On 11/25/2011 10:12 AM, Sasha Levin wrote: > > This patch cleans and simplifies kvm_dev_ioctl_get_supported_cpuid by using > > a table > > instead of duplicating code as Avi suggested. > > > > This patch also fixes a bug where kvm_dev_ioctl_ge

Re: [PATCH] KVM: x86 emulator: Use opcode::execute for INS/OUTS

2011-11-27 Thread Avi Kivity
On 11/23/2011 05:27 AM, Takuya Yoshikawa wrote: > From: Takuya Yoshikawa > > INSB : 6C > INSW/INSD : 6D > OUTSB : 6E > OUTSW/OUTSD: 6F > > The I/O port address is read from the DX register when we decode the > operand because we see the SrcDX/DstDX flag is set. > > Thanks, applied. -

Re: [PATCH] vhost-net: Acquire device lock when releasing device

2011-11-27 Thread Michael S. Tsirkin
On Fri, Nov 18, 2011 at 11:19:42AM +0200, Sasha Levin wrote: > Device lock should be held when releasing a device, and specifically > when calling vhost_dev_cleanup(). Otherwise, RCU complains about it: > > [ 2025.642835] === > [ 2025.643838] [ INFO: suspicious RCU usag

Re: [PATCH] vhost-net: Acquire device lock when releasing device

2011-11-27 Thread Michael S. Tsirkin
On Sat, Nov 26, 2011 at 03:45:03PM -0500, David Miller wrote: > From: Sasha Levin > Date: Fri, 18 Nov 2011 11:19:42 +0200 > > > Device lock should be held when releasing a device, and specifically > > when calling vhost_dev_cleanup(). Otherwise, RCU complains about it: > ... > > Cc: "Michael S.

Re: [PATCH] vhost-net: Acquire device lock when releasing device

2011-11-27 Thread Michael S. Tsirkin
On Sun, Nov 27, 2011 at 06:49:27PM +0200, Michael S. Tsirkin wrote: > On Fri, Nov 18, 2011 at 11:19:42AM +0200, Sasha Levin wrote: > > Device lock should be held when releasing a device, and specifically > > when calling vhost_dev_cleanup(). Otherwise, RCU complains about it: > > > > [ 2025.642835

Re: [PATCHv3 RFC] virtio-pci: flexible configuration layout

2011-11-27 Thread Rusty Russell
On Thu, 24 Nov 2011 09:11:22 +0200, "Michael S. Tsirkin" wrote: > On Thu, Nov 24, 2011 at 11:06:44AM +1030, Rusty Russell wrote: > > It'll be *clearer* to have two completely separate paths than to fill > > with if() statements. > > Well, look at my patches. See how each new feature basically ad

[PATCH] X86: expose latest Intel cpu new features to guest

2011-11-27 Thread Liu, Jinsong
>From 8bb5d052825149c211afa92458912bc49a50ee2f Mon Sep 17 00:00:00 2001 From: Liu, Jinsong Date: Mon, 28 Nov 2011 03:55:19 -0800 Subject: [PATCH] X86: expose latest Intel cpu new features to guest Intel latest cpu add 6 new features, refer http://software.intel.com/file/36945 The new feature cpui

[PATCH] kvm tools: Improve virtio blk request processing

2011-11-27 Thread Asias He
There are at most bdev->reqs[VIRTIO_BLK_QUEUE_SIZE] outstanding requests at any time. We can simply use the head of each request to fetch the right 'struct blk_dev_req' in bdev->reqs[]. So, we can eliminate the list and lock operations which introduced by virtio_blk_req_{pop, push}. Signed-off-b

Re: [Qemu-devel] [PATCH 2/2] kvm: exit to userspace with reason KVM_EXIT_VCPU_DEAD

2011-11-27 Thread Liu ping fan
On Sun, Nov 27, 2011 at 6:50 PM, Gleb Natapov wrote: > On Sun, Nov 27, 2011 at 12:36:55PM +0200, Avi Kivity wrote: >> On 11/27/2011 04:42 AM, Liu Ping Fan wrote: >> > From: Liu Ping Fan >> > >> > The vcpu can be safely released when >> > --1.guest tells us that the vcpu is not needed any longer.