[PATCH] kvm: notify host when guest panicked

2012-05-21 Thread Wen Congyang
We can know the guest is panicked when the guest runs on xen. But we do not have such feature on kvm. Another purpose of this feature is: management app(for example: libvirt) can do auto dump when the guest is panicked. If management app does not do auto dump, the guest's user can do dump by hand

[PATCH 1/3] start vm after reseting it

2012-05-21 Thread Wen Congyang
The guest should run after reseting it, but it does not run if its old state is RUN_STATE_INTERNAL_ERROR or RUN_STATE_PAUSED. Signed-off-by: Wen Congyang we...@cn.fujitsu.com --- vl.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/vl.c b/vl.c index 23ab3a3..7f5fed8

[PATCH 2/3] update linux headers

2012-05-21 Thread Wen Congyang
Signed-off-by: Wen Congyang we...@cn.fujitsu.com --- linux-headers/linux/kvm_para.h |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/linux-headers/linux/kvm_para.h b/linux-headers/linux/kvm_para.h index 7bdcf93..5618758 100644 --- a/linux-headers/linux/kvm_para.h

[PATCH 3/3] deal with guest panicked event

2012-05-21 Thread Wen Congyang
When the guest is panicked, it will write 0x1 to the port 0x505. So if qemu reads 0x1 from this port, we can do the folloing three things according to the parameter -onpanic: 1. emit QEVENT_GUEST_PANICKED only 2. emit QEVENT_GUEST_PANICKED and pause VM 3. emit QEVENT_GUEST_PANICKED and quit VM

[PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Xiao Guangrong
If we map a readonly memory space from host to guest and the page is not currently mapped in the host, we will get a fault-pfn and async is not allowed, then the vm will crash The reason is only writable vma can be allowed to be async in current code Signed-off-by: Xiao Guangrong

[PATCH] spapr: Add memop hypercall

2012-05-21 Thread Benjamin Herrenschmidt
This adds a kvm-specific hypervisor call to the pseries machine which allows to do what amounts to memmove, memcpy and xor over regions of physical memory such as the framebuffer. This is the simplest way to get usable framebuffer speed from SLOF since the framebuffer isn't mapped in the VRMA and

Re: [PATCH v2 1/2] ppc64: Rudimentary Support for extra page sizes on server CPUs

2012-05-21 Thread Alexander Graf
On 15.05.2012, at 06:06, Benjamin Herrenschmidt wrote: More recent Power server chips (i.e. based on the 64 bit hash MMU) support more than just the traditional 4k and 16M page sizes. This can get quite complicated, because which page sizes are supported, which combinations are supported

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Gleb Natapov
On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: If we map a readonly memory space from host to guest and the page is not currently mapped in the host, we will get a fault-pfn and async is not allowed, then the vm will crash Why would we want to map a readonly memory space from

Re: [PATCH v2 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Avi Kivity
On 05/21/2012 06:54 AM, Xudong Hao wrote: Enabling Access bit when doing memory swapping. @@ -1243,11 +1244,11 @@ static int kvm_age_rmapp(struct kvm *kvm, unsigned long *rmapp, for (sptep = rmap_get_first(*rmapp, iter); sptep; sptep = rmap_get_next(iter)) { -

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-05-21 Thread Avi Kivity
On 05/21/2012 06:34 AM, Ren, Yongjie wrote: Hi All, This is KVM upstream test result against kvm.git 51bfd2998113e1f8ce8dcf853407b76a04b5f2a0 based on kernel 3.4.0-rc7, and qemu-kvm.git a1fce560c0e5f287ed65d2aaadb3e59578aaa983. We found 1 new bug and 1 bug got fixed in the past two weeks.

Re: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Avi Kivity
On 05/21/2012 06:22 AM, Hao, Xudong wrote: -Original Message- From: Marcelo Tosatti [mailto:mtosa...@redhat.com] Sent: Friday, May 18, 2012 10:23 AM To: Xudong Hao Cc: a...@redhat.com; kvm@vger.kernel.org; linux-ker...@vger.kernel.org; Shan, Haitao; Zhang, Xiantao; Hao, Xudong

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Xiao Guangrong
On 05/21/2012 04:08 PM, Gleb Natapov wrote: On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: If we map a readonly memory space from host to guest and the page is not currently mapped in the host, we will get a fault-pfn and async is not allowed, then the vm will crash Why

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-21 Thread Avi Kivity
On 05/21/2012 05:32 AM, Yanfei Zhang wrote: 于 2012年05月21日 01:43, Avi Kivity 写道: On 05/16/2012 10:50 AM, zhangyanfei wrote: This patch set exports offsets of VMCS fields as note information for kdump. We call it VMCSINFO. The purpose of VMCSINFO is to retrieve runtime state of guest

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Alexander Graf
On 21.05.2012, at 09:24, Benjamin Herrenschmidt wrote: This adds a kvm-specific hypervisor call to the pseries machine which allows to do what amounts to memmove, memcpy and xor over regions of physical memory such as the framebuffer. This is the simplest way to get usable framebuffer

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Benjamin Herrenschmidt
On Mon, 2012-05-21 at 10:38 +0200, Alexander Graf wrote: On 21.05.2012, at 09:24, Benjamin Herrenschmidt wrote: This adds a kvm-specific hypervisor call to the pseries machine which allows to do what amounts to memmove, memcpy and xor over regions of physical memory such as the

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-05-21 Thread Kevin Wolf
Am 21.05.2012 10:27, schrieb Avi Kivity: On 05/21/2012 06:34 AM, Ren, Yongjie wrote: Hi All, This is KVM upstream test result against kvm.git 51bfd2998113e1f8ce8dcf853407b76a04b5f2a0 based on kernel 3.4.0-rc7, and qemu-kvm.git a1fce560c0e5f287ed65d2aaadb3e59578aaa983. We found 1 new bug

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Alexander Graf
On 21.05.2012, at 10:59, Benjamin Herrenschmidt wrote: On Mon, 2012-05-21 at 10:38 +0200, Alexander Graf wrote: On 21.05.2012, at 09:24, Benjamin Herrenschmidt wrote: This adds a kvm-specific hypervisor call to the pseries machine which allows to do what amounts to memmove, memcpy and xor

[RFC PATCH 1/5] block: Introduce q-abort_queue_fn()

2012-05-21 Thread Asias He
When user hot-unplug a disk which is busy serving I/O, __blk_run_queue might be unable to drain all the requests. As a result, the blk_drain_queue() would loop forever and blk_cleanup_queue would not return. So hot-unplug will fail. This patch adds a callback in blk_drain_queue() for low lever

[RFC PATCH 3/5] virtio-blk: Call del_gendisk() before disable guest kick

2012-05-21 Thread Asias He
del_gendisk() might not return due to failing to remove the /sys/block/vda/serial sysfs entry when another thread (udev) is trying to read it. virtblk_remove() vdev-config-reset() : guest will not kick us through interrupt del_gendisk() device_del() kobject_del(): got stuck,

[RFC PATCH 4/5] virtio-blk: Use q-abort_queue_fn() to abort requests

2012-05-21 Thread Asias He
virtblk_abort_queue() will be called by the block layer when cleans up the queue. blk_cleanup_queue - blk_drain_queue() - q-abort_queue_fn(q) virtblk_abort_queue() 1) Abort requests in block which is not dispatched to driver 2) Abort requests already dispatched to driver 3) Wake up processes

[RFC PATCH 5/5] virtio-blk: Use block layer provided spinlock

2012-05-21 Thread Asias He
Block layer will allocate a spinlock for the queue if the driver does not provide one in blk_init_queue(). The reason to use the internal spinlock is that blk_cleanup_queue() will switch to use the internal spinlock in the cleanup code path. if (q-queue_lock != q-__queue_lock)

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-21 Thread Yanfei Zhang
于 2012年05月21日 16:34, Avi Kivity 写道: On 05/21/2012 05:32 AM, Yanfei Zhang wrote: 于 2012年05月21日 01:43, Avi Kivity 写道: On 05/16/2012 10:50 AM, zhangyanfei wrote: This patch set exports offsets of VMCS fields as note information for kdump. We call it VMCSINFO. The purpose of VMCSINFO is to

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-21 Thread Avi Kivity
On 05/21/2012 12:08 PM, Yanfei Zhang wrote: 于 2012年05月21日 16:34, Avi Kivity 写道: On 05/21/2012 05:32 AM, Yanfei Zhang wrote: 于 2012年05月21日 01:43, Avi Kivity 写道: On 05/16/2012 10:50 AM, zhangyanfei wrote: This patch set exports offsets of VMCS fields as note information for kdump. We call

RE: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-05-21 Thread Ren, Yongjie
-Original Message- From: Kevin Wolf [mailto:kw...@redhat.com] Sent: Monday, May 21, 2012 5:05 PM To: Avi Kivity Cc: Ren, Yongjie; kvm@vger.kernel.org Subject: Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560... Am 21.05.2012 10:27, schrieb Avi Kivity: On

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Avi Kivity
On 05/21/2012 10:24 AM, Benjamin Herrenschmidt wrote: This adds a kvm-specific hypervisor call to the pseries machine which allows to do what amounts to memmove, memcpy and xor over regions of physical memory such as the framebuffer. This is the simplest way to get usable framebuffer speed

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Benjamin Herrenschmidt
On Mon, 2012-05-21 at 12:47 +0300, Avi Kivity wrote: On 05/21/2012 10:24 AM, Benjamin Herrenschmidt wrote: This adds a kvm-specific hypervisor call to the pseries machine which allows to do what amounts to memmove, memcpy and xor over regions of physical memory such as the framebuffer.

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Avi Kivity
On 05/21/2012 01:04 PM, Benjamin Herrenschmidt wrote: On Mon, 2012-05-21 at 12:47 +0300, Avi Kivity wrote: On 05/21/2012 10:24 AM, Benjamin Herrenschmidt wrote: This adds a kvm-specific hypervisor call to the pseries machine which allows to do what amounts to memmove, memcpy and xor over

RE: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Hao, Xudong
-Original Message- From: Avi Kivity [mailto:a...@redhat.com] Sent: Monday, May 21, 2012 4:32 PM To: Hao, Xudong Cc: Marcelo Tosatti; Xudong Hao; kvm@vger.kernel.org; linux-ker...@vger.kernel.org; Shan, Haitao; Zhang, Xiantao Subject: Re: [PATCH 4/4] Enabling Access bit when doing

Re: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Avi Kivity
On 05/21/2012 01:35 PM, Hao, Xudong wrote: That doesn't answer the question. An atomic operation is now non-atomic. You can calculate shadow_accessed_bit and keep on using clear_bit(), or switch to cmpxchg64(), but don't just drop the dirty bit here. I know your meaning. How

RE: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Hao, Xudong
-Original Message- From: Avi Kivity [mailto:a...@redhat.com] Sent: Monday, May 21, 2012 6:48 PM To: Hao, Xudong Cc: Marcelo Tosatti; Xudong Hao; kvm@vger.kernel.org; linux-ker...@vger.kernel.org; Shan, Haitao; Zhang, Xiantao Subject: Re: [PATCH 4/4] Enabling Access bit when doing

Re: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Avi Kivity
On 05/21/2012 02:17 PM, Hao, Xudong wrote: -Original Message- From: Avi Kivity [mailto:a...@redhat.com] Sent: Monday, May 21, 2012 6:48 PM To: Hao, Xudong Cc: Marcelo Tosatti; Xudong Hao; kvm@vger.kernel.org; linux-ker...@vger.kernel.org; Shan, Haitao; Zhang, Xiantao Subject:

Re: [RFC][PATCH v2 00/11] uq/master: irqfd-based interrupt injection for virtio/vhost

2012-05-21 Thread Jan Kiszka
On 2012-05-20 11:45, Avi Kivity wrote: On 05/20/2012 05:42 PM, Michael S. Tsirkin wrote: On Thu, May 17, 2012 at 10:32:28AM -0300, Jan Kiszka wrote: After this series, to only reasons to still use qemu-kvm for production purposes will be PCI device assignment Yay! By the way, there are

Re: [RFC][PATCH v2 00/11] uq/master: irqfd-based interrupt injection for virtio/vhost

2012-05-21 Thread Avi Kivity
On 05/21/2012 02:31 PM, Jan Kiszka wrote: On 2012-05-20 11:45, Avi Kivity wrote: On 05/20/2012 05:42 PM, Michael S. Tsirkin wrote: On Thu, May 17, 2012 at 10:32:28AM -0300, Jan Kiszka wrote: After this series, to only reasons to still use qemu-kvm for production purposes will be PCI

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Benjamin Herrenschmidt
On Mon, 2012-05-21 at 13:07 +0300, Avi Kivity wrote: Now I'm adding another one, so yes, it's looking like a trend :-) I'll look into it, at this stage with only those two, adding some comments in the header might be plenty enough. Documentation/virtual/kvm/ppc-pv.txt is a nice central

