[PATCH 1/2] virtio: fix typos of memory barriers

2012-01-20 Thread Jason Wang
Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/virtio/virtio_ring.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 79e1b29..78428a8 100644 --- a/drivers/virtio/virtio_ring.c +++

[PATCH 2/2] virtio: correct the memory barrier in virtqueue_kick_prepare()

2012-01-20 Thread Jason Wang
Use virtio_mb() to make sure the available index to be exposed before checking the the avail event. Otherwise we may get stale value of avail event in guest and never kick the host after. Signed-off-by: Jason Wang jasow...@redhat.com --- drivers/virtio/virtio_ring.c |6 +++--- 1 files

Re: qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Marcelo Tosatti
On Thu, Jan 19, 2012 at 07:01:44PM +0100, Jan Kiszka wrote: On 2012-01-19 18:53, Marcelo Tosatti wrote: What problems does it cause, and in which scenarios? Can't they be fixed? If the guest compensates for lost ticks, and KVM reinjects them, guest time advances faster then it should,

Re: qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Jan Kiszka
On 2012-01-20 11:14, Marcelo Tosatti wrote: On Thu, Jan 19, 2012 at 07:01:44PM +0100, Jan Kiszka wrote: On 2012-01-19 18:53, Marcelo Tosatti wrote: What problems does it cause, and in which scenarios? Can't they be fixed? If the guest compensates for lost ticks, and KVM reinjects them, guest

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Daniel P. Berrange
On Fri, Jan 20, 2012 at 11:22:27AM +0100, Jan Kiszka wrote: On 2012-01-20 11:14, Marcelo Tosatti wrote: On Thu, Jan 19, 2012 at 07:01:44PM +0100, Jan Kiszka wrote: On 2012-01-19 18:53, Marcelo Tosatti wrote: What problems does it cause, and in which scenarios? Can't they be fixed? If

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Jamie Lokier
Jan Kiszka wrote: Usability. Users should not have to care about individual tick-based clocks. They care about my OS requires lost ticks compensation, yes or no. Conceivably an OS may require lost ticks compensation depending on boot options given to the OS telling it which clock sources to

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Jan Kiszka
On 2012-01-20 11:39, Jamie Lokier wrote: Jan Kiszka wrote: Usability. Users should not have to care about individual tick-based clocks. They care about my OS requires lost ticks compensation, yes or no. Conceivably an OS may require lost ticks compensation depending on boot options given to

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Jan Kiszka
On 2012-01-20 11:25, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 11:22:27AM +0100, Jan Kiszka wrote: On 2012-01-20 11:14, Marcelo Tosatti wrote: On Thu, Jan 19, 2012 at 07:01:44PM +0100, Jan Kiszka wrote: On 2012-01-19 18:53, Marcelo Tosatti wrote: What problems does it cause, and in

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Daniel P. Berrange
On Fri, Jan 20, 2012 at 12:13:48PM +0100, Jan Kiszka wrote: On 2012-01-20 11:25, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 11:22:27AM +0100, Jan Kiszka wrote: On 2012-01-20 11:14, Marcelo Tosatti wrote: On Thu, Jan 19, 2012 at 07:01:44PM +0100, Jan Kiszka wrote: On 2012-01-19

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Jan Kiszka
On 2012-01-20 12:45, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 12:13:48PM +0100, Jan Kiszka wrote: On 2012-01-20 11:25, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 11:22:27AM +0100, Jan Kiszka wrote: On 2012-01-20 11:14, Marcelo Tosatti wrote: On Thu, Jan 19, 2012 at 07:01:44PM

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Paolo Bonzini
On 01/20/2012 12:13 PM, Jan Kiszka wrote: OK, this sounds like a good option: add per-device control but also introduce global default. The latter can still be done later on. The only problem is that we should already come up with the right, generic control switch template. reinject=on|off, as

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Daniel P. Berrange
On Fri, Jan 20, 2012 at 01:00:06PM +0100, Jan Kiszka wrote: On 2012-01-20 12:45, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 12:13:48PM +0100, Jan Kiszka wrote: On 2012-01-20 11:25, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 11:22:27AM +0100, Jan Kiszka wrote: On 2012-01-20

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Jan Kiszka
On 2012-01-20 13:42, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 01:00:06PM +0100, Jan Kiszka wrote: On 2012-01-20 12:45, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 12:13:48PM +0100, Jan Kiszka wrote: On 2012-01-20 11:25, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Daniel P. Berrange
On Fri, Jan 20, 2012 at 01:51:20PM +0100, Jan Kiszka wrote: On 2012-01-20 13:42, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 01:00:06PM +0100, Jan Kiszka wrote: On 2012-01-20 12:45, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 12:13:48PM +0100, Jan Kiszka wrote: On 2012-01-20

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Jan Kiszka
On 2012-01-20 13:54, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 01:51:20PM +0100, Jan Kiszka wrote: On 2012-01-20 13:42, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 01:00:06PM +0100, Jan Kiszka wrote: On 2012-01-20 12:45, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at

