Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-05-13 Thread Yang, Sheng
On Tuesday 13 May 2008 00:40:05 Marcelo Tosatti wrote: > On Sat, May 10, 2008 at 10:12:02AM +0800, Yang, Sheng wrote: > > > Did you have kvm.git commit 8ae6dc90ac84d9734e343210c8ec709f50cd9d89 > > > when testing this? > > > > > > I believe it should fix that issue, because "ps->inject_pending" won'

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-05-12 Thread Marcelo Tosatti
On Sat, May 10, 2008 at 10:12:02AM +0800, Yang, Sheng wrote: > > Did you have kvm.git commit 8ae6dc90ac84d9734e343210c8ec709f50cd9d89 > > when testing this? > > > > I believe it should fix that issue, because "ps->inject_pending" won't > > be set by kvm_pit_timer_intr_post() if the IRQ is masked. P

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-05-09 Thread Yang, Sheng
On Friday 09 May 2008 22:53:00 Marcelo Tosatti wrote: > On Fri, May 09, 2008 at 03:49:20PM +0800, Yang, Sheng wrote: > > On Sunday 13 April 2008 17:28:22 Avi Kivity wrote: > > > Marcelo Tosatti wrote: > > > > On Fri, Apr 11, 2008 at 03:12:41PM +0300, Avi Kivity wrote: > > > >> This breaks ia64 (and

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-05-09 Thread Marcelo Tosatti
On Fri, May 09, 2008 at 03:49:20PM +0800, Yang, Sheng wrote: > On Sunday 13 April 2008 17:28:22 Avi Kivity wrote: > > Marcelo Tosatti wrote: > > > On Fri, Apr 11, 2008 at 03:12:41PM +0300, Avi Kivity wrote: > > >> This breaks ia64 (and shouldn't s390 use this too?) > > >> > > >>> * We will

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-05-09 Thread Yang, Sheng
On Sunday 13 April 2008 17:28:22 Avi Kivity wrote: > Marcelo Tosatti wrote: > > On Fri, Apr 11, 2008 at 03:12:41PM +0300, Avi Kivity wrote: > >> This breaks ia64 (and shouldn't s390 use this too?) > >> > >>>* We will block until either an interrupt or a signal wakes us up > >>>*/ > >>> wh

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-14 Thread Carsten Otte
Avi Kivity wrote: > Why? This one does'nt work for us. Our arch defines various reasons why we would not fall asleep but do something else, and we need to check them while in atomic of a lock that other archs don't have before sleeping. See kvm_s390_handle_wait in arch/s390/kvm/interrupt.c.

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-13 Thread Avi Kivity
Carsten Otte wrote: > Avi Kivity wrote: >>> @@ -765,6 +766,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcp >>> >> >> >> This breaks ia64 (and shouldn't s390 use this too?) >>> * We will block until either an interrupt or a signal wakes us up >>> */ >>> while (!kvm_cpu_has_interrup

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-13 Thread Avi Kivity
Marcelo Tosatti wrote: > On Fri, Apr 11, 2008 at 03:12:41PM +0300, Avi Kivity wrote: > > >> This breaks ia64 (and shouldn't s390 use this too?) >> >>> * We will block until either an interrupt or a signal wakes us up >>> */ >>> while (!kvm_cpu_has_interrupt(vcpu) >>> +

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-11 Thread Carsten Otte
Avi Kivity wrote: >> @@ -765,6 +766,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcp >> > > > This breaks ia64 (and shouldn't s390 use this too?) >> * We will block until either an interrupt or a signal wakes us up >> */ >> while (!kvm_cpu_has_interrupt(vcpu) >> + && !k

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-11 Thread Marcelo Tosatti
On Fri, Apr 11, 2008 at 03:12:41PM +0300, Avi Kivity wrote: > This breaks ia64 (and shouldn't s390 use this too?) > > * We will block until either an interrupt or a signal wakes us up > > */ > > while (!kvm_cpu_has_interrupt(vcpu) > >+ && !kvm_cpu_has_pending_timer(vcpu) >

Re: [kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-11 Thread Avi Kivity
Marcelo Tosatti wrote: > Timers that fire between guest hlt and vcpu_block's add_wait_queue() are > ignored, possibly resulting in hangs. > > Also make sure that atomic_inc and waitqueue_active tests happen in the > specified order, otherwise the following race is open: > > CPU0

[kvm-devel] [patch 1/2] KVM: hlt emulation should take in-kernel APIC/PIT timers into account

2008-04-10 Thread Marcelo Tosatti
Timers that fire between guest hlt and vcpu_block's add_wait_queue() are ignored, possibly resulting in hangs. Also make sure that atomic_inc and waitqueue_active tests happen in the specified order, otherwise the following race is open: CPU0CPU1