Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-19 Thread Gleb Natapov
On Sun, Apr 19, 2009 at 05:06:29PM +0200, Jan Kiszka wrote: > Jan Kiszka wrote: > > Gleb Natapov wrote: > >> On Sat, Apr 18, 2009 at 07:28:20PM +0300, Gleb Natapov wrote: > So this patch may either expose a bug in the svm emulation of qemu or > comes with a subtle regression that only tri

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-19 Thread Jan Kiszka
Jan Kiszka wrote: > Gleb Natapov wrote: >> On Sat, Apr 18, 2009 at 07:28:20PM +0300, Gleb Natapov wrote: So this patch may either expose a bug in the svm emulation of qemu or comes with a subtle regression that only triggers due to qemu's timing. This needs to be understood. Gleb, an

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-19 Thread Gleb Natapov
On Sun, Apr 19, 2009 at 04:05:21PM +0200, Jan Kiszka wrote: > > And this is not the only problem I saw, but the one that caused my guest > > to hang. > > OK, good to know. I added Alex (though he's said to be on vacation ATM) > and qemu to CC. Maybe you can quickly list the other issues you've > s

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-19 Thread Jan Kiszka
Gleb Natapov wrote: > On Sat, Apr 18, 2009 at 07:28:20PM +0300, Gleb Natapov wrote: >>> So this patch may either expose a bug in the svm emulation of qemu or >>> comes with a subtle regression that only triggers due to qemu's timing. >>> This needs to be understood. Gleb, any progress on reproducin

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-19 Thread Gleb Natapov
On Sat, Apr 18, 2009 at 07:28:20PM +0300, Gleb Natapov wrote: > > > > So this patch may either expose a bug in the svm emulation of qemu or > > comes with a subtle regression that only triggers due to qemu's timing. > > This needs to be understood. Gleb, any progress on reproducing it on > > your

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-19 Thread Avi Kivity
Jan Kiszka wrote: - - if (!npt_enabled && event_injection) - kvm_mmu_unprotect_page_virt(&svm->vcpu, fault_address); + else { + if (svm->vcpu.arch.interrupt.pending || + svm->vcpu.arch.exception.pending) +

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-18 Thread Gleb Natapov
On Sat, Apr 18, 2009 at 11:16:47AM +0200, Jan Kiszka wrote: > Dmitry Eremin-Solenikov wrote: > > Gleb Natapov wrote: > > > >> Start to use interrupt/exception queues like VMX does. This also fix the > >> bug that if exit was caused by a guest internal exception access to IDT > >> the exception was

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-18 Thread Gleb Natapov
On Sat, Apr 18, 2009 at 11:05:10AM +0200, Jan Kiszka wrote: > Gleb Natapov wrote: > > Start to use interrupt/exception queues like VMX does. > > This also fix the bug that if exit was caused by a guest > > internal exception access to IDT the exception was not > > reinjected. > > > > Signed-off-by

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-18 Thread Jan Kiszka
Dmitry Eremin-Solenikov wrote: > Gleb Natapov wrote: > >> Start to use interrupt/exception queues like VMX does. This also fix the >> bug that if exit was caused by a guest internal exception access to IDT >> the exception was not reinjected. >> > > > OK. On real SVM HW this seems to work. Howev

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-18 Thread Jan Kiszka
Gleb Natapov wrote: > Start to use interrupt/exception queues like VMX does. > This also fix the bug that if exit was caused by a guest > internal exception access to IDT the exception was not > reinjected. > > Signed-off-by: Gleb Natapov > --- > arch/x86/kvm/svm.c | 176 >

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-17 Thread Dmitry Eremin-Solenikov
Gleb Natapov wrote: > Start to use interrupt/exception queues like VMX does. This also fix the > bug that if exit was caused by a guest internal exception access to IDT > the exception was not reinjected. > OK. On real SVM HW this seems to work. However now i'm stumbled upon another problem wrt

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-17 Thread Jan Kiszka
Jan Kiszka wrote: > Gleb Natapov wrote: >> +switch (type) { >> +case SVM_EXITINTINFO_TYPE_NMI: >> +svm->vcpu.arch.nmi_injected = true; >> +break; >> +case SVM_EXITINTINFO_TYPE_EXEPT: >> +if (exitintinfo & SVM_EXITINTINFO_VALID_ERR) { >> +

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-17 Thread Jan Kiszka
Gleb Natapov wrote: > Start to use interrupt/exception queues like VMX does. > This also fix the bug that if exit was caused by a guest > internal exception access to IDT the exception was not > reinjected. > > Signed-off-by: Gleb Natapov > --- > arch/x86/kvm/svm.c | 176 >

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Jan Kiszka
Dmitry Eremin-Solenikov wrote: > Jan Kiszka пишет: >> Dmitry Eremin-Solenikov wrote: >>> Jan Kiszka пишет: Dmitry Eremin-Solenikov wrote: > Gleb Natapov wrote: >> On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov >> wrote: >>> qemu-x86_64 version 0.10.2 running

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Dmitry Eremin-Solenikov
Jan Kiszka пишет: Dmitry Eremin-Solenikov wrote: Jan Kiszka пишет: Dmitry Eremin-Solenikov wrote: Gleb Natapov wrote: On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: qemu-x86_64 version 0.10.2 running on i386 Due to problems with qemu-x86_64 I have to boot the 'host'

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Jan Kiszka
Dmitry Eremin-Solenikov wrote: > Jan Kiszka пишет: >> Dmitry Eremin-Solenikov wrote: >>> Gleb Natapov wrote: On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: > qemu-x86_64 version 0.10.2 running on i386 > Due to problems with qemu-x86_64 I have to boot the

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Dmitry Eremin-Solenikov
Gleb Natapov пишет: On Wed, Apr 15, 2009 at 03:53:40PM +0400, Dmitry Eremin-Solenikov wrote: Jan Kiszka пишет: Dmitry Eremin-Solenikov wrote: Gleb Natapov wrote: On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: qemu-x86_64 version 0.10.2 running on i386 Due to problem

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Gleb Natapov
On Wed, Apr 15, 2009 at 03:53:40PM +0400, Dmitry Eremin-Solenikov wrote: > Jan Kiszka пишет: >> Dmitry Eremin-Solenikov wrote: >>> Gleb Natapov wrote: On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: > qemu-x86_64 version 0.10.2 running on i386 > Due to problems

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Dmitry Eremin-Solenikov
Dmitry Eremin-Solenikov пишет: Jan Kiszka пишет: Dmitry Eremin-Solenikov wrote: Gleb Natapov wrote: On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: qemu-x86_64 version 0.10.2 running on i386 Due to problems with qemu-x86_64 I have to boot the 'host' kernel with 'noapi

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Dmitry Eremin-Solenikov
Jan Kiszka пишет: Dmitry Eremin-Solenikov wrote: Gleb Natapov wrote: On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: qemu-x86_64 version 0.10.2 running on i386 Due to problems with qemu-x86_64 I have to boot the 'host' kernel with 'noapic'. Do you mean boot 'guest' ke

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Jan Kiszka
Dmitry Eremin-Solenikov wrote: > Gleb Natapov wrote: >> On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: >>> qemu-x86_64 version 0.10.2 running on i386 >>> Due to problems with qemu-x86_64 I have to boot the 'host' kernel >>> with 'noapic'. >> Do you mean boot 'guest' kernel

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Dmitry Eremin-Solenikov
Gleb Natapov wrote: On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: qemu-x86_64 version 0.10.2 running on i386 Due to problems with qemu-x86_64 I have to boot the 'host' kernel with 'noapic'. Do you mean boot 'guest' kernel with noapic? The guest is what runs inside qem

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Gleb Natapov
On Wed, Apr 15, 2009 at 12:51:00PM +0200, Jan Kiszka wrote: > >>> I need _host_ cpu info. Do the same on the host please. > >> That _is_ his host - qemu in emulation mode (ie. nested virtualization). > > Ah, now I noticed svm in cpu flags. Does qemu support svm in TCG? > > Yes, and KVM seems to ha

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Jan Kiszka
Gleb Natapov wrote: > On Wed, Apr 15, 2009 at 12:22:34PM +0200, Jan Kiszka wrote: >> Gleb Natapov wrote: >>> On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: 2009/4/14 Gleb Natapov : > On Tue, Apr 14, 2009 at 11:29:49PM +0400, Dmitry Eremin-Solenikov wrote: >> 2

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Gleb Natapov
On Wed, Apr 15, 2009 at 12:22:34PM +0200, Jan Kiszka wrote: > Gleb Natapov wrote: > > On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: > >> 2009/4/14 Gleb Natapov : > >>> On Tue, Apr 14, 2009 at 11:29:49PM +0400, Dmitry Eremin-Solenikov wrote: > 2009/4/14 Gleb Natapov :

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Jan Kiszka
Gleb Natapov wrote: > On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: >> 2009/4/14 Gleb Natapov : >>> On Tue, Apr 14, 2009 at 11:29:49PM +0400, Dmitry Eremin-Solenikov wrote: 2009/4/14 Gleb Natapov : > On Tue, Apr 14, 2009 at 06:32:29PM +0400, Dmitry Eremin-Solenik

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Gleb Natapov
On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: > qemu-x86_64 version 0.10.2 running on i386 > Due to problems with qemu-x86_64 I have to boot the 'host' kernel with > 'noapic'. Do you mean boot 'guest' kernel with noapic? The guest is what runs inside qemu. So you are abl

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Gleb Natapov
On Wed, Apr 15, 2009 at 01:30:29PM +0400, Dmitry Eremin-Solenikov wrote: > 2009/4/14 Gleb Natapov : > > On Tue, Apr 14, 2009 at 11:29:49PM +0400, Dmitry Eremin-Solenikov wrote: > >> 2009/4/14 Gleb Natapov : > >> > On Tue, Apr 14, 2009 at 06:32:29PM +0400, Dmitry Eremin-Solenikov wrote: > >> >> 2009

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-15 Thread Dmitry Eremin-Solenikov
2009/4/14 Gleb Natapov : > On Tue, Apr 14, 2009 at 11:29:49PM +0400, Dmitry Eremin-Solenikov wrote: >> 2009/4/14 Gleb Natapov : >> > On Tue, Apr 14, 2009 at 06:32:29PM +0400, Dmitry Eremin-Solenikov wrote: >> >> 2009/4/14 Gleb Natapov : >> >> > On Tue, Apr 14, 2009 at 02:14:04PM +, Dmitry Eremi

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Gleb Natapov
On Tue, Apr 14, 2009 at 10:41:03PM +0300, Gleb Natapov wrote: > > Guest: Debian lenny. Linux 2.6.26, Debian version (I can provide > > config or bzImage + initrd). > Yes please provide. Debian lenny (x86_64) is my default guest :) And I > just booted it fine on AMD barcelona CPU. What is you host

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Gleb Natapov
On Tue, Apr 14, 2009 at 11:29:49PM +0400, Dmitry Eremin-Solenikov wrote: > 2009/4/14 Gleb Natapov : > > On Tue, Apr 14, 2009 at 06:32:29PM +0400, Dmitry Eremin-Solenikov wrote: > >> 2009/4/14 Gleb Natapov : > >> > On Tue, Apr 14, 2009 at 02:14:04PM +, Dmitry Eremin-Solenikov wrote: > >> >> Gleb

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Dmitry Eremin-Solenikov
2009/4/14 Gleb Natapov : > On Tue, Apr 14, 2009 at 06:32:29PM +0400, Dmitry Eremin-Solenikov wrote: >> 2009/4/14 Gleb Natapov : >> > On Tue, Apr 14, 2009 at 02:14:04PM +, Dmitry Eremin-Solenikov wrote: >> >> Gleb Natapov wrote: >> >> >> >> > Start to use interrupt/exception queues like VMX does

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Gleb Natapov
On Tue, Apr 14, 2009 at 07:10:40PM +0300, Avi Kivity wrote: > Gleb Natapov wrote: >> On Tue, Apr 14, 2009 at 02:14:04PM +, Dmitry Eremin-Solenikov wrote: >> >>> Gleb Natapov wrote: >>> >>> Start to use interrupt/exception queues like VMX does. This also fix the bug that if exi

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Avi Kivity
Gleb Natapov wrote: On Tue, Apr 14, 2009 at 02:14:04PM +, Dmitry Eremin-Solenikov wrote: Gleb Natapov wrote: Start to use interrupt/exception queues like VMX does. This also fix the bug that if exit was caused by a guest internal exception access to IDT the exception was not reinje

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Gleb Natapov
On Tue, Apr 14, 2009 at 05:55:36PM +0300, Gleb Natapov wrote: > > After applying the next patch (or the whole serie), I get the following > > messages > > during initramfs drivers probe: > > > > Clocksource tsc unstable (delta...) > > no cont in shutdown! > > floppy0: FDC access conflict! > > >

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Gleb Natapov
On Tue, Apr 14, 2009 at 06:32:29PM +0400, Dmitry Eremin-Solenikov wrote: > 2009/4/14 Gleb Natapov : > > On Tue, Apr 14, 2009 at 02:14:04PM +, Dmitry Eremin-Solenikov wrote: > >> Gleb Natapov wrote: > >> > >> > Start to use interrupt/exception queues like VMX does. This also fix the > >> > bug t

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Dmitry Eremin-Solenikov
2009/4/14 Gleb Natapov : > On Tue, Apr 14, 2009 at 02:14:04PM +, Dmitry Eremin-Solenikov wrote: >> Gleb Natapov wrote: >> >> > Start to use interrupt/exception queues like VMX does. This also fix the >> > bug that if exit was caused by a guest internal exception access to IDT >> > the exception

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Gleb Natapov
On Tue, Apr 14, 2009 at 02:14:04PM +, Dmitry Eremin-Solenikov wrote: > Gleb Natapov wrote: > > > Start to use interrupt/exception queues like VMX does. This also fix the > > bug that if exit was caused by a guest internal exception access to IDT > > the exception was not reinjected. > > This

Re: [PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-14 Thread Dmitry Eremin-Solenikov
Gleb Natapov wrote: > Start to use interrupt/exception queues like VMX does. This also fix the > bug that if exit was caused by a guest internal exception access to IDT > the exception was not reinjected. This patch broke KVM for me: after it is applied (to the tip of avi's git tree), linux insid

[PATCH 05/15] Coalesce userspace/kernel irqchip interrupt injection logic.

2009-04-13 Thread Gleb Natapov
Start to use interrupt/exception queues like VMX does. This also fix the bug that if exit was caused by a guest internal exception access to IDT the exception was not reinjected. Signed-off-by: Gleb Natapov --- arch/x86/kvm/svm.c | 176 ++-- 1 fil