Re: [Qemu-devel] qemu-kvm upstreaming: Do we need -no-kvm-pit and -no-kvm-pit-reinjection semantics?

2012-01-20 Thread Daniel P. Berrange
On Fri, Jan 20, 2012 at 02:02:03PM +0100, Jan Kiszka wrote: On 2012-01-20 13:54, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 01:51:20PM +0100, Jan Kiszka wrote: On 2012-01-20 13:42, Daniel P. Berrange wrote: On Fri, Jan 20, 2012 at 01:00:06PM +0100, Jan Kiszka wrote: On 2012-01-20

Re: [PATCH] KVM: Factor out kvm_vcpu_kick to arch-generic code

2012-01-20 Thread Jan Kiszka
On 2012-01-20 04:22, Christoffer Dall wrote: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index d9cfb78..cd30b68 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -153,6 +153,7 @@ void vcpu_load(struct kvm_vcpu *vcpu) cpu = get_cpu();

[PATCH v4 1/3] virtio-scsi: first version

2012-01-20 Thread Paolo Bonzini
The virtio-scsi HBA is the basis of an alternative storage stack for QEMU-based virtual machines (including KVM). Compared to virtio-blk it is more scalable, because it supports many LUNs on a single PCI slot), more powerful (it more easily supports passthrough of host devices to the guest) and

[PATCH v4 0/3] virtio-scsi driver

2012-01-20 Thread Paolo Bonzini
This is the first implementation of the virtio-scsi driver, a virtual HBA that will be supported by KVM. It implements a subset of the spec, in particular it does not implement asynchronous notifications for either LUN reset/removal/addition or CD-ROM media events, but it is already functional

[PATCH v4 3/3] virtio-scsi: add power management support

2012-01-20 Thread Paolo Bonzini
This patch adds freeze/restore handlers for the HBA. Block queues are managed independently by the disk devices. Cc: linux-scsi linux-s...@vger.kernel.org Cc: Rusty Russell ru...@rustcorp.com.au Cc: Michael S. Tsirkin m...@redhat.com Cc: kvm@vger.kernel.org Signed-off-by: Paolo Bonzini

[PATCH v4 2/3] virtio-scsi: add error handling

2012-01-20 Thread Paolo Bonzini
This commit adds basic error handling to the virtio-scsi HBA device. Task management functions are sent synchronously via the control virtqueue. Cc: linux-scsi linux-s...@vger.kernel.org Cc: Rusty Russell ru...@rustcorp.com.au Cc: Michael S. Tsirkin m...@redhat.com Cc: kvm@vger.kernel.org

Re: [PATCH] qemu-kvm: Remove obsolete io_thread line from configure

2012-01-20 Thread Marcelo Tosatti
On Thu, Jan 19, 2012 at 02:02:30PM +0100, Jan Kiszka wrote: This control knob no longer exists. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Applied, thanks. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

Re: [PATCH v2] qemu-kvm: Remove icache flush from cpu_physical_memory_rw

2012-01-20 Thread Marcelo Tosatti
On Thu, Jan 19, 2012 at 07:04:38PM +0100, Jan Kiszka wrote: On 2012-01-19 18:54, Marcelo Tosatti wrote: On Thu, Jan 19, 2012 at 01:39:24PM +0100, Jan Kiszka wrote: This is at best a PPC topi but according to [1] even there unneeded. In any case, remove this diff to upstream, it should be

[PATCH 20/20] kvm: Activate in-kernel irqchip support

2012-01-20 Thread Marcelo Tosatti
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 10/20] i8259: Completely privatize PicState

2012-01-20 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com Use DeviceState instead of PicState in the public i8259 API. This is cleaner and allows to reorganize the PIC data structures for KVM reuse. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/i8259.c | 17 +++-- hw/pc.h|7

[PATCH 03/20] msi: Generalize msix_supported to msi_supported

2012-01-20 Thread Marcelo Tosatti
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 02/20] hyper-v: initialize Hyper-V CPUID leaves.

