Re: IOAPIC doesn't handle byte writes

2011-12-04 Thread Gleb Natapov
On Tue, Nov 22, 2011 at 02:13:02PM +0100, Julian Stecklina wrote: Hello, KVM emulates an IOAPIC that doesn't handle byte writes to its IOAPIC_REG_SELECT register, although for example the ICH10 spec[1] clearly states that this is an 8-bit register. See

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

2011-12-04 Thread Avi Kivity
On 12/03/2011 06:37 AM, Takuya Yoshikawa wrote: Avi Kivity a...@redhat.com wrote: That's true. But some applications do require low latency, and the current code can impose a lot of time with the mmu spinlock held. The total amount of work actually increases slightly, from O(N) to O(N

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

2011-12-04 Thread Avi Kivity
On 12/02/2011 08:26 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vcpu can be destructed only when kvm instance destroyed. Change this to vcpu's destruction taken when its refcnt is zero, and then vcpu MUST and CAN be destroyed before kvm's destroy. @@

Re: [PATCH 2/2] kvm tools: Allow easily sandboxing applications within a guest

2011-12-04 Thread Avi Kivity
On 12/02/2011 09:16 AM, Sasha Levin wrote: This is useful when testing code that might cause problems on the host, or to automate kernel testing since it's now easy to link a kvm tools test script with 'git bisect run'. This tie-up into git bisect is a really cool idea. With device

Re: [RFC][PATCH 01/16] msi: Generalize msix_supported to msi_supported

2011-12-04 Thread Michael S. Tsirkin
On Sat, Dec 03, 2011 at 12:17:26PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Rename msix_supported to msi_supported and control MSI and MSI-X activation this way. That was likely to original intention for this flag, but MSI support came after MSI-X. Signed-off-by:

Re: [RFC][PATCH 01/16] msi: Generalize msix_supported to msi_supported

2011-12-04 Thread Jan Kiszka
On 2011-12-04 11:42, Michael S. Tsirkin wrote: On Sat, Dec 03, 2011 at 12:17:26PM +0100, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Rename msix_supported to msi_supported and control MSI and MSI-X activation this way. That was likely to original intention for this flag, but

Re: [Qemu-devel] [RFC][PATCH 02/16] kvm: Move kvmclock into hw/kvm folder

2011-12-04 Thread Avi Kivity
On 12/04/2011 12:33 AM, Jan Kiszka wrote: Do we have a convention that every include in is considered system header? Should probably be documented then (and code should be converted gradually). It's documented in The C Programming Language, by KR. -- error compiling committee.c: too many

Re: [Qemu-devel] [RFC][PATCH 02/16] kvm: Move kvmclock into hw/kvm folder

2011-12-04 Thread Jan Kiszka
On 2011-12-04 11:43, Avi Kivity wrote: On 12/04/2011 12:33 AM, Jan Kiszka wrote: Do we have a convention that every include in is considered system header? Should probably be documented then (and code should be converted gradually). It's documented in The C Programming Language, by KR.

Re: [RFC] virtio: use mandatory barriers for remote processor vdevs

2011-12-04 Thread Rusty Russell
On Sat, 03 Dec 2011 10:09:44 +1100, Benjamin Herrenschmidt b...@kernel.crashing.org wrote: On Tue, 2011-11-29 at 14:31 +0200, Ohad Ben-Cohen wrote: A trivial, albeit sub-optimal, solution would be to simply revert commit d57ed95 virtio: use smp_XX barriers on SMP. Obviously, though, that's

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Michael S. Tsirkin
On Sat, Dec 03, 2011 at 01:50:28PM +0200, Sasha Levin wrote: On Fri, 2011-12-02 at 11:16 +1030, Rusty Russell wrote: On Thu, 1 Dec 2011 12:26:42 +0200, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 01, 2011 at 10:09:37AM +0200, Sasha Levin wrote: On Thu, 2011-12-01 at 09:58

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Avi Kivity
On 12/03/2011 01:50 PM, Sasha Levin wrote: On Fri, 2011-12-02 at 11:16 +1030, Rusty Russell wrote: On Thu, 1 Dec 2011 12:26:42 +0200, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 01, 2011 at 10:09:37AM +0200, Sasha Levin wrote: On Thu, 2011-12-01 at 09:58 +0200, Michael S.

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

