Re: [kvm-devel] [PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly

2008-05-08 Thread Rusty Russell
On Thursday 08 May 2008 23:20:38 Christian Borntraeger wrote: > Changing stop_machine to yield the cpu to the hypervisor when yielding > inside the guest fixed the problem for me. While I am not completely happy > with this patch, I think it causes no harm and it really improves the > situation for

Re: [kvm-devel] [PATCH] qemu-kvm: fix guest resetting

2008-05-08 Thread Marcelo Tosatti
Hi Jan, On Thu, May 08, 2008 at 10:29:32AM +0200, Jan Kiszka wrote: > Resetting guests used to be racy, deadlock-prone, or simply broken (for > SMP). This patch fixes the issues - at least for me on x86 (tested on > Intel SMP host, UP and SMP guest, in-kernel und user space irqchip, > guest- and m

Re: [kvm-devel] [PATCH 0/4] paravirt clock patches

2008-05-08 Thread Marcelo Tosatti
On Wed, May 07, 2008 at 08:45:12PM +0200, Gerd Hoffmann wrote: > Ok folks, here is the band aid fix for testing from the odd bugs > department. Goes on top of the four patches of this series. A real, > clean solution is TBD. Tomorrow I hope (some urgent private problems > are in the queue too ..

[kvm-devel] KVM: kvm_vcpu_block task state race

2008-05-08 Thread Marcelo Tosatti
There's still a race in kvm_vcpu_block(), if a wake_up_interruptible() call happens before the task state is set to TASK_INTERRUPTIBLE: CPU0CPU1 kvm_vcpu_block add_wait_queue kvm_cpu_has_interrupt = 0

Re: [kvm-devel] qemu/kvm: support for pci passthrough

2008-05-08 Thread Anthony Liguori
Dor Laor wrote: > On Thu, 2008-05-08 at 12:03 +0200, Nicolas Daneau wrote: >> Hi, >> >> I saw there was an active discussion about pci passthrough support in >> KVM. I'm not a Dev, only a sys admin that need this support. As i saw >> on the KVM home page that this feature is plan for 2H2008 in the

Re: [kvm-devel] [PATCH 08 of 11] anon-vma-rwsem

2008-05-08 Thread Andrea Arcangeli
On Thu, May 08, 2008 at 09:11:33AM -0700, Linus Torvalds wrote: > Btw, this is an issue only on 32-bit x86, because on 64-bit one we already > have the padding due to the alignment of the 64-bit pointers in the > list_head (so there's already empty space there). > > On 32-bit, the alignment of l

[kvm-devel] [PATCH 1/3] Virtio save/restore support (v2)

2008-05-08 Thread Anthony Liguori
This patch implements the core of save/restore support for virtio. It's modelled after how PCI save/restore works. N.B. This makes savevm/loadvm work, but not live migration. The issue with live migration is that we're manipulating guest memory without updating the dirty bitmap correctly. I wil

[kvm-devel] [PATCH 1/3] Virtio save/restore support

2008-05-08 Thread Anthony Liguori
This patch implements the core of save/restore support for virtio. It's modelled after how PCI save/restore works. N.B. This makes savevm/loadvm work, but not live migration. The issue with live migration is that we're manipulating guest memory without updating the dirty bitmap correctly. I wil

[kvm-devel] [PATCH 3/3] virtio-blk save/restore support

2008-05-08 Thread Anthony Liguori
No additional state needs to be saved. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-blk.c b/qemu/hw/virtio-blk.c index 048285a..148cb75 100644 --- a/qemu/hw/virtio-blk.c +++ b/qemu/hw/virtio-blk.c @@ -162,11 +162,30 @@ static uint32_t virtio_blk_get_features(Virt

[kvm-devel] [PATCH 2/3] virtio-net save/restore support

2008-05-08 Thread Anthony Liguori
The only interesting bit here is that we have to ensure that we rearm the timer if necessary. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index d15c2f4..5fe66ac 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@ -207,9 +

Re: [kvm-devel] [PATCH] Fix e1000 can_receive handler

2008-05-08 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >> Aurelien Jarno wrote: >>> On Wed, May 07, 2008 at 04:40:58PM -0500, Anthony Liguori wrote: >>> The current logic of the can_receive handler is to allow packets whenever the receiver is disabled or when there are descriptors available i

Re: [kvm-devel] [PATCH] Fix e1000 can_receive handler

2008-05-08 Thread Avi Kivity
Avi Kivity wrote: > > Note that flow control still makes sense since it allows us to buffer > some packets if the guest is scheduled out. But we can't use it as > the primary mechanism since it won't exist with multiqueue NICs (where > the virtio descriptors are fed to driver). > ... are fed t

Re: [kvm-devel] [PATCH 1/6] Add support for eventfd() (v3)

2008-05-08 Thread Avi Kivity
Anthony Liguori wrote: > This patch adds compatibility code so that we can make use of eventfd() within > QEMU. eventfd() is a pretty useful mechanism as it allows multiple > notifications to be batched in a single system call. > > We emulate eventfd() using a standard pipe(). > Applied all si

Re: [kvm-devel] [PATCH] Fix e1000 can_receive handler

2008-05-08 Thread Avi Kivity
Anthony Liguori wrote: > Aurelien Jarno wrote: >> On Wed, May 07, 2008 at 04:40:58PM -0500, Anthony Liguori wrote: >> >>> The current logic of the can_receive handler is to allow packets >>> whenever the >>> receiver is disabled or when there are descriptors available in the >>> ring. >>> >>> I

Re: [kvm-devel] [PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly

2008-05-08 Thread Christian Borntraeger
Am Donnerstag, 8. Mai 2008 schrieb Jeremy Fitzhardinge: > > Sorry, forgot to mention. Its kvm.git from 2 days ago on s390. > > > > And on s390 cpu_relax yields the vcpu? That's not common behaviour > across architectures. Yes, cpu_relax on s390 calls diagnose 44. Diagnose 44 translates to y

[kvm-devel] Guest crashes with 068 user-space, works with 066

2008-05-08 Thread Damjan
Strange situation, I have a Ubuntu JeOS image that crashes with this error when started by the kvm-068 user-space. Bellow is the trace from the kernel... The same image, works with: - kvm-066 user space, kvm-068 kernel module (on 2.6.24 and 2.6.25) - kvm-066 user space, vanilla kernel module (fro

Re: [kvm-devel] [PATCH 08 of 11] anon-vma-rwsem

2008-05-08 Thread Linus Torvalds
On Thu, 8 May 2008, Linus Torvalds wrote: > > Also, we'd need to make it > > unsigned short flag:1; > > _and_ change spinlock_types.h to make the spinlock size actually match the > required size (right now we make it an "unsigned int slock" even when we > actually only use 16 bits).

Re: [kvm-devel] [RFC][PATCH 0/4] Enabled NMI support for KVM

2008-05-08 Thread Jan Kiszka
Jan Kiszka wrote: > Yang, Sheng wrote: >> Hi >> >> This patchset enabled NMI support for KVM. >> >> The first three patches enabled NMI for in-kernel irqchip and NMI supporting >> on VMX. The last patch enabled NMI watchdog in linux, can be used to test >> the >> NMI injection. >> >> In fact, th

Re: [kvm-devel] [PATCH 08 of 11] anon-vma-rwsem

2008-05-08 Thread Linus Torvalds
On Thu, 8 May 2008, Andrea Arcangeli wrote: > > Actually I looked both at the struct and at the slab alignment just in > case it was changed recently. Now after reading your mail I also > compiled it just in case. Put the flag after the spinlock, not after the "list_head". Also, we'd need to m

Re: [kvm-devel] [PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly

2008-05-08 Thread Jeremy Fitzhardinge
Christian Borntraeger wrote: > I really like 64 guest cpus as a good testcase for all kind of things. > Sure, I do the same kind of thing. >> I think x86 (at least) is now using ticket locks, which is fair. Which >> kernel are you seeing this problem on? >> > > Sorry, forgot to mention

Re: [kvm-devel] [PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly

2008-05-08 Thread Christian Borntraeger
Am Donnerstag, 8. Mai 2008 schrieb Jeremy Fitzhardinge: > Christian Borntraeger wrote: > > On kvm I have seen some rare hangs in stop_machine when I used more guest > > cpus than hosts cpus. e.g. 32 guest cpus on 1 host cpu triggered the > > hang quite often. I could also reproduce the problem on a

Re: [kvm-devel] QEMU "drive_init()" Disk Format Security Bypass

2008-05-08 Thread Daniel P. Berrange
On Thu, May 08, 2008 at 05:02:28PM +0300, Eren T?rkay wrote: > Hello, > > An advisory about $subject was released today by secunia. The security flaw > was fixed in QEmu SVN repository. > > Kvm uses some of the old version of qemu that I can't backport patch I > grabbed > from qemu svn reposit

Re: [kvm-devel] QEMU "drive_init()" Disk Format Security Bypass

2008-05-08 Thread Eren Türkay
On 08 May 2008 Thu 17:12:14 Daniel P. Berrange wrote: > If you look at the KVM userspace code you'll see this patch is already > included: > > http://git.kernel.org/?p=virt/kvm/kvm-userspace.git;a=commit;h=ce486fc1116e >b53d40635be926bfa147ad520908 Thank you, I'll grab the patch and apply it to ta

Re: [kvm-devel] [PATCH] Fix e1000 can_receive handler

2008-05-08 Thread Anthony Liguori
Aurelien Jarno wrote: > On Wed, May 07, 2008 at 04:40:58PM -0500, Anthony Liguori wrote: > >> The current logic of the can_receive handler is to allow packets whenever the >> receiver is disabled or when there are descriptors available in the ring. >> >> I think the logic ought to be to allow pa

[kvm-devel] QEMU "drive_init()" Disk Format Security Bypass

2008-05-08 Thread Eren Türkay
Hello, An advisory about $subject was released today by secunia. The security flaw was fixed in QEmu SVN repository. Kvm uses some of the old version of qemu that I can't backport patch I grabbed from qemu svn repository. Could you look at this issue and provide a patch? http://secunia.com/adv

Re: [kvm-devel] [PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly

2008-05-08 Thread Jeremy Fitzhardinge
Christian Borntraeger wrote: > On kvm I have seen some rare hangs in stop_machine when I used more guest > cpus than hosts cpus. e.g. 32 guest cpus on 1 host cpu triggered the > hang quite often. I could also reproduce the problem on a 4 way z/VM host > with > a 64 way guest. > I think that's

Re: [kvm-devel] [PATCH] Fix e1000 can_receive handler

2008-05-08 Thread Aurelien Jarno
On Wed, May 07, 2008 at 04:40:58PM -0500, Anthony Liguori wrote: > The current logic of the can_receive handler is to allow packets whenever the > receiver is disabled or when there are descriptors available in the ring. > > I think the logic ought to be to allow packets whenever the receiver is

[kvm-devel] [PATCH/RFC] stop_machine: make stop_machine_run more virtualization friendly

2008-05-08 Thread Christian Borntraeger
On kvm I have seen some rare hangs in stop_machine when I used more guest cpus than hosts cpus. e.g. 32 guest cpus on 1 host cpu triggered the hang quite often. I could also reproduce the problem on a 4 way z/VM host with a 64 way guest. It turned out that the guest was consuming all available cp

Re: [kvm-devel] [PATCH 04 of 11] free-pgtables

2008-05-08 Thread Rik van Riel
On Wed, 07 May 2008 16:35:54 +0200 Andrea Arcangeli <[EMAIL PROTECTED]> wrote: > Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]> > Signed-off-by: Andrea Arcangeli <[EMAIL PROTECTED]> Acked-by: Rik van Riel <[EMAIL PROTECTED]> -- All rights reversed. ---

Re: [kvm-devel] [PATCH 05 of 11] unmap vmas tlb flushing

2008-05-08 Thread Rik van Riel
On Wed, 07 May 2008 16:35:55 +0200 Andrea Arcangeli <[EMAIL PROTECTED]> wrote: > Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]> > Signed-off-by: Andrea Arcangeli <[EMAIL PROTECTED]> Acked-by: Rik van Riel <[EMAIL PROTECTED]> -- All rights reversed. ---

Re: [kvm-devel] [PATCH 03 of 11] invalidate_page outside PT lock

2008-05-08 Thread Rik van Riel
On Wed, 07 May 2008 16:35:53 +0200 Andrea Arcangeli <[EMAIL PROTECTED]> wrote: > # HG changeset patch > # User Andrea Arcangeli <[EMAIL PROTECTED]> > # Date 1210115129 -7200 > # Node ID d60d200565abde6a8ed45271e53cde9c5c75b426 > # Parent c5badbefeee07518d9d1acca13e94c981420317c > invalidate_page

Re: [kvm-devel] [PATCH 01 of 11] mmu-notifier-core

2008-05-08 Thread Rik van Riel
On Wed, 07 May 2008 16:35:51 +0200 Andrea Arcangeli <[EMAIL PROTECTED]> wrote: > Signed-off-by: Andrea Arcangeli <[EMAIL PROTECTED]> > Signed-off-by: Nick Piggin <[EMAIL PROTECTED]> > Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]> Acked-by: Rik van Riel <[EMAIL PROTECTED]> -- All rights r

[kvm-devel] [PATCH 4/4] kvm/guest: fix paravirt clocksource to be compartible with xen.

2008-05-08 Thread Gerd Hoffmann
This patch switches the kvm clocksource code over to use the paravirt clock helpers, thereby making it compatible with xen. Signed-off-by: Gerd Hoffmann <[EMAIL PROTECTED]> --- arch/x86/Kconfig |1 + arch/x86/kernel/kvmclock.c | 84 --- 2 fi

[kvm-devel] [PATCH 2/4] Make xen use the generic paravirt clocksource code.

2008-05-08 Thread Gerd Hoffmann
This patch switches the xen paravirt clock over to use the generic paravirt clock code. Cc: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Signed-off-by: Gerd Hoffmann <[EMAIL PROTECTED]> --- arch/x86/xen/Kconfig |1 + arch/x86/xen/time.c | 110 +- 2

[kvm-devel] [PATCH 3/4] kvm/host: fix paravirt clocksource to be compatible with xen.

2008-05-08 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <[EMAIL PROTECTED]> --- arch/x86/kvm/x86.c | 63 +++ 1 files changed, 53 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 979f983..6906d54 100644 --- a/arch/x86/kvm/x86.c +++ b

[kvm-devel] [PATCH 0/4] paravirt clock series.

2008-05-08 Thread Gerd Hoffmann
Respin of the paravirt clock patch series. On the host side the kvm paravirt clock is made compatible with the xen clock. On the guest side some xen code has been factored out into a separate source file shared by both kvm and xen clock implementations. This time it should work ok for kvm smp gu

[kvm-devel] [PATCH 1/4] Add helper functions for paravirtual clocksources.

2008-05-08 Thread Gerd Hoffmann
The helper functions are intended to be used by both xen and kvm paravirtual clock sources. Following patches of this series put them into use. They are based on the xen code. Cc: Jeremy Fitzhardinge <[EMAIL PROTECTED]> Signed-off-by: Gerd Hoffmann <[EMAIL PROTECTED]> --- arch/x86/Kconfig

Re: [kvm-devel] [RFC][PATCH 0/4] Enabled NMI support for KVM

2008-05-08 Thread Jan Kiszka
Yang, Sheng wrote: > Hi > > This patchset enabled NMI support for KVM. > > The first three patches enabled NMI for in-kernel irqchip and NMI supporting > on VMX. The last patch enabled NMI watchdog in linux, can be used to test the > NMI injection. > > In fact, this series should also included

[kvm-devel] stock ubuntu 8.04 amd64 network instability (kernel oops included)

2008-05-08 Thread Paolo Losi
FYI. Please review it at: https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/228163 Regards Paolo - This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time

[kvm-devel] [RFC][PATCH 2/4] KVM: IOAPIC/LAPIC: Enable NMI support

2008-05-08 Thread Yang, Sheng
From 3a5e332c32a2ec585447505e2503d91cf2fb2a54 Mon Sep 17 00:00:00 2001 From: Sheng Yang <[EMAIL PROTECTED]> Date: Tue, 1 Apr 2008 14:47:59 +0800 Subject: [PATCH 2/4] KVM: IOAPIC/LAPIC: Enable NMI support Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/lapic.c |3 ++- arc

[kvm-devel] [RFC][PATCH 1/4] KVM: LAPIC: Unified the duplicate calling of setting IRR

2008-05-08 Thread Yang, Sheng
From 650cad44069541fcd9fea8be6a78837e812b3dfd Mon Sep 17 00:00:00 2001 From: Sheng Yang <[EMAIL PROTECTED]> Date: Thu, 8 May 2008 09:58:50 +0800 Subject: [PATCH 1/4] KVM: LAPIC: Unified the duplicate calling of setting IRR It's strange got two callings of setting IRR seperately for IOAPIC and IPI

[kvm-devel] [RFC][PATCH 4/4] KVM: Enable NMI Watchdog by PIT source

2008-05-08 Thread Yang, Sheng
From 176a066e5fd0d98cb63e910c93d57f7ec2850105 Mon Sep 17 00:00:00 2001 From: Sheng Yang <[EMAIL PROTECTED]> Date: Thu, 8 May 2008 16:00:59 +0800 Subject: [PATCH 4/4] KVM: Enable NMI Watchdog by PIT source The NMI watchdog used LINT0 of LAPIC to deliver NMI. It didn't disable PIC after switch to I

[kvm-devel] [RFC][PATCH 3/4] KVM: VMX: Enable NMI with in-kernel irqchip

2008-05-08 Thread Yang, Sheng
From 4942a5c35c97e5edb6fe1303e04fb86f25cac345 Mon Sep 17 00:00:00 2001 From: Sheng Yang <[EMAIL PROTECTED]> Date: Thu, 8 May 2008 16:00:57 +0800 Subject: [PATCH 3/4] KVM: VMX: Enable NMI with in-kernel irqchip Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.c | 133 +

[kvm-devel] [RFC][PATCH 0/4] Enabled NMI support for KVM

2008-05-08 Thread Yang, Sheng
Hi This patchset enabled NMI support for KVM. The first three patches enabled NMI for in-kernel irqchip and NMI supporting on VMX. The last patch enabled NMI watchdog in linux, can be used to test the NMI injection. In fact, this series should also included Jan Kiszka's patch to enable NMI for

[kvm-devel] [PATCH] qemu-kvm: fix monitor and gdbstub deadlocks

2008-05-08 Thread Jan Kiszka
Some monitor commands as well as the vm_stop() issued by the gdbstub on external interruption so far deadlock on some vcpu locks in the kernel. Patch below resolve the issue by temporarily or permanently stopping all vcpu threads before issuing the related KVM IOCTLs. Among other things, this patc

[kvm-devel] [PATCH] qemu-kvm: fix guest resetting

2008-05-08 Thread Jan Kiszka
Resetting guests used to be racy, deadlock-prone, or simply broken (for SMP). This patch fixes the issues - at least for me on x86 (tested on Intel SMP host, UP and SMP guest, in-kernel und user space irqchip, guest- and monitor-issued resets). Note that ia64 and powerpc may need to look into the S