[PATCH 2/9] Do not allow interrupt injection from userspace if there is a pending event.

2009-05-05 Thread Gleb Natapov
Signed-off-by: Gleb Natapov --- arch/x86/kvm/x86.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2d7082c..12ab1cc 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3080,8 +3080,9 @@ static void post_kvm_run_s

[PATCH 4/9] [SVM] skip_emulated_instruction() decode an instruction if size is not known

2009-05-05 Thread Gleb Natapov
Signed-off-by: Gleb Natapov --- arch/x86/kvm/svm.c | 11 +-- 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index c1ef2b9..14cdfce 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -207,7 +207,9 @@ static void skip_emula

[PATCH 3/9] Remove irq_pending bitmap

2009-05-05 Thread Gleb Natapov
Only one interrupt vector can be injected from userspace irqchip at any given time so no need to store it in a bitmap. Put it into interrupt queue directly. Signed-off-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h |2 -- arch/x86/kvm/irq.c |4 ++-- arch/x86/kvm/x86.c

[PATCH 5/9] [VMX] Do not re-execute INTn instruction.

2009-05-05 Thread Gleb Natapov
Re-inject event instead. This is what Intel suggest. Also use correct instruction length when re-injecting soft fault/interrupt. Signed-off-by: Gleb Natapov --- arch/x86/include/asm/kvm_host.h |5 - arch/x86/kvm/svm.c |6 +++--- arch/x86/kvm/vmx.c | 29 +++

[PATCH 1/9] Unprotect a page if #PF happens during NMI injection.

2009-05-05 Thread Gleb Natapov
It is done for exception and interrupt already. Signed-off-by: Gleb Natapov --- arch/x86/kvm/svm.c |3 +-- arch/x86/kvm/vmx.c |2 +- arch/x86/kvm/x86.h |6 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 8f411ff..c1e

[PATCH 8/9] Replace pending exception by PF if it happens serially.

2009-05-05 Thread Gleb Natapov
replace previous exception with a new one in a hope that instruction re-execution will regenerate lost exception. Signed-off-by: Gleb Natapov --- arch/x86/kvm/x86.c | 19 --- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c

[PATCH 6/9] IRQ/NMI window should always be requested.

2009-05-05 Thread Gleb Natapov
Currently they are not requested if there is pending exception. Signed-off-by: Gleb Natapov --- arch/x86/kvm/x86.c | 30 -- 1 files changed, 12 insertions(+), 18 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 023842b..bce49da 100644 --- a/a

[PATCH 7/9] Drop interrupt shadow when single stepping should be done only on VMX.

2009-05-05 Thread Gleb Natapov
The problem exists only on VMX. Also currently we skip this step if there is pending exception. The patch fixes this too. Signed-off-by: Gleb Natapov --- arch/x86/kvm/vmx.c |8 arch/x86/kvm/x86.c |3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/arch/x86/kvm

[PATCH 9/9] [SVM] inject NMI after IRET from a previous NMI, not before.

2009-05-05 Thread Gleb Natapov
If NMI is received during handling of another NMI it should be injected immediately after IRET from previous NMI handler, but SVM intercept IRET before instruction execution so we can't inject pending NMI at this point and there is not way to request exit when NMI window opens. This patch fix SVM c

Re: Paravirtualisation or not?

2009-05-05 Thread Stefan Hajnoczi
> If a set of drivers essentially implementing the virtio framework > (virtio_pci, virtio_ring, virtio queues) were available for > windows, that would be *really* neat. I haven't tried them myself but I think this will give you virtio-net for Windows: http://sourceforge.net/project/showfiles.php?g

Re: [PATCH 9/9] [SVM] inject NMI after IRET from a previous NMI, not before.

2009-05-05 Thread Jan Kiszka
Gleb Natapov wrote: > If NMI is received during handling of another NMI it should be injected > immediately after IRET from previous NMI handler, but SVM intercept IRET > before instruction execution so we can't inject pending NMI at this > point and there is not way to request exit when NMI window

Re: Paravirtualisation or not?

2009-05-05 Thread Pantelis Koukousoulas
On Tue, May 5, 2009 at 11:37 AM, Stefan Hajnoczi wrote: >> If a set of drivers essentially implementing the virtio framework >> (virtio_pci, virtio_ring, virtio queues) were available for >> windows, that would be *really* neat. > I haven't tried them myself but I think this will give you virtio-n

[PATCH 1/1] qemu-kvm: virtio-net: Re-instate GSO code removed upstream