Re: [PATCH 05/13] pci: New pci_acs_enabled()

2012-05-21 Thread Don Dutile
On 05/18/2012 10:47 PM, Alex Williamson wrote: On Fri, 2012-05-18 at 19:00 -0400, Don Dutile wrote: On 05/18/2012 06:02 PM, Alex Williamson wrote: On Wed, 2012-05-16 at 09:29 -0400, Don Dutile wrote: On 05/15/2012 05:09 PM, Alex Williamson wrote: On Tue, 2012-05-15 at 13:56 -0600, Bjorn

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Avi Kivity
On 05/21/2012 02:48 PM, Benjamin Herrenschmidt wrote: On Mon, 2012-05-21 at 13:07 +0300, Avi Kivity wrote: Now I'm adding another one, so yes, it's looking like a trend :-) I'll look into it, at this stage with only those two, adding some comments in the header might be plenty enough.

Re: [Qemu-devel] [QEMU 1.1 PATCH v2] Expose CPUID leaf 7 only for -cpu host

2012-05-21 Thread Eduardo Habkost
On Thu, May 17, 2012 at 01:26:55PM -0300, Eduardo Habkost wrote: [...] @@ -521,6 +523,12 @@ static int cpu_x86_fill_host(x86_def_t *x86_cpu_def) x86_cpu_def-ext_features = ecx; x86_cpu_def-features = edx; +if (x86_cpu_def-level = 7) { +

[QEMU 1.1 PATCH v3] Expose CPUID leaf 7 only for -cpu host

2012-05-21 Thread Eduardo Habkost
Changes v2 - v3; - Check for kvm_enabled() before setting cpuid_7_0_ebx_features Changes v1 - v2: - Use kvm_arch_get_supported_cpuid() instead of host_cpuid() on cpu_x86_fill_host(). We should use GET_SUPPORTED_CPUID for all bits on -cpu host eventually, but I am not changing all the

Re: [PATCH 1/4] KVM: Add APIs for unlocked TLB flush

2012-05-21 Thread Avi Kivity
On 05/10/2012 12:03 AM, Marcelo Tosatti wrote: It has the advantage that it requires code to explicitly document where the TLB must be flushed and the sites which expect sptes to be in sync with TLBs. I'm looking for an idea of how to make the flush in those cases not hold

Re: [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block

2012-05-21 Thread Avi Kivity
On 05/18/2012 08:59 PM, Paul Gortmaker wrote: There are two functions in this asm-generic file. Looking at other arch which do not use the generic version, these two fcns are within an #ifdef __KERNEL__ block, so make the generic one consistent with those. Thanks, applied for 3.5. -- error

Re: [PATCH 05/13] pci: New pci_acs_enabled()

2012-05-21 Thread Alex Williamson
On Mon, 2012-05-21 at 09:31 -0400, Don Dutile wrote: On 05/18/2012 10:47 PM, Alex Williamson wrote: On Fri, 2012-05-18 at 19:00 -0400, Don Dutile wrote: On 05/18/2012 06:02 PM, Alex Williamson wrote: On Wed, 2012-05-16 at 09:29 -0400, Don Dutile wrote: On 05/15/2012 05:09 PM, Alex

KVM call agenda for May, Tuesday 22

2012-05-21 Thread Juan Quintela
Hi Please send in any agenda items you are interested in covering. Thanks, Juan. -- 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 http://vger.kernel.org/majordomo-info.html

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-05-21 Thread Kevin Wolf
Am 21.05.2012 11:45, schrieb Ren, Yongjie: -Original Message- From: Kevin Wolf [mailto:kw...@redhat.com] Sent: Monday, May 21, 2012 5:05 PM To: Avi Kivity Cc: Ren, Yongjie; kvm@vger.kernel.org Subject: Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560... Am 21.05.2012

Re: [RFC PATCH 1/5] block: Introduce q-abort_queue_fn()

2012-05-21 Thread Tejun Heo
On Mon, May 21, 2012 at 05:08:29PM +0800, Asias He wrote: When user hot-unplug a disk which is busy serving I/O, __blk_run_queue might be unable to drain all the requests. As a result, the blk_drain_queue() would loop forever and blk_cleanup_queue would not return. So hot-unplug will fail.

[PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
We perform ISR lookups twice: during interrupt injection and on EOI. Typical workloads only have a single bit set there. So we can avoid ISR scans by 1. counting bits as we set/clear them in ISR 2. if count is 1, caching the vector number 3. if count != 1, invalidating the cache The real purpose

Re: [PATCH 11/13] pci: Create common pcibios_err_to_errno

2012-05-21 Thread Konrad Rzeszutek Wilk
On Fri, May 11, 2012 at 04:56:44PM -0600, Alex Williamson wrote: For returning errors out to non-PCI code. Re-name xen's version. Signed-off-by: Alex Williamson alex.william...@redhat.com Acked-by: Konrad Rzeszutek Wilk konrad.w...@oracle.com --- drivers/xen/xen-pciback/conf_space.c |

[PATCH 18/19] msix: Add msix_nr_vectors_allocated

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Analogously to msi_nr_vectors_allocated, add a service for MSI-X. Will be used by the virtio-pci layer. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/msix.c |5 + hw/msix.h |2 ++ 2 files

[PATCH 02/19] Introduce MSIMessage structure

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Will be used for generating and distributing MSI messages, both in emulation mode and under KVM. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- hw/msi.h |5 + qemu-common.h |1 + 2

[PATCH 14/19] kvm: Publicize kvm_irqchip_release_virq

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com This allows to drop routes created by kvm_irqchip_add_irq/msi_route again. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Avi Kivity a...@redhat.com --- kvm-all.c |2 +- kvm-stub.c |4 kvm.h |1 + 3 files changed, 6

[PATCH 01/19] kvm: Refactor KVMState::max_gsi to gsi_count

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Instead of the bitmap size, store the maximum of GSIs the kernel support. Move the GSI limit assertion to the API function kvm_irqchip_add_route and make it stricter. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Marcelo Tosatti

[PATCH 10/19] msix: Invoke msix_handle_mask_update on msix_mask_all

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com In preparation of firing vector notifiers on mask changes, call msix_handle_mask_update also from msix_mask_all. So far, this will have no real effect. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Avi Kivity a...@redhat.com ---

[PULL 00/20 1.2] kvm updates

2012-05-21 Thread Avi Kivity
Please pull from: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master This is mostly Jan's MSI for KVM patches. Avi Kivity (1): kvm: update vmxcap for EPT A/D, INVPCID, RDRAND, VMFUNC Jan Kiszka (19): kvm:

[PATCH 19/19] virtio/vhost: Add support for KVM in-kernel MSI injection

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Make use of the new vector notifier to track changes of the MSI-X configuration of virtio PCI devices. On enabling events, we establish the required virtual IRQ to MSI-X message route and link the signaling eventfd file descriptor to this vIRQ line. That

[PATCH 11/19] msix: Introduce vector notifiers

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Vector notifiers shall be triggered by the MSI/MSI-X core whenever a relevant configuration change is programmed by the guest. In case of MSI-X, changes are reported when the effective mask (global per-vector) alters its state. On unmask, the current

[PATCH 15/19] kvm: Make kvm_irqchip_commit_routes an internal service

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Automatically commit route changes after kvm_add_routing_entry and kvm_irqchip_release_virq. There is no performance relevant use case for which collecting multiple route changes is beneficial. This makes kvm_irqchip_commit_routes an internal service which

[PATCH 12/19] kvm: Rename kvm_irqchip_add_route to kvm_irqchip_add_irq_route

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com We will add kvm_irqchip_add_msi_route, so let's make the difference clearer. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/pc_piix.c |8 kvm-all.c|2 +- kvm.h|2 +- 3

[PATCH 03/19] kvm: Introduce basic MSI support for in-kernel irqchips

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com This patch basically adds kvm_irqchip_send_msi, a service for sending arbitrary MSI messages to KVM's in-kernel irqchip models. As the original KVM API requires us to establish a static route from a pseudo GSI to the target MSI message and inject the MSI

[PATCH 16/19] kvm: Introduce kvm_irqchip_add/remove_irqfd

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Add services to associate an eventfd file descriptor as input with an IRQ line as output. Such a line can be an input pin of an in-kernel irqchip or a virtual line returned by kvm_irqchip_add_route. Signed-off-by: Jan Kiszka jan.kis...@siemens.com

[PATCH 13/19] kvm: Introduce kvm_irqchip_add_msi_route

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Add a service that establishes a static route from a virtual IRQ line to an MSI message. Will be used for IRQFD and device assignment. As we will use this service outside of CONFIG_KVM protected code, stub it properly. Signed-off-by: Jan Kiszka

[PATCH 07/19] kvm: Add support for direct MSI injections

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com If the kernel supports KVM_SIGNAL_MSI, we can avoid the route-based MSI injection mechanism. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- kvm-all.c | 22 +++--- 1 file changed,

[PATCH 04/19] pc: Enable MSI support at APIC level

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Push msi_supported enabling to the APIC implementations where we can encapsulate the decision more cleanly, hiding the details from the generic code. Acked-by: Stefano Stabellini stefano.stabell...@eu.citrix.com Signed-off-by: Jan Kiszka

[PATCH 06/19] kvm: Update kernel headers

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Corresponding kvm.git hash: f2569053e0 Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- linux-headers/linux/kvm.h | 38 ++ 1 file changed, 38 insertions(+) diff

[PATCH 05/19] kvm: x86: Wire up MSI support for in-kernel irqchip

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Catch writes to the MSI MMIO region in the KVM APIC and forward them to the kernel. Provide the kernel support GSI routing, this allows to enable MSI support also for in-kernel irqchip mode. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by:

[PATCH 09/19] msix: Factor out msix_get_message

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com This helper will also be used by the upcoming config notifier. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Avi Kivity a...@redhat.com --- hw/msix.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff

[PATCH 08/19] kvm: Enable in-kernel irqchip support by default

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com As MSI is now fully supported by KVM (/wrt available features in upstream), we can finally enable the in-kernel irqchip by default. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- kvm-all.c |2 +-

[PATCH 17/19] kvm: Enable use of kvm_irqchip_in_kernel in hwlib code

2012-05-21 Thread Avi Kivity
From: Jan Kiszka jan.kis...@siemens.com Provide a dummy kvm_kernel_irqchip so that kvm_irqchip_in_kernel can be used by code that is not under CONFIG_KVM protection. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Avi Kivity a...@redhat.com --- kvm-stub.c |1 + 1 file

Re: [PATCH 05/13] pci: New pci_acs_enabled()

2012-05-21 Thread Don Dutile
On 05/21/2012 10:59 AM, Alex Williamson wrote: On Mon, 2012-05-21 at 09:31 -0400, Don Dutile wrote: On 05/18/2012 10:47 PM, Alex Williamson wrote: On Fri, 2012-05-18 at 19:00 -0400, Don Dutile wrote: On 05/18/2012 06:02 PM, Alex Williamson wrote: On Wed, 2012-05-16 at 09:29 -0400, Don Dutile

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 07:37:27PM +0300, Michael S. Tsirkin wrote: We perform ISR lookups twice: during interrupt injection and on EOI. Typical workloads only have a single bit set there. So we can avoid ISR scans by 1. counting bits as we set/clear them in ISR 2. if count is 1, caching the

[Autotest][PATCH 1/7] virt: Add memory stress test to cpu_flags test.

2012-05-21 Thread Jiří Župka
usage: ./cpuflags-test --stressmem 100 (in MB) Signed-off-by: Jiří Župka jzu...@redhat.com --- client/virt/deps/test_cpu_flags/Makefile|9 +- client/virt/deps/test_cpu_flags/cpuflags-test.c | 28 --- client/virt/deps/test_cpu_flags/stressmem.c | 33

[Autotest][PATCH 2/7] shared: Adds class for collecting a simple statistics.

2012-05-21 Thread Jiří Župka
Signed-off-by: Jiří Župka jzu...@redhat.com --- client/shared/base_utils.py | 34 ++ client/shared/base_utils_unittest.py | 19 +++ 2 files changed, 53 insertions(+), 0 deletions(-) diff --git a/client/shared/base_utils.py

[Autotest][PATCH 3/7] virt.kvm: Unifying qmp/human monitor set_migration_speed

2012-05-21 Thread Jiří Župka
Signed-off-by: Jiří Župka jzu...@redhat.com --- client/virt/kvm_monitor.py |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/client/virt/kvm_monitor.py b/client/virt/kvm_monitor.py index a49fd18..f7a3e34 100644 --- a/client/virt/kvm_monitor.py +++

[Autotest][PATCH 4/7] virt,kvm: Adds possibility interrupt migration function.

2012-05-21 Thread Jiří Župka
It starts migration and after start of migration it returns control to calling function. Signed-off-by: Jiří Župka jzu...@redhat.com --- client/virt/kvm_vm.py | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py

[Autotest][PATCH 7/7] kvm-tests: Adds tests for measure migration speed.

2012-05-21 Thread Jiří Župka
tests: 1) Single host measure migration speed. 2) Multi host measure migration speed. description: 1) start mem stresser in VM to avoid end of migraiton 2) get statistic of migraiton speed 3) kill VMs 4) if migration speed is slower than desired migration speed it raise warning

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-21 Thread Eric Northup
On Wed, May 16, 2012 at 12:50 AM, zhangyanfei zhangyan...@cn.fujitsu.com wrote: This patch set exports offsets of VMCS fields as note information for kdump. We call it VMCSINFO. The purpose of VMCSINFO is to retrieve runtime state of guest machine image, such as registers, in host machine's

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: On 05/21/2012 04:08 PM, Gleb Natapov wrote: On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: If we map a readonly memory space from host to guest and the page is not currently mapped in the host, we will get a