2011-12-04 Thread Liu ping fan
On Sat, Dec 3, 2011 at 2:26 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2011-12-02 07:26, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vcpu can be destructed only when kvm instance destroyed. Change this to vcpu's destruction taken when its refcnt is zero,

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Michael S. Tsirkin
On Sun, Dec 04, 2011 at 01:52:16PM +0200, Avi Kivity wrote: On 12/03/2011 01:50 PM, Sasha Levin wrote: On Fri, 2011-12-02 at 11:16 +1030, Rusty Russell wrote: On Thu, 1 Dec 2011 12:26:42 +0200, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 01, 2011 at 10:09:37AM +0200, Sasha

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Avi Kivity
On 12/04/2011 02:01 PM, Michael S. Tsirkin wrote: How much better? I think that if indirects benefit networking, then we're doing something wrong. What's going on? Does the ring get filled too early? If so we should expand it. The ring is physically contigious. With 256 entries

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

2011-12-04 Thread Gleb Natapov
On Sun, Dec 04, 2011 at 07:53:37PM +0800, Liu ping fan wrote: On Sat, Dec 3, 2011 at 2:26 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2011-12-02 07:26, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vcpu can be destructed only when kvm instance

Re: [PATCH 2/2] kvm tools: Allow easily sandboxing applications within a guest

2011-12-04 Thread Sasha Levin
On Sun, 2011-12-04 at 12:25 +0200, Avi Kivity wrote: On 12/02/2011 09:16 AM, Sasha Levin wrote: This is useful when testing code that might cause problems on the host, or to automate kernel testing since it's now easy to link a kvm tools test script with 'git bisect run'. This tie-up

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Sasha Levin
On Sun, 2011-12-04 at 13:52 +0200, Avi Kivity wrote: On 12/03/2011 01:50 PM, Sasha Levin wrote: On Fri, 2011-12-02 at 11:16 +1030, Rusty Russell wrote: On Thu, 1 Dec 2011 12:26:42 +0200, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 01, 2011 at 10:09:37AM +0200, Sasha Levin

[ANNOUNCE] qemu-kvm-1.0

2011-12-04 Thread Avi Kivity
qemu-kvm-1.0 is now available. This release is based on the upstream QEMU 1.0 plus kvm-specific enhancements. Please see the QEMU 1.0 announcement [1] for more details. This release can be used with the kvm kernel modules provided by your distribution kernel, or by the modules in the kvm-kmod

Re: [RFC][PATCH 01/16] msi: Generalize msix_supported to msi_supported

2011-12-04 Thread Avi Kivity
On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Rename msix_supported to msi_supported and control MSI and MSI-X activation this way. That was likely to original intention for this flag, but MSI support came after MSI-X. 'and' is a dangerous word in a

Re: [RFC][PATCH 01/16] msi: Generalize msix_supported to msi_supported

2011-12-04 Thread Jan Kiszka
On 2011-12-04 14:12, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Rename msix_supported to msi_supported and control MSI and MSI-X activation this way. That was likely to original intention for this flag, but MSI support came after

Re: [RFC][PATCH 10/16] memory: Introduce memory_region_init_reservation

2011-12-04 Thread Avi Kivity
On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Introduce a memory region type that can reserve I/O space. Such regions are useful for modeling I/O that is only handled outside of QEMU, i.e. in the context of an accelerator like KVM. Any access to such a

Re: [RFC][PATCH 11/16] kvm: Introduce core services for in-kernel irqchip support

2011-12-04 Thread Avi Kivity
On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Add the basic infrastructure to active in-kernel irqchip support, inject interrupts into these models, and maintain IRQ routes. Routing is optional and depends on the host arch supporting KVM_CAP_IRQ_ROUTING.