2009-05-05 Thread Mark McLoughlin
This commit: commit 559a8f45f34cc50d1a60b4f67a06614d506b2e01 Subject: Remove stray GSO code from virtio_net (Mark McLoughlin) Removed some GSO code from upstream qemu.git, but it needs to be re-instated in qemu-kvm.git. Reported-by: Sridhar Samudrala Signed-off-by: Mark McLoughlin --- h

Re: [kvm] virtio-net not working with the latest qemu-kvm git

2009-05-05 Thread Mark McLoughlin
On Mon, 2009-05-04 at 11:44 -0600, Alex Williamson wrote: > On Mon, 2009-05-04 at 09:50 -0700, Sridhar Samudrala wrote: > > When i moved to the latest qemu-kvm git tree from kvm-85, i noticed that > > networking stopped working between the host and the guest. > > It started working when i put the d

Re: [PATCH 9/9] [SVM] inject NMI after IRET from a previous NMI, not before.

2009-05-05 Thread Gleb Natapov
On Tue, May 05, 2009 at 10:45:20AM +0200, Jan Kiszka wrote: > > @@ -2331,8 +2358,16 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu) > > { > > struct vcpu_svm *svm = to_svm(vcpu); > > > > - if (svm->vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) > > - enable_irq_wind

Re: [PATCH 9/9] [SVM] inject NMI after IRET from a previous NMI, not before.

2009-05-05 Thread Jan Kiszka
Gleb Natapov wrote: > On Tue, May 05, 2009 at 10:45:20AM +0200, Jan Kiszka wrote: >>> @@ -2331,8 +2358,16 @@ static void enable_nmi_window(struct kvm_vcpu *vcpu) >>> { >>> struct vcpu_svm *svm = to_svm(vcpu); >>> >>> - if (svm->vmcb->control.int_state & SVM_INTERRUPT_SHADOW_MASK) >>> -

Re: [PATCH 9/9] [SVM] inject NMI after IRET from a previous NMI, not before.

2009-05-05 Thread Gleb Natapov
On Tue, May 05, 2009 at 11:25:13AM +0200, Jan Kiszka wrote: > Gleb Natapov wrote: > > On Tue, May 05, 2009 at 10:45:20AM +0200, Jan Kiszka wrote: > >>> @@ -2331,8 +2358,16 @@ static void enable_nmi_window(struct kvm_vcpu > >>> *vcpu) > >>> { > >>> struct vcpu_svm *svm = to_svm(vcpu); > >>> >

Re: [PATCH 9/9] [SVM] inject NMI after IRET from a previous NMI, not before.

2009-05-05 Thread Gleb Natapov
I noticed a small bug in previous patch. Use this one instead. (change update_db_intercept(to_svm(svm)) -> update_db_intercept(&svm->vcpu)) If NMI is received during handling of another NMI it should be injected immediately after IRET from previous NMI handler, but SVM intercept IRET before instr

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-05-05 Thread Michael S. Tsirkin
On Mon, Apr 27, 2009 at 10:30:17PM +0800, Sheng Yang wrote: > > > > > If guest can write to the real device MSI-X table directly, it would > > > > > cause chaos on interrupt delivery, for what guest see is totally > > > > > different with what's host see... > > > > > > > > Obviously. > > > > > > >

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-05-05 Thread Marcelo Tosatti
On Tue, May 05, 2009 at 12:51:36PM +0300, Michael S. Tsirkin wrote: > On Mon, Apr 27, 2009 at 10:30:17PM +0800, Sheng Yang wrote: > > > > > > If guest can write to the real device MSI-X table directly, it would > > > > > > cause chaos on interrupt delivery, for what guest see is totally > > > > > >

KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Michael S. Tsirkin
The new KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY ioctls have been merged for 2.6.30. However, I note that PCI spec allows devices to support multiple vectors with MSI as well (support will be in linux 2.6.30). Even though qemu for now only uses a single vector with MSI, it would seem t

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-05-05 Thread Marcelo Tosatti
On Tue, May 05, 2009 at 01:34:50PM +0300, Michael S. Tsirkin wrote: > On Tue, May 05, 2009 at 07:19:45AM -0300, Marcelo Tosatti wrote: > > On Tue, May 05, 2009 at 12:51:36PM +0300, Michael S. Tsirkin wrote: > > > On Mon, Apr 27, 2009 at 10:30:17PM +0800, Sheng Yang wrote: > > > > > > > > If guest c

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-05-05 Thread Michael S. Tsirkin
On Tue, May 05, 2009 at 07:19:45AM -0300, Marcelo Tosatti wrote: > On Tue, May 05, 2009 at 12:51:36PM +0300, Michael S. Tsirkin wrote: > > On Mon, Apr 27, 2009 at 10:30:17PM +0800, Sheng Yang wrote: > > > > > > > If guest can write to the real device MSI-X table directly, it > > > > > > > would >

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Marcelo Tosatti
On Tue, May 05, 2009 at 01:30:28PM +0300, Michael S. Tsirkin wrote: > The new KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY ioctls have > been merged for 2.6.30. However, I note that PCI spec allows devices to > support multiple vectors with MSI as well (support will be in linux > 2.6.30). >

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Michael S. Tsirkin
On Tue, May 05, 2009 at 08:04:15AM -0300, Marcelo Tosatti wrote: > On Tue, May 05, 2009 at 01:30:28PM +0300, Michael S. Tsirkin wrote: > > The new KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY ioctls have > > been merged for 2.6.30. However, I note that PCI spec allows devices to > > support

Re: KVM x86_64 with SR-IOV..? (device passthrough with LIO-Target v3.0)

2009-05-05 Thread Nicholas A. Bellinger
On Tue, 2009-05-05 at 03:43 -0700, Nicholas A. Bellinger wrote: > On Tue, 2009-05-05 at 09:42 +0800, Yu Zhao wrote: > > Hi, > > > > The VF also works in the host if the VF driver is programed properly. > > So it would be easier to develop the VF driver in the host and then > > verify the VF driver

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Gregory Haskins
Michael S. Tsirkin wrote: > The new KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY ioctls have > been merged for 2.6.30. However, I note that PCI spec allows devices to > support multiple vectors with MSI as well (support will be in linux > 2.6.30). > > Even though qemu for now only uses a si

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-05-05 Thread Michael S. Tsirkin
On Tue, May 05, 2009 at 07:49:10AM -0300, Marcelo Tosatti wrote: > On Tue, May 05, 2009 at 01:34:50PM +0300, Michael S. Tsirkin wrote: > > On Tue, May 05, 2009 at 07:19:45AM -0300, Marcelo Tosatti wrote: > > > On Tue, May 05, 2009 at 12:51:36PM +0300, Michael S. Tsirkin wrote: > > > > On Mon, Apr 2

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-05-05 Thread Marcelo Tosatti
On Tue, May 05, 2009 at 02:45:38PM +0300, Michael S. Tsirkin wrote: > On Tue, May 05, 2009 at 07:49:10AM -0300, Marcelo Tosatti wrote: > > On Tue, May 05, 2009 at 01:34:50PM +0300, Michael S. Tsirkin wrote: > > > On Tue, May 05, 2009 at 07:19:45AM -0300, Marcelo Tosatti wrote: > > > > On Tue, May 0

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Avi Kivity
Michael S. Tsirkin wrote: On Tue, May 05, 2009 at 08:04:15AM -0300, Marcelo Tosatti wrote: On Tue, May 05, 2009 at 01:30:28PM +0300, Michael S. Tsirkin wrote: The new KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY ioctls have been merged for 2.6.30. However, I note that PCI spec a

[PATCH] kvm: fix comment on locking

2009-05-05 Thread Michael S. Tsirkin
__kvm_set_memory_region callers must (and do) take slots_lock, not mmap_sem, for write. Fix the comment to match this reality. Signed-off-by: Michael S. Tsirkin --- virt/kvm/kvm_main.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_ma

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Michael S. Tsirkin
On Tue, May 05, 2009 at 02:57:10PM +0300, Avi Kivity wrote: > Michael S. Tsirkin wrote: >> On Tue, May 05, 2009 at 08:04:15AM -0300, Marcelo Tosatti wrote: >> >>> On Tue, May 05, 2009 at 01:30:28PM +0300, Michael S. Tsirkin wrote: >>> The new KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_M

[ kvm-Bugs-2787205 ] Video: KVM graphics performance dropped

2009-05-05 Thread SourceForge.net
Bugs item #2787205, was opened at 2009-05-05 15:02 Message generated for change (Tracker Item Submitted) made by technologov You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2787205&group_id=180599 Please note that this message will contain a full copy of

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Avi Kivity
Michael S. Tsirkin wrote: On Tue, May 05, 2009 at 02:57:10PM +0300, Avi Kivity wrote: Michael S. Tsirkin wrote: On Tue, May 05, 2009 at 08:04:15AM -0300, Marcelo Tosatti wrote: On Tue, May 05, 2009 at 01:30:28PM +0300, Michael S. Tsirkin wrote: The new KVM_ASSI

Re: Paravirtualisation or not?

2009-05-05 Thread Javier Guerra
Pantelis Koukousoulas wrote: > On Tue, May 5, 2009 at 11:37 AM, Stefan Hajnoczi wrote: > Sure, closed-source virtio-net drivers exist (in fact there is a newer > version than the one > you linked. I think it is 12/2008 distributed as an iso). The point > (and the advantage > of Xen in this area) i

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Michael S. Tsirkin
On Tue, May 05, 2009 at 03:08:40PM +0300, Avi Kivity wrote: > Michael S. Tsirkin wrote: >> On Tue, May 05, 2009 at 02:57:10PM +0300, Avi Kivity wrote: >> >>> Michael S. Tsirkin wrote: >>> On Tue, May 05, 2009 at 08:04:15AM -0300, Marcelo Tosatti wrote: > On Tue, May 0

[PATCH] Serialize qcow2 writes

2009-05-05 Thread Avi Kivity
Commit 641636d ("qcow2 corruption: Fix alloc_cluster_link_l2"; 4df8f71 on stable-0.10) exposes a bug with concurrent allocating qcow2 writes: the writes will trigger a call to free_any_clusters() and corrupt the image. As a temporary workaround until a real fix is written, this patch serializes wr

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-05-05 Thread Michael S. Tsirkin
On Tue, May 05, 2009 at 07:49:10AM -0300, Marcelo Tosatti wrote: > On Tue, May 05, 2009 at 01:34:50PM +0300, Michael S. Tsirkin wrote: > > On Tue, May 05, 2009 at 07:19:45AM -0300, Marcelo Tosatti wrote: > > > On Tue, May 05, 2009 at 12:51:36PM +0300, Michael S. Tsirkin wrote: > > > > On Mon, Apr 2

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Michael S. Tsirkin
On Tue, May 05, 2009 at 03:08:40PM +0300, Avi Kivity wrote: > Michael S. Tsirkin wrote: >> On Tue, May 05, 2009 at 02:57:10PM +0300, Avi Kivity wrote: >> >>> Michael S. Tsirkin wrote: >>> On Tue, May 05, 2009 at 08:04:15AM -0300, Marcelo Tosatti wrote: > On Tue, May 0

[RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Gregory Haskins
(Applies to Linus' tree, b4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a) Please see patch 1/3 for a description. This has been tested with a KVM guest on x86_64 and appears to work properly. Comments, please. -Greg --- Gregory Haskins (3): kvm: add pv_cpu_ops.hypercall support to the guest

[RFC PATCH 1/3] add generic hypercall support

2009-05-05 Thread Gregory Haskins
We add a generic hypercall() mechanism for use by IO code which is compatible with a variety of hypervisors, but which prefers to use hypercalls over other types of hypervisor traps for performance and/or feature reasons. For instance, consider an emulated PCI device in KVM. Today we can chose to

[RFC PATCH 3/3] kvm: add pv_cpu_ops.hypercall support to the guest

2009-05-05 Thread Gregory Haskins
Signed-off-by: Gregory Haskins --- arch/x86/kernel/kvm.c | 22 ++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c index 33019dd..d299ed5 100644 --- a/arch/x86/kernel/kvm.c +++ b/arch/x86/kernel/kvm.c @@ -50,6 +50

[RFC PATCH 2/3] x86: add generic hypercall support

2009-05-05 Thread Gregory Haskins
This adds a hypercall() vector to x86 pv_cpu_ops to be optionally filled in by a hypervisor driver as it loads its other pv_ops components. We also declare x86 as CONFIG_HAVE_HYPERCALL to enable the generic hypercall code whenever the user builds for x86. Signed-off-by: Gregory Haskins --- arc

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Avi Kivity
Michael S. Tsirkin wrote: Works for me. Sheng, is there a reason why it wasn't done like this? btw, it could be further simplified by using irqfd. Instead of the host device tying directly into kvm, it could just trigger an eventfd; and we could terminate the eventfd either in kvm (irqfd)

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Avi Kivity
Gregory Haskins wrote: (Applies to Linus' tree, b4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a) Please see patch 1/3 for a description. This has been tested with a KVM guest on x86_64 and appears to work properly. Comments, please. What about the hypercalls in include/asm/kvm_para.h? In genera

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Gregory Haskins
Avi Kivity wrote: > Gregory Haskins wrote: >> (Applies to Linus' tree, b4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a) >> >> Please see patch 1/3 for a description. This has been tested with a KVM >> guest on x86_64 and appears to work properly. Comments, please. >> > > What about the hypercalls in

Re: [PATCH] deal with interrupt shadow state for emulated instruction

2009-05-05 Thread Glauber Costa
> Hmm, if the guest runs an infinite emulated 'mov ss', it will keep > toggling the MOV_SS bit, but STI will remain set, so we'll never allow > an interrupt into the guest kernel. We have no choice but returning both flags, since svm does not differentiate between them. But see below for an al

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Avi Kivity
Gregory Haskins wrote: Avi Kivity wrote: Gregory Haskins wrote: (Applies to Linus' tree, b4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a) Please see patch 1/3 for a description. This has been tested with a KVM guest on x86_64 and appears to work properly. Comments, please. What a

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Gregory Haskins
Avi Kivity wrote: > Gregory Haskins wrote: >> Avi Kivity wrote: >> >>> Gregory Haskins wrote: >>> (Applies to Linus' tree, b4348f32dae3cb6eb4bc21c7ed8f76c0b11e9d6a) Please see patch 1/3 for a description. This has been tested with a KVM guest on x86_64 and appears to

Re: [KVM PATCH v4 0/2] irqfd

2009-05-05 Thread Davide Libenzi
On Mon, 4 May 2009, Gregory Haskins wrote: > (Applies to kvm.git:7da2e3ba, plus you will also need Davide Libenzi's > eventfd_file_create() patch, which you can find here: > > http://www.mail-archive.com/kvm@vger.kernel.org/msg13923.html Ping me back if Al acks the irqfd thing, that I'll take a

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Gregory Haskins
Gregory Haskins wrote: > So rather than allocate a top-level vector, I will add "KVM_HC_DYNAMIC" > to kvm_para.h, and I will change the interface to follow suit (something > like s/hypercall/dynhc). Sound good? > A small ramification of this change will be that I will need to do something like

Re: [KVM PATCH v4 0/2] irqfd

2009-05-05 Thread Gregory Haskins
Davide Libenzi wrote: > On Mon, 4 May 2009, Gregory Haskins wrote: > > >> (Applies to kvm.git:7da2e3ba, plus you will also need Davide Libenzi's >> eventfd_file_create() patch, which you can find here: >> >> http://www.mail-archive.com/kvm@vger.kernel.org/msg13923.html >> > > Ping me back i

[PATCH 0/6] kvm-s390: collection of kvm-s390 fixes

2009-05-05 Thread ehrhardt
From: Christian Ehrhardt This is a collection of fixes for kvm-s390 that originate from several tests made in the last few months. They are now tested a while and should be ready to be merged. All six patches are created either by Carsten Otte or Christain Borntraeger. I'm just the one stumbling

[PATCH 3/6] kvm-s390: optimize float int lock: spin_lock_bh --> spin_lock

2009-05-05 Thread ehrhardt
From: Christian Borntraeger The floating interrupt lock is only taken in process context. We can replace all spin_lock_bh with standard spin_lock calls. Signed-off-by: Christian Borntraeger --- arch/s390/kvm/interrupt.c | 20 ++-- arch/s390/kvm/kvm-s390.c |4 ++-- arch/s

[PATCH 1/6] kvm-s390: Fix memory slot versus run

2009-05-05 Thread ehrhardt
From: Carsten Otte This patch fixes an incorrectness in the kvm backend for s390. In case virtual cpus are being created before the corresponding memory slot is being registered, we need to update the sie control blocks for the virtual cpus. In order to do that, we use the vcpu->mutex to lock out

[PATCH 2/6] kvm-s390: use hrtimer for clock wakeup from idle

2009-05-05 Thread ehrhardt
From: Christian Borntraeger This patch reworks the s390 clock comparator wakeup to hrtimer. The clock comparator is a per-cpu value that is compared against the TOD clock. If ckc <= TOD an external interrupt 1004 is triggered. Since the clock comparator and the TOD clock have a much higher resolu

[PATCH 5/6] kvm-s390: Sanity check on validity intercept

2009-05-05 Thread ehrhardt
From: Carsten Otte This patch adds a sanity check for the content of the guest prefix register content before faulting in the cpu lowcore that it refers to. The guest might end up in an endless loop where SIE complains about missing lowcore with incorrect content of the prefix register without th

[PATCH 4/6] kvm-s390: Unlink vcpu on destroy

2009-05-05 Thread ehrhardt
From: Carsten Otte This patch makes sure we do unlink a vcpu's sie control block from the system control area in kvm_arch_vcpu_destroy. This prevents illegal accesses to the sie control block from other virtual cpus after free. Reported-by: Mijo Safradin Signed-off-by: Carsten Otte --- arch/s

[PATCH 6/6] kvm-s390: Verify memory in kvm run

2009-05-05 Thread ehrhardt
From: Carsten Otte This check verifies that the guest we're trying to run in KVM_RUN has some memory assigned to it. It enters an endless exception loop if this is not the case. Reported-by: Mijo Safradin Signed-off-by: Carsten Otte --- arch/s390/kvm/kvm-s390.c |6 ++ 1 file changed,

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Avi Kivity
Gregory Haskins wrote: I see. I had designed it slightly different where KVM could assign any top level vector it wanted and thus that drove the guest-side interface you see here to be more "generic hypercall". However, I think your proposal is perfectly fine too and it makes sense to more narr

Re: [KVM PATCH v4 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-05 Thread Avi Kivity
Gregory Haskins wrote: KVM provides a complete virtual system environment for guests, including support for injecting interrupts modeled after the real exception/interrupt facilities present on the native platform (such as the IDT on x86). Virtual interrupts can come from a variety of sources (em

Re: [Qemu-devel] Re: Question about KVM and PC speaker

2009-05-05 Thread Simon Bienlein
Hello Jan, Am 04.05.2009 23:00, schrieb Jan Kiszka: Samuel Thibault wrote: Jan Kiszka, le Mon 04 May 2009 22:29:39 +0200, a écrit : When I boot the VM from the Lenny CD, there is no audible signal tone. Hmm, I successfully tested with '-soundbw pcspk' + my patches or -no-kvm-pit. There is

Re: [RFC PATCH 1/3] add generic hypercall support

2009-05-05 Thread Hollis Blanchard
On Tue, 2009-05-05 at 09:24 -0400, Gregory Haskins wrote: > > *) PIO is more direct than MMIO, but it poses other problems such as: > a) can have a small limited address space (x86 is 2^16) > b) is a narrow-band interface (one 8, 16, 32, 64 bit word at a time) > c) not available

Re: [PATCH 1/4] BIOS changes for configuring irq0->inti2 override

2009-05-05 Thread Beth Kon
Beth Kon wrote: These patches resolve the irq0->inti2 override issue, and get the hpet working on kvm. I've found a problem with these patches. I'll resubmit shortly. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More

Re: [KVM PATCH v4 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-05 Thread Gregory Haskins
Avi Kivity wrote: > Gregory Haskins wrote: >> KVM provides a complete virtual system environment for guests, including >> support for injecting interrupts modeled after the real >> exception/interrupt >> facilities present on the native platform (such as the IDT on x86). >> Virtual interrupts can c

Re: [KVM PATCH v4 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-05 Thread Avi Kivity
Gregory Haskins wrote: +struct kvm_irqfd { +__u32 gsi; +__u32 flags; +}; + Please add some reserved space here. Ack. Any rule of thumb here? How about a "__u8 pad[16]" ? I'd round it up so the whole thing is 32 bytes (not that it matters). -- Do not meddle in t

Re: KVM x86_64 with SR-IOV..? (device passthrough with LIO-Target v3.0)

2009-05-05 Thread Nicholas A. Bellinger
On Tue, 2009-05-05 at 04:28 -0700, Nicholas A. Bellinger wrote: > On Tue, 2009-05-05 at 03:43 -0700, Nicholas A. Bellinger wrote: > > On Tue, 2009-05-05 at 09:42 +0800, Yu Zhao wrote: > > > Hi, > > > > > > The VF also works in the host if the VF driver is programed properly. > > > So it would be e

Re: [KVM PATCH v4 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-05 Thread Gregory Haskins
Avi Kivity wrote: > Gregory Haskins wrote: > >> +int >> +kvm_irqfd(struct kvm *kvm, int gsi, int flags) >> +{ >> +struct _irqfd *irqfd; >> +struct file *file = NULL; >> +int fd = -1; >> +int ret; >> + >> +irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL); >> +if (!irqfd) >> +

Re: [KVM PATCH v4 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-05 Thread Avi Kivity
Gregory Haskins wrote: Avi Kivity wrote: Gregory Haskins wrote: +int +kvm_irqfd(struct kvm *kvm, int gsi, int flags) +{ +struct _irqfd *irqfd; +struct file *file = NULL; +int fd = -1; +int ret; + +irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL); +if (!irqfd) +

Re: [KVM PATCH v4 2/2] kvm: add support for irqfd via eventfd-notification interface

2009-05-05 Thread Gregory Haskins
Avi Kivity wrote: > Gregory Haskins wrote: >> Avi Kivity wrote: >> >>> Gregory Haskins wrote: >>> >>> +int +kvm_irqfd(struct kvm *kvm, int gsi, int flags) +{ +struct _irqfd *irqfd; +struct file *file = NULL; +int fd = -1; +int ret; + >>>

[PATCH] deal with interrupt shadow state for emulated instruction

2009-05-05 Thread Glauber Costa
we currently unblock shadow interrupt state when we skip an instruction, but failing to do so when we actually emulate one. This blocks interrupts in key instruction blocks, in particular sti; hlt; sequences If the instruction emulated is an sti, we have to block shadow interrupts. The same goes f

RE: [PATCH] reserved-ram for pci-passthrough without VT-d capable hardware

2009-05-05 Thread Passera, Pablo R
Andrea, Thanks for your answers. I already patched the kernel and kvm (including rombios). The host boots up and the memory mapping is as explained in the patch. Now I am trying to launch a vm using memory mapping but it hangs after opening the sdl windows and before showing the bios mes

Re: [PATCH 1/4] BIOS changes for configuring irq0->inti2 override

2009-05-05 Thread Sebastian Herbszt
Beth Kon wrote: @@ -477,6 +480,7 @@ void wrmsr_smp(uint32_t index, uint64_t val) #define QEMU_CFG_SIGNATURE 0x00 #define QEMU_CFG_ID 0x01 #define QEMU_CFG_UUID 0x02 +#define QEMU_CFG_IRQ0_OVERRIDE 0x0e Small thing to consider before you resubmit: In his patch "read-additional-acp

Re: [Qemu-devel] Re: Question about KVM and PC speaker

2009-05-05 Thread Sebastian Herbszt
Simon Bienlein wrote: Is a support for BIOS worked on right now? The vgabios (vgabios.c) has a "FIXME should beep". Volker, do you plan to fix this? Which frequency should be used for the beep? Which delay? Getting a delay using "inb(0x61) & 0x10" is still a no go on qemu, right? - Sebastian

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Chris Wright
* Gregory Haskins (gregory.hask...@gmail.com) wrote: > So you would never have someone making a generic > hypercall(KVM_HC_MMU_OP). I agree. Which is why I think the interface proposal you've made is wrong. There's already hypercall interfaces w/ specific ABI and semantic meaning (which are typi

Re: qemu/hw/device-assignment: questions about msix_table_page

2009-05-05 Thread Sheng Yang
On Tuesday 05 May 2009 20:46:04 Michael S. Tsirkin wrote: > On Tue, May 05, 2009 at 07:49:10AM -0300, Marcelo Tosatti wrote: > > On Tue, May 05, 2009 at 01:34:50PM +0300, Michael S. Tsirkin wrote: > > > On Tue, May 05, 2009 at 07:19:45AM -0300, Marcelo Tosatti wrote: > > > > On Tue, May 05, 2009 at

Re: PCI device assignment over KVM

2009-05-05 Thread Sheng Yang
On Wednesday 06 May 2009 08:42:37 Tong Liu wrote: > Hi Sheng, > > I have installed latest KVM-85 release and the "Failed to assign irq" > error goes away. > However my device kernel driver on guest OS (RHEL5u2) can't query my > card successfully. Our developer said there is memory mapping error > d

Re: KVM_ASSIGN_SET_MSIX_NR and KVM_ASSIGN_SET_MSIX_ENTRY should support MSI?

2009-05-05 Thread Sheng Yang
On Tuesday 05 May 2009 20:08:40 Avi Kivity wrote: > Michael S. Tsirkin wrote: > > On Tue, May 05, 2009 at 02:57:10PM +0300, Avi Kivity wrote: > >> Michael S. Tsirkin wrote: > >>> On Tue, May 05, 2009 at 08:04:15AM -0300, Marcelo Tosatti wrote: > On Tue, May 05, 2009 at 01:30:28PM +0300, Michae

Re: KVM x86_64 with SR-IOV..? (device passthrough with LIO-Target v3.0)

2009-05-05 Thread Sheng Yang
On Tuesday 05 May 2009 18:43:46 Nicholas A. Bellinger wrote: > On Tue, 2009-05-05 at 09:42 +0800, Yu Zhao wrote: > > Hi, > > > > The VF also works in the host if the VF driver is programed properly. > > So it would be easier to develop the VF driver in the host and then > > verify the VF driver in

[PATCH] execute kvm_init_vcpu in the end of pc_new_cpu

2009-05-05 Thread Glauber Costa
When we create a new vcpu, we need to make sure that all of the state it is going to use (apic state, for example) already exists. We can do it nicely by making sure kvm_init_vcpu is executed after everything else in cpu creation. After that, the first call to KVM_SET_LAPIC ioctl will not find an

Re: KVM x86_64 with SR-IOV..? (device passthrough with LIO-Target v3.0)

2009-05-05 Thread Sheng Yang
On Tuesday 05 May 2009 19:28:15 Nicholas A. Bellinger wrote: > On Tue, 2009-05-05 at 03:43 -0700, Nicholas A. Bellinger wrote: > > On Tue, 2009-05-05 at 09:42 +0800, Yu Zhao wrote: > > > Hi, > > > > > > The VF also works in the host if the VF driver is programed properly. > > > So it would be easie

Re: KVM x86_64 with SR-IOV..? (device passthrough with LIO-Target v3.0)

2009-05-05 Thread Sheng Yang
On Wednesday 06 May 2009 01:45:47 Nicholas A. Bellinger wrote: > On Tue, 2009-05-05 at 04:28 -0700, Nicholas A. Bellinger wrote: > > On Tue, 2009-05-05 at 03:43 -0700, Nicholas A. Bellinger wrote: > > > On Tue, 2009-05-05 at 09:42 +0800, Yu Zhao wrote: > > > > Hi, > > > > > > > > The VF also works

Re: [RFC PATCH 0/3] generic hypercall support

2009-05-05 Thread Gregory Haskins
Chris Wright wrote: > * Gregory Haskins (gregory.hask...@gmail.com) wrote: > >> So you would never have someone making a generic >> hypercall(KVM_HC_MMU_OP). I agree. >> > > Which is why I think the interface proposal you've made is wrong. I respectfully disagree. Its only wrong in that

[KVM-AUTOTEST][PATCH] timedrift support

2009-05-05 Thread Bear Yang
Hello everyone, I like to submit patch to add a new function for 'time drift check' for guest running on KVM. The TimeDrift design logic is below: 1. Set the host as the NTP server 2. Guest only sync it's clock with host *once* when it booted up. * if the offset value of ntpdate large than 1 s

Re: [patch 0/4] use smp_send_reschedule in vcpu_kick / assigned dev host intx race fix

2009-05-05 Thread Sheng Yang
On Thursday 30 April 2009 09:59:56 Sheng Yang wrote: > On Thursday 30 April 2009 08:56:57 Sheng Yang wrote: > > On Thursday 30 April 2009 01:47:57 Marcelo Tosatti wrote: > > > On Tue, Apr 28, 2009 at 03:08:46PM +0800, Sheng Yang wrote: > > > > Ack all. This also solved one bug by my hand. Thanks! >

Re: [PATCH 3/9] Remove irq_pending bitmap

2009-05-05 Thread Sheng Yang
On Tuesday 05 May 2009 16:14:29 Gleb Natapov wrote: > Only one interrupt vector can be injected from userspace irqchip at > any given time so no need to store it in a bitmap. Put it into interrupt > queue directly. > > Signed-off-by: Gleb Natapov > --- > arch/x86/include/asm/kvm_host.h |2 --

Re: [PATCH 3/9] Remove irq_pending bitmap

2009-05-05 Thread Sheng Yang
On Wednesday 06 May 2009 13:55:44 Sheng Yang wrote: > On Tuesday 05 May 2009 16:14:29 Gleb Natapov wrote: > > Only one interrupt vector can be injected from userspace irqchip at > > any given time so no need to store it in a bitmap. Put it into interrupt > > queue directly. > > > > Signed-off-by: G

Re: [PATCH 5/9] [VMX] Do not re-execute INTn instruction.

2009-05-05 Thread Sheng Yang
On Tuesday 05 May 2009 16:14:31 Gleb Natapov wrote: > Re-inject event instead. This is what Intel suggest. Also use correct > instruction length when re-injecting soft fault/interrupt. Thanks for fixing this! > Signed-off-by: Gleb Natapov > --- > arch/x86/include/asm/kvm_host.h |5 - >