Re: [PATCH v2 2/5] KVM: MMU: Convert remote flushes to kvm_mark_tlb_dirty() and a conditional flush

2012-05-21 Thread Marcelo Tosatti
On Thu, May 17, 2012 at 01:24:41PM +0300, Avi Kivity wrote: This allows us to later move the actual flush out of protection of the mmu spinlock, provided there are no additional dependencies. Constructs of the form if (pred) kvm_flush_remote_tlbs(kvm) are converted to

gettimeofday() vsyscall for kvm-clock?

2012-05-21 Thread Andrew Theurer
Wondering if a user-space gettimofday() for kvm-clock has been considered before. I am seeing a pretty large difference in performance between tsc and kvm-clock. I have to assume at least some of this is due to the mode switch for kvm-clock. Here are the results: (this is a 16 vCPU VM on a

Re: gettimeofday() vsyscall for kvm-clock?

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 03:26:54PM -0500, Andrew Theurer wrote: Wondering if a user-space gettimofday() for kvm-clock has been considered before. I am seeing a pretty large difference in performance between tsc and kvm-clock. I have to assume at least some of this is due to the mode switch

Re: [PATCHv2] Introduce bitmask for apic attention reasons.

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 10:50:30PM +0300, Michael S. Tsirkin wrote: On Thu, Apr 19, 2012 at 02:06:29PM +0300, Gleb Natapov wrote: The patch introduces a bitmap that will hold reasons apic should be checked during vmexit. This is in a preparation for vp eoi patch that will add one more check

Re: [RFC PATCH 5/5] virtio-blk: Use block layer provided spinlock

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 05:08:33PM +0800, Asias He wrote: Block layer will allocate a spinlock for the queue if the driver does not provide one in blk_init_queue(). The reason to use the internal spinlock is that blk_cleanup_queue() will switch to use the internal spinlock in the cleanup

Re: [PATCH v2 3/5] KVM: Flush TLB in mmu notifier without holding mmu_lock

2012-05-21 Thread Marcelo Tosatti
On Thu, May 17, 2012 at 01:24:42PM +0300, Avi Kivity wrote: Signed-off-by: Avi Kivity a...@redhat.com --- virt/kvm/kvm_main.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 585ab45..9f6d15d 100644 ---

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Mon, 21 May 2012, Michael S. Tsirkin wrote: We perform ISR lookups twice: during interrupt injection and on EOI. Typical workloads only have a single bit set there. So we can avoid ISR scans by 1. counting bits as we set/clear them in ISR 2. if count is 1, caching the vector number 3. if

Re: [PATCH v2 3/5] KVM: Flush TLB in mmu notifier without holding mmu_lock

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 05:58:50PM -0300, Marcelo Tosatti wrote: On Thu, May 17, 2012 at 01:24:42PM +0300, Avi Kivity wrote: Signed-off-by: Avi Kivity a...@redhat.com --- virt/kvm/kvm_main.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: @@ -242,6 +262,25 @@ static inline void apic_clear_irr(int vec, struct kvm_lapic *apic) apic-irr_pending = true; } +static inline void apic_set_isr(int vec, struct kvm_lapic *apic) +{ + if

Re: [PATCH] spapr: Add memop hypercall

2012-05-21 Thread Benjamin Herrenschmidt
On Mon, 2012-05-21 at 16:55 +0300, Avi Kivity wrote: Okay. But let's have a spec, even a kvm-private one, and then an implementation of that spec, instead of an implementation and some documentation added as an afterthought (or not). It's a bit like if you had private calls between

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: @@ -242,6 +262,25 @@ static inline void apic_clear_irr(int vec, struct kvm_lapic *apic) apic-irr_pending = true; } +static inline void apic_set_isr(int

Re: gettimeofday() vsyscall for kvm-clock?

2012-05-21 Thread Andrew Theurer
On 05/21/2012 03:36 PM, Marcelo Tosatti wrote: On Mon, May 21, 2012 at 03:26:54PM -0500, Andrew Theurer wrote: Wondering if a user-space gettimofday() for kvm-clock has been considered before. I am seeing a pretty large difference in performance between tsc and kvm-clock. I have to assume at

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: @@ -242,6 +262,25 @@ static inline void apic_clear_irr(int vec, struct kvm_lapic *apic)

Re: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 12:40:42AM +, Mao, Junjie wrote: -Original Message- From: Marcelo Tosatti [mailto:mtosa...@redhat.com] Sent: Saturday, May 19, 2012 5:51 AM To: Mao, Junjie Cc: n...@math.technion.ac.il; 'kvm@vger.kernel.org' Subject: Re: [PATCH v3] KVM: x86:

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
Michael, On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: @@ -242,6 +262,25 @@ static inline void

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2012 at 12:44:39AM +0200, Thomas Gleixner wrote: Michael, On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: @@ -242,6 +262,25 @@ static inline void apic_clear_irr(int

[ANNOUNCE] kvm-kmod-3.4

2012-05-21 Thread Jan Kiszka
After the release of kernel 3.4, this is now the announcements of the corresponding kvm-kmod-3.4. The package is available from http://sourceforge.net/projects/kvm/files/kvm-kmod/3.4/kvm-kmod-3.4.tar.bz2/download See [1] for further details on kvm-kmod. Major KVM changes since kvm-kmod-3.3.6:

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: On Mon, 21 May 2012, Michael S. Tsirkin wrote: We perform ISR lookups twice: during interrupt injection and on EOI. Typical workloads only have a single bit set there. So we can avoid ISR scans by 1. counting bits as we

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: @@ -242,6 +262,25 @@ static inline void apic_clear_irr(int

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread H. Peter Anvin
On 05/21/2012 04:06 PM, Michael S. Tsirkin wrote: I think the reason is __apic_read which now simply copies the registers out to guest, this code will become less straight-forward if it's not 1:1. It can still be 1:1, just drop the 12 bytes of completely useless padding after each 32-bit

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Tue, 22 May 2012, Michael S. Tsirkin wrote: On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: On Mon, 21 May 2012, Michael S. Tsirkin wrote: +static u8 count_vectors(void *bitmap) +{ + u32 *word = bitmap; + int word_offset; + u8 count = 0; + for (word_offset

RE: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-21 Thread Mao, Junjie
@@ -1711,6 +1717,22 @@ static bool vmx_rdtscp_supported(void) return cpu_has_vmx_rdtscp(); } +static bool vmx_pcid_supported(void) { + /* +* This function is only for determining whether to expose PCID bit +* in

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Benjamin Herrenschmidt
On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: Alexander, Is that any better? :) Alex (Graf that is), ping ? The original patch from Alexey was fine btw. VFIO will always call things with the existing capability offset so there's no real risk of doing the wrong thing or

Re: [PATCH 0/7] KVM fixes for 3.2.17

2012-05-21 Thread Ben Hutchings
On Fri, 2012-05-18 at 17:58 -0300, Marcelo Tosatti wrote: See individual patches for details. [...] These came a little too late for 3.2.18, but I've queued them up now. Ben. -- Ben Hutchings You can't have everything. Where would you put it? signature.asc Description: This is a digitally

  1   2   >