Re: [RFC][PATCH 10/16] memory: Introduce memory_region_init_reservation

2011-12-04 Thread Jan Kiszka
On 2011-12-04 14:20, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Introduce a memory region type that can reserve I/O space. Such regions are useful for modeling I/O that is only handled outside of QEMU, i.e. in the context of an

Re: [RFC][PATCH 13/16] kvm: x86: Add user space part for in-kernel APIC

2011-12-04 Thread Avi Kivity
On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com This introduces the alternative APIC model 'kvm-apic' which makes use of KVM's in-kernel device model. MSI is not yet supported, so we disable this when the in-kernel model is in use. -dev =

Re: [RFC][PATCH 01/16] msi: Generalize msix_supported to msi_supported

2011-12-04 Thread Avi Kivity
On 12/04/2011 03:16 PM, Jan Kiszka wrote: On 2011-12-04 14:12, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Rename msix_supported to msi_supported and control MSI and MSI-X activation this way. That was likely to original intention

Re: [RFC][PATCH 11/16] kvm: Introduce core services for in-kernel irqchip support

2011-12-04 Thread Jan Kiszka
On 2011-12-04 14:23, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Add the basic infrastructure to active in-kernel irqchip support, inject interrupts into these models, and maintain IRQ routes. Routing is optional and depends on the

Re: [RFC][PATCH 11/16] kvm: Introduce core services for in-kernel irqchip support

2011-12-04 Thread Avi Kivity
On 12/04/2011 03:27 PM, Jan Kiszka wrote: On 2011-12-04 14:23, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Add the basic infrastructure to active in-kernel irqchip support, inject interrupts into these models, and maintain IRQ

Re: [RFC][PATCH 11/16] kvm: Introduce core services for in-kernel irqchip support

2011-12-04 Thread Jan Kiszka
On 2011-12-04 14:28, Avi Kivity wrote: On 12/04/2011 03:27 PM, Jan Kiszka wrote: On 2011-12-04 14:23, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Add the basic infrastructure to active in-kernel irqchip support, inject interrupts into

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Avi Kivity
On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Introduce the alternative 'kvm-i8259' device model that exploits KVM in-kernel acceleration. The PIIX3 initialization code is furthermore extended by KVM specific IRQ route setup. Moreover, GSI injection

Re: [RFC][PATCH 11/16] kvm: Introduce core services for in-kernel irqchip support

2011-12-04 Thread Avi Kivity
On 12/04/2011 03:30 PM, Jan Kiszka wrote: Well, I have to comment on something. If you don't want spelling corrections, leave some trailing whitespace. I could create a messpatch.pl... Ah, and with a --reverse flag we could go through the motions of patch review without requiring a repost.

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Jan Kiszka
On 2011-12-04 14:31, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Introduce the alternative 'kvm-i8259' device model that exploits KVM in-kernel acceleration. The PIIX3 initialization code is furthermore extended by KVM specific IRQ

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Avi Kivity
On 12/04/2011 03:42 PM, Jan Kiszka wrote: On 2011-12-04 14:31, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Introduce the alternative 'kvm-i8259' device model that exploits KVM in-kernel acceleration. The PIIX3 initialization

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Jan Kiszka
On 2011-12-04 14:49, Avi Kivity wrote: On 12/04/2011 03:42 PM, Jan Kiszka wrote: On 2011-12-04 14:31, Avi Kivity wrote: On 12/03/2011 01:17 PM, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com Introduce the alternative 'kvm-i8259' device model that exploits KVM in-kernel

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Avi Kivity
On 12/04/2011 03:51 PM, Jan Kiszka wrote: But the name becomes part of the save/restore ABI, so you can't. Nope, the vmstate names are identical. That would ruin migration otherwise. It's just the output of info qtree co. that changes. Oh, okay. I still think it's wrong, but now it's

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Jan Kiszka
On 2011-12-04 15:04, Avi Kivity wrote: On 12/04/2011 03:51 PM, Jan Kiszka wrote: But the name becomes part of the save/restore ABI, so you can't. Nope, the vmstate names are identical. That would ruin migration otherwise. It's just the output of info qtree co. that changes. Oh, okay. I