2012-01-20 Thread Marcelo Tosatti
From: Vadim Rozenfeld vroze...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- target-i386/kvm.c | 65 +++- 1 files changed, 63 insertions(+), 2 deletions(-) diff --git a/target-i386/kvm.c b/target-i386/kvm.c index

[PATCH 13/20] ioapic: Factor out base class for KVM reuse

2012-01-20 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com Split up the IOAPIC analogously to APIC and i8259. KVM will share the IOAPICCommonState, the vmstate, reset logic and certain init parts with the user space model. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Makefile.target |2 +-

[PATCH 14/20] memory: Introduce memory_region_init_reservation

2012-01-20 Thread Marcelo Tosatti
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 17/20] kvm: x86: Add user space part for in-kernel APIC

2012-01-20 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com This introduces the alternative APIC device which makes use of KVM's in-kernel device model. External NMI injection via LINT1 is emulated by checking the current state of the in-kernel APIC, only injecting a NMI into the VCPU if LINT1 is unmasked and

[PATCH 08/20] apic: Factor out base class for KVM reuse

2012-01-20 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com The KVM in-kernel APIC model will reuse parts of the user space model while providing the same frontend view to guest and most management interfaces. Factor out an APIC base class to encapsulate those parts that will be shared by user space and KVM model.

[PATCH 18/20] kvm: x86: Add user space part for in-kernel i8259

2012-01-20 Thread Marcelo Tosatti
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. GSI injection differs in KVM mode from the user space model. As we can

[PATCH 09/20] apic: Open-code timer save/restore

2012-01-20 Thread Marcelo Tosatti
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 16/20] kvm: x86: Establish IRQ0 override control

2012-01-20 Thread Marcelo Tosatti
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 06/20] apic: Inject external NMI events via LINT1

2012-01-20 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com On real hardware, NMI button events are injected via the LINT1 line of the APICs. E.g. kdump expect this wiring and gets upset if the per-APIC LINT1 mask is not respected, i.e. if NMIs are injected to VCPUs that should not receive them. Change the APIC

[PATCH 12/20] ioapic: Drop post-load irr initialization

2012-01-20 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com As all devices undergo a reset prior to vmloa, and the reset value of irr is 0, we do not need to do this clearing for older vmstates explicitly. Dropping this redundant code will also make KVM integration a bit simpler. Signed-off-by: Jan Kiszka

[PATCH 01/20] hyper-v: introduce Hyper-V support infrastructure.

2012-01-20 Thread Marcelo Tosatti
From: Vadim Rozenfeld vroze...@redhat.com [Jan: fix build with CONFIG_USER_ONLY] Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- Makefile.target |2 + target-i386/cpuid.c | 14 +++ target-i386/hyperv.c | 64 ++

[PATCH 07/20] apic: Introduce apic_report_irq_delivered

2012-01-20 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com The in-kernel i8259 and IOAPIC backends for KVM will need this, so encapsulate the shared bits. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- hw/apic.c| 11 --- hw/apic.h|1 + trace-events |2 +- 3 files changed, 10

[PATCH 00/20] [PULL] qemu-kvm.git uq/master queue

2012-01-20 Thread Marcelo Tosatti
The following changes since commit 8c4ec5c0269bda18bb777a64b2008088d1c632dc: pxa2xx_keypad: fix unbalanced parenthesis. (2012-01-17 02:14:42 +0100) are available in the git repository at: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master Jan Kiszka (18): msi: Generalize

[PATCH 19/20] kvm: x86: Add user space part for in-kernel IOAPIC

2012-01-20 Thread Marcelo Tosatti
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 04/20] kvm: Move kvmclock into hw/kvm folder

2012-01-20 Thread Marcelo Tosatti
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/kvm/clock.c | 120

[PATCH 05/20] apic: Stop timer on reset

2012-01-20 Thread Marcelo Tosatti
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 15/20] kvm: Introduce core services for in-kernel irqchip support

2012-01-20 Thread Marcelo Tosatti
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 11/20] i8259: Factor out base class for KVM reuse

2012-01-20 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com Analogously to the APIC, we will reuse some parts of the user space i8259 model for KVM. The base class provides a common device state, the vmstate, the property list, a reset core and some shared init bits. This also introduces a common helper to

Re: [PATCH] KVM: Factor out kvm_vcpu_kick to arch-generic code

2012-01-20 Thread Jan Kiszka
On 2012-01-20 04:22, Christoffer Dall wrote: diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index d9cfb78..cd30b68 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -153,6 +153,7 @@ void vcpu_load(struct kvm_vcpu *vcpu) cpu = get_cpu();