[PATCH v2 00/16] uq/master: Introduce basic irqchip support

2011-12-04 Thread Jan Kiszka
This is v2, addressing the feedback comments provided so far, namely: - dropped #include conversions - do not abort() on reserved memory region accesses but only warn once - use memory_region_init_io in memory_region_init_reservation Patch 1 of this series has meanwhile been posted for direct

[PATCH v2 02/16] kvm: Move kvmclock into hw/kvm folder

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com More KVM-specific devices will come, so let's start with moving the kvmclock into a dedicated folder. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile.target|4 ++-- configure |1 + hw/{kvmclock.c

[PATCH v2 01/16] msi: Generalize msix_supported to msi_supported

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Rename msix_supported to msi_supported and control MSI and MSI-X activation this way. That was likely to original intention for this flag, but MSI support came after MSI-X. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/msi.c |8

[PATCH v2 03/16] apic: Stop timer on reset

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com All LVTs are masked on reset, so the timer becomes ineffective. Letting it tick nevertheless is harmless, but will at least create a spurious trace event. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/apic.c |2 ++ 1 files changed, 2

[PATCH v2 07/16] ioapic: Convert to memory API

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com This maintains the old imprecise access size handling. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/ioapic.c | 28 +++- 1 files changed, 11 insertions(+), 17 deletions(-) diff --git a/hw/ioapic.c b/hw/ioapic.c index

[PATCH v2 10/16] memory: Introduce memory_region_init_reservation

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Introduce a memory region type that can reserve I/O space. Such regions are useful for modeling I/O that is only handled outside of QEMU, i.e. in the context of an accelerator like KVM. Any access to such a region from QEMU is a bug, but could

[PATCH v2 11/16] kvm: Introduce core services for in-kernel irqchip support

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Add the basic infrastructure to active in-kernel irqchip support, inject interrupts into these models, and maintain IRQ routes. Routing is optional and depends on the host arch supporting KVM_CAP_IRQ_ROUTING. When it's not available on x86, we looe the

[PATCH v2 12/16] kvm: x86: Establish IRQ0 override control

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com KVM is forced to disable the IRQ0 override when we run with in-kernel irqchip but without IRQ routing support of the kernel. Set the fwcfg value correspondingly. This aligns us with qemu-kvm. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/pc.c

[PATCH v2 13/16] kvm: x86: Add user space part for in-kernel APIC

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com This introduces the alternative APIC model 'kvm-apic' which makes use of KVM's in-kernel device model. MSI is not yet supported, so we disable this when the in-kernel model is in use. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile.target

[PATCH v2 16/16] kvm: Arm in-kernel irqchip support

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Make the basic in-kernel irqchip support selectable via -machine ...,kernel_irqchip=on. Leave it off by default until it can fully replace user space models. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- qemu-config.c |4 qemu-options.hx

[PATCH v2 05/16] apic: Open-code timer save/restore

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com To enable migration between accelerated and non-accelerated APIC models, we will need to handle the timer saving and restoring specially and can no longer rely on the automatics of VMSTATE_TIMER. Specifically, accelerated model will not start any QEMUTimer.

[PATCH v2 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Introduce the alternative 'kvm-i8259' device model that exploits KVM in-kernel acceleration. The PIIX3 initialization code is furthermore extended by KVM specific IRQ route setup. Moreover, GSI injection differs in KVM mode from the user space model. As we

[PATCH v2 06/16] i8259: Factor out core for KVM reuse

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Analogously to the APIC, we will reuse some parts of the user space i8259 model for KVM. In this case it is the PicState, vmstate description, a reset core and some init bits. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile.objs |2

[PATCH v2 15/16] kvm: x86: Add user space part for in-kernel IOAPIC

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com This introduces the KVM-accelerated IOAPIC model 'kvm-ioapic' and extends the IRQ routing setup by the 0-2 redirection when needed. The kvm-ioapic model has a property that allows to define its GSI base for injecting interrupts into the kernel model. This

[PATCH v2 09/16] ioapic: Factor out core for KVM reuse

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com KVM will share the IOAPICState, the vmstate, the reset logic and certain init parts with the user space model. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile.target |2 +- hw/ioapic.c | 108

[PATCH v2 08/16] ioapic: Reject non-dword accesses to IOWIN register

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Aligns the model with the spec. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/ioapic.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/hw/ioapic.c b/hw/ioapic.c index 56b1612..eb75766 100644 --- a/hw/ioapic.c +++

[PATCH v2 04/16] apic: Factor out core for KVM reuse

2011-12-04 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com The KVM in-kernel APIC model will reuse parts of the user space model, namely the vmstate, reset handling, IRQ coalescing tracker, some init steps and the base and tpr set/get routines. For the latter, we also prepare set callbacks as KVM will override

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Michael S. Tsirkin
On Sun, Dec 04, 2011 at 02:06:34PM +0200, Avi Kivity wrote: On 12/04/2011 02:01 PM, Michael S. Tsirkin wrote: How much better? I think that if indirects benefit networking, then we're doing something wrong. What's going on? Does the ring get filled too early? If so we

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Avi Kivity
On 12/04/2011 04:06 PM, Jan Kiszka wrote: On 2011-12-04 15:04, Avi Kivity wrote: On 12/04/2011 03:51 PM, Jan Kiszka wrote: But the name becomes part of the save/restore ABI, so you can't. Nope, the vmstate names are identical. That would ruin migration otherwise. It's just the output

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Michael S. Tsirkin
On Sun, Dec 04, 2011 at 01:06:37PM +0200, Michael S. Tsirkin wrote: On Sat, Dec 03, 2011 at 01:50:28PM +0200, Sasha Levin wrote: On Fri, 2011-12-02 at 11:16 +1030, Rusty Russell wrote: On Thu, 1 Dec 2011 12:26:42 +0200, Michael S. Tsirkin m...@redhat.com wrote: On Thu, Dec 01, 2011

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Avi Kivity
On 12/04/2011 05:11 PM, Michael S. Tsirkin wrote: There's also the used ring, but that's a mistake if you have out of order completion. We should have used copying. Seems unrelated... unless you want used to be written into descriptor ring itself? The avail/used rings are in addition to

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Jan Kiszka
On 2011-12-04 16:12, Avi Kivity wrote: On 12/04/2011 04:06 PM, Jan Kiszka wrote: On 2011-12-04 15:04, Avi Kivity wrote: On 12/04/2011 03:51 PM, Jan Kiszka wrote: But the name becomes part of the save/restore ABI, so you can't. Nope, the vmstate names are identical. That would ruin migration

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Michael S. Tsirkin
On Sun, Dec 04, 2011 at 05:16:59PM +0200, Avi Kivity wrote: On 12/04/2011 05:11 PM, Michael S. Tsirkin wrote: There's also the used ring, but that's a mistake if you have out of order completion. We should have used copying. Seems unrelated... unless you want used to be written into

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Michael S. Tsirkin
On Sun, Dec 04, 2011 at 02:13:51PM +0200, Sasha Levin wrote: On Sun, 2011-12-04 at 13:52 +0200, Avi Kivity wrote: On 12/03/2011 01:50 PM, Sasha Levin wrote: On Fri, 2011-12-02 at 11:16 +1030, Rusty Russell wrote: On Thu, 1 Dec 2011 12:26:42 +0200, Michael S. Tsirkin m...@redhat.com

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Avi Kivity
On 12/04/2011 06:00 PM, Michael S. Tsirkin wrote: If you copy descriptors, then it goes away. The avail ring could go away. used could if we make descriptors writeable. IIUC it was made RO in the hope that will make it easier for xen to adopt. Still relevant? You mean RO from the

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Avi Kivity
On 12/04/2011 05:19 PM, Jan Kiszka wrote: In the sense that kernel-apic is just an accelerated apic. From the guest point of view, there's no difference, and that should be reflected in the device model. That was my goal as well: The guest should not notice the difference, but the

Re: [PATCH] KVM: x86: Drop unused return value of kvm_mmu_remove_some_alloc_mmu_pages

2011-12-04 Thread Avi Kivity
On 12/02/2011 07:35 PM, Jan Kiszka wrote: freed_pages is never evaluated, so remove it as well as the return code kvm_mmu_remove_some_alloc_mmu_pages so far delivered to its only user. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from

Re: [PATCH] KVM: x86: Remove set-but-unused cr4 from check_cr_write

2011-12-04 Thread Avi Kivity
On 12/02/2011 07:26 PM, Jan Kiszka wrote: This was probably copypasted from the cr0 case, but it's unneeded here. Applied, thanks. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [PATCH] KVM: Veirfy memory slot only for readability

2011-12-04 Thread Avi Kivity
On 12/02/2011 07:46 AM, Sasha Levin wrote: Do you want to create read only memory slots for kvm tool? What KVM tool currently does is copy the kernel into guest memory and run it from there. An idea raised recently was instead of copying it we should mmap it into the memory to reduce

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

2011-12-04 Thread Avi Kivity
On 11/27/2011 02:43 PM, Sasha Levin wrote: Switch to kmemdup() in two places to shorten the code and avoid possible bugs. Doesn't apply, please rebase. -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body

Re: [PATCH] KVM: Veirfy memory slot only for readability

2011-12-04 Thread Sasha Levin
On Sun, 2011-12-04 at 18:53 +0200, Avi Kivity wrote: On 12/02/2011 07:46 AM, Sasha Levin wrote: Do you want to create read only memory slots for kvm tool? What KVM tool currently does is copy the kernel into guest memory and run it from there. An idea raised recently was instead of

Re: [PATCH] KVM: Veirfy memory slot only for readability

2011-12-04 Thread Avi Kivity
On 12/04/2011 07:29 PM, Sasha Levin wrote: On Sun, 2011-12-04 at 18:53 +0200, Avi Kivity wrote: On 12/02/2011 07:46 AM, Sasha Levin wrote: Do you want to create read only memory slots for kvm tool? What KVM tool currently does is copy the kernel into guest memory and run it from

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Sasha Levin
On Sun, 2011-12-04 at 18:22 +0200, Michael S. Tsirkin wrote: On Sun, Dec 04, 2011 at 02:13:51PM +0200, Sasha Levin wrote: On Sun, 2011-12-04 at 13:52 +0200, Avi Kivity wrote: On 12/03/2011 01:50 PM, Sasha Levin wrote: On Fri, 2011-12-02 at 11:16 +1030, Rusty Russell wrote: On Thu, 1

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

2011-12-04 Thread Sasha Levin
Switch to kmemdup() in two places to shorten the code and avoid possible bugs. 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 |4 ++-- virt/kvm/kvm_main.c |7 +++ 2 files changed, 5

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

2011-12-04 Thread Sasha Levin
Switch to using memdup_user when possible. This makes code more smaller and compact, and prevents errors. 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 | 82

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Avi Kivity
On 12/04/2011 07:34 PM, Sasha Levin wrote: I'm confused. didn't you see a bigger benefit for guest-host by switching indirect off? The 5% improvement is over the 'regular' indirect on, not over indirect off. Sorry for the confusion there. I suggested this change regardless of the

Re: [PATCH 2/2] KVM: Correct documentation of KVM_GET_SUPPORTED_CPUID

2011-12-04 Thread Sasha Levin
Avi, This is the other part of the get_supported_cpuid change. We discussed it over IRC and you said it looks right. On Thu, 2011-11-17 at 12:18 +0200, Sasha Levin wrote: If the amount of entries available passed to KVM_GET_SUPPORTED_CPUID is too big we don't fail, we just adjust it to the

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Sasha Levin
On Sun, 2011-12-04 at 19:37 +0200, Avi Kivity wrote: On 12/04/2011 07:34 PM, Sasha Levin wrote: I'm confused. didn't you see a bigger benefit for guest-host by switching indirect off? The 5% improvement is over the 'regular' indirect on, not over indirect off. Sorry for the

Re: [PATCH RFC V3 2/4] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks

2011-12-04 Thread Raghavendra K T
On 12/02/2011 01:20 AM, Raghavendra K T wrote: Have you tested it on AMD machines? There are some differences in the hypercall infrastructure there. Yes. 'll test on AMD machine and update on that. I tested the code on 64 bit Dual-Core AMD Opteron machine, and it is working. - Raghu --

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Sasha Levin
On Sun, 2011-12-04 at 19:39 +0200, Sasha Levin wrote: On Sun, 2011-12-04 at 19:37 +0200, Avi Kivity wrote: On 12/04/2011 07:34 PM, Sasha Levin wrote: I'm confused. didn't you see a bigger benefit for guest-host by switching indirect off? The 5% improvement is over the

[PATCH 0/3] QEMU kvm: Adding KICK_VCPU capability to i386 kvm

2011-12-04 Thread Raghavendra K T
From: Raghavendra K T raghavendra...@linux.vnet.ibm.com Three patch series following this, extends KVM-hypervisor and Linux guest running on KVM-hypervisor to support pv-ticket spinlocks. PV ticket spinlock helps to solve Lock Holder Preemption problem discussed in

[PATCH 1/3] QEMU kvm: Syncing linux headers to 3.2.0-rc1

2011-12-04 Thread Raghavendra K T
Update the kvm kernel headers to the 3.2.0-rc1 post using scripts/update-linux-headers.sh script. Signed-off-by: Raghavendra K T raghavendra...@linux.vnet.ibm.com --- diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kvm.h index fb3fddc..08fe69e 100644 ---

[PATCH 2/3] QEMU kvm: Syncing linux headers to support KICK_VCPU capability

2011-12-04 Thread Raghavendra K T
Update the kernel header that adds a hypercall to support pv-ticketlocks. Signed-off-by: Raghavendra K T raghavendra...@linux.vnet.ibm.com --- diff --git a/linux-headers/asm-x86/kvm_para.h b/linux-headers/asm-x86/kvm_para.h index f2ac46a..03d3a36 100644 --- a/linux-headers/asm-x86/kvm_para.h +++

[PATCH 3/3] QEMU kvm/i386 : Adding KICK_VCPU capability support in i386 target.

2011-12-04 Thread Raghavendra K T
Extend the KVM Hypervisor to enable KICK_VCPU feature that allows a vcpu to kick the halted vcpu to continue with execution in PV ticket spinlock. Signed-off-by: Srivatsa Vaddagiri va...@linux.vnet.ibm.com Signed-off-by: Raghavendra K T raghavendra...@linux.vnet.ibm.com --- diff --git

Re: [PATCH] KVM: Veirfy memory slot only for readability

2011-12-04 Thread Sasha Levin
On Sun, 2011-12-04 at 19:34 +0200, Avi Kivity wrote: On 12/04/2011 07:29 PM, Sasha Levin wrote: On Sun, 2011-12-04 at 18:53 +0200, Avi Kivity wrote: On 12/02/2011 07:46 AM, Sasha Levin wrote: Do you want to create read only memory slots for kvm tool? What KVM tool currently does

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Blue Swirl
On Sun, Dec 4, 2011 at 16:35, Avi Kivity a...@redhat.com wrote: On 12/04/2011 05:19 PM, Jan Kiszka wrote: In the sense that kernel-apic is just an accelerated apic.  From the guest point of view, there's no difference, and that should be reflected in the device model. That was my goal

Re: [RFC][PATCH 14/16] kvm: x86: Add user space part for in-kernel i8259

2011-12-04 Thread Jan Kiszka
On 2011-12-04 22:31, Blue Swirl wrote: On Sun, Dec 4, 2011 at 16:35, Avi Kivity a...@redhat.com wrote: On 12/04/2011 05:19 PM, Jan Kiszka wrote: In the sense that kernel-apic is just an accelerated apic. From the guest point of view, there's no difference, and that should be reflected in

Re: [PATCH] virtio-ring: Use threshold for switching to indirect descriptors

2011-12-04 Thread Rusty Russell
On Sun, 04 Dec 2011 17:16:59 +0200, Avi Kivity a...@redhat.com wrote: On 12/04/2011 05:11 PM, Michael S. Tsirkin wrote: There's also the used ring, but that's a mistake if you have out of order completion. We should have used copying. Seems unrelated... unless you want used to be

What are the rules for hyperthreaded CPUs?

2011-12-04 Thread Todd And Margo Chester
Hi All, My host has an i7-960 processor (4 cores, 8 hypterthreaded cores.) /proc/cpuinfo on my host shows 8 processors. On my Fedora Core 16 guest, /proc/cpuinfo shows 4 processors. Question: what is the maximum number of processors I can assign to my guest? 4 or 8? What are the rules for

What are the rules for hyperthreaded CPUs?

2011-12-04 Thread Todd And Margo Chester
Hi All, My host has an i7-960 processor (4 cores, 8 hypterthreaded cores.) /proc/cpuinfo on my host shows 8 processors. On my Fedora Core 16 guest, /proc/cpuinfo shows 4 processors. Question: what is the maximum number of processors I can assign to my guest? 4 or 8? What are the rules for

Can I configure cores instead of CPU's

2011-12-04 Thread Todd And Margo Chester
Hi All, Scientific Linux 6.1 x64 qemu-kvm-0.12.1.2-2.160.el6_1.2.x86_64 My XP-Pro guest will only let me use two CPUs. Is there a way I can tell Virt-Manager to use one CPU with four cores instead of four separate CPUs? Many thanks, -T Hi Frank, Figured out what I was doing wrong. In

Re: [KVM][Kemari]: Build error fix

2011-12-04 Thread OHMURA Kei
On 2011/12/02 21:51, Pradeep Kumar wrote: It fixes build failure. I hit this error, after succsfull migration and sync. (qemu) qemu-system-x86_64: fill buffer failed, Interrupted system call qemu-system-x86_64: recv header failed qemu-system-x86_64: recv ack failed

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

2011-12-04 Thread Liu ping fan
On Sun, Dec 4, 2011 at 6:23 PM, Avi Kivity a...@redhat.com wrote: On 12/02/2011 08:26 AM, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com Currently, vcpu can be destructed only when kvm instance destroyed. Change this to vcpu's destruction taken when its refcnt is zero,

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

2011-12-04 Thread Liu ping fan
On Sun, Dec 4, 2011 at 8:10 PM, Gleb Natapov g...@redhat.com wrote: On Sun, Dec 04, 2011 at 07:53:37PM +0800, Liu ping fan wrote: On Sat, Dec 3, 2011 at 2:26 AM, Jan Kiszka jan.kis...@siemens.com wrote: On 2011-12-02 07:26, Liu Ping Fan wrote: From: Liu Ping Fan pingf...@linux.vnet.ibm.com

Re: What are the rules for hyperthreaded CPUs?

2011-12-04 Thread Michael Tokarev
On 05.12.2011 05:26, Todd And Margo Chester wrote: Hi All, My host has an i7-960 processor (4 cores, 8 hypterthreaded cores.) /proc/cpuinfo on my host shows 8 processors. On my Fedora Core 16 guest, /proc/cpuinfo shows 4 processors. Question: what is the maximum number of processors I can