Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Michael S. Tsirkin
On Thu, Jul 19, 2012 at 06:11:15AM -0600, Alex Williamson wrote: > On Thu, 2012-07-19 at 12:07 +0300, Michael S. Tsirkin wrote: > > On Wed, Jul 18, 2012 at 05:20:40PM -0600, Alex Williamson wrote: > > > On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: > > > > On Wed, Jul 18, 2012 at

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Alex Williamson
On Thu, 2012-07-19 at 12:07 +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 05:20:40PM -0600, Alex Williamson wrote: > > On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: > > > On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: > > > > On Thu, 2012-07-19 at

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Michael S. Tsirkin
On Thu, Jul 19, 2012 at 06:06:31AM -0600, Alex Williamson wrote: > On Thu, 2012-07-19 at 12:15 +0300, Michael S. Tsirkin wrote: > > On Wed, Jul 18, 2012 at 05:22:42PM -0600, Alex Williamson wrote: > > > I hate reviewing code > > > > > where I have to differentiate 'l' vs '1'. > > > > > > > > l is

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Alex Williamson
On Thu, 2012-07-19 at 12:15 +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 05:22:42PM -0600, Alex Williamson wrote: > > I hate reviewing code > > > > where I have to differentiate 'l' vs '1'. > > > > > > l is an illegal variable name? Switch to a different font. > > > > WTF > >

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 05:22:42PM -0600, Alex Williamson wrote: > I hate reviewing code > > > where I have to differentiate 'l' vs '1'. > > > > l is an illegal variable name? Switch to a different font. > > WTF Really, you should use a font where these differ. I currently use Monospace but

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 05:20:40PM -0600, Alex Williamson wrote: > On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: > > On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: > > > On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > > > > When more than 1 source id

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Gleb Natapov
On Thu, Jul 19, 2012 at 01:44:59AM +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 04:16:14PM -0600, Alex Williamson wrote: > > On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > > > When more than 1 source id is in use for the same GSI, we have the > > > following race

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 05:20:40PM -0600, Alex Williamson wrote: > On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: > > On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: > > > On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > > > > When more than 1 source id

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Gleb Natapov
On Wed, Jul 18, 2012 at 05:20:40PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Gleb Natapov
On Thu, Jul 19, 2012 at 01:44:59AM +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 04:16:14PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use for the same GSI, we have the following race related to

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 05:20:40PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 05:22:42PM -0600, Alex Williamson wrote: I hate reviewing code where I have to differentiate 'l' vs '1'. l is an illegal variable name? Switch to a different font. WTF Really, you should use a font where these differ. I currently use Monospace but there are

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Alex Williamson
On Thu, 2012-07-19 at 12:15 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 05:22:42PM -0600, Alex Williamson wrote: I hate reviewing code where I have to differentiate 'l' vs '1'. l is an illegal variable name? Switch to a different font. WTF Really, you should use

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Michael S. Tsirkin
On Thu, Jul 19, 2012 at 06:06:31AM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 12:15 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 05:22:42PM -0600, Alex Williamson wrote: I hate reviewing code where I have to differentiate 'l' vs '1'. l is an illegal

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Alex Williamson
On Thu, 2012-07-19 at 12:07 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 05:20:40PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 00:52 +0300,

Re: [PATCH] kvm: fix race with level interrupts

2012-07-19 Thread Michael S. Tsirkin
On Thu, Jul 19, 2012 at 06:11:15AM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 12:07 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 05:20:40PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 04:26:41PM

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Alex Williamson
On Thu, 2012-07-19 at 01:44 +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 04:16:14PM -0600, Alex Williamson wrote: > > On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > > > When more than 1 source id is in use for the same GSI, we have the > > > following race related to

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Alex Williamson
On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: > On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: > > On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > > > When more than 1 source id is in use for the same GSI, we have the > > > following race related to

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: > On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > > When more than 1 source id is in use for the same GSI, we have the > > following race related to handling irq_states: > > > > CPU 0 clears bit in irq_states. CPU 0

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:16:14PM -0600, Alex Williamson wrote: > On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > > When more than 1 source id is in use for the same GSI, we have the > > following race related to handling irq_states: > > > > CPU 0 clears bit in irq_states. CPU 0

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Alex Williamson
On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > When more than 1 source id is in use for the same GSI, we have the > following race related to handling irq_states: > > CPU 0 clears bit in irq_states. CPU 0 reads irq_state as 0. > CPU 1 sets bit in irq_states. CPU 1 calls

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Alex Williamson
On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: > When more than 1 source id is in use for the same GSI, we have the > following race related to handling irq_states: > > CPU 0 clears bit in irq_states. CPU 0 reads irq_state as 0. > CPU 1 sets bit in irq_states. CPU 1 calls

[PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Michael S. Tsirkin
When more than 1 source id is in use for the same GSI, we have the following race related to handling irq_states: CPU 0 clears bit in irq_states. CPU 0 reads irq_state as 0. CPU 1 sets bit in irq_states. CPU 1 calls kvm_ioapic_set_irq(1). CPU 0 calls kvm_ioapic_set_irq(0). Now ioapic thinks the

[PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Michael S. Tsirkin
When more than 1 source id is in use for the same GSI, we have the following race related to handling irq_states: CPU 0 clears bit in irq_states. CPU 0 reads irq_state as 0. CPU 1 sets bit in irq_states. CPU 1 calls kvm_ioapic_set_irq(1). CPU 0 calls kvm_ioapic_set_irq(0). Now ioapic thinks the

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Alex Williamson
On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use for the same GSI, we have the following race related to handling irq_states: CPU 0 clears bit in irq_states. CPU 0 reads irq_state as 0. CPU 1 sets bit in irq_states. CPU 1 calls

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Alex Williamson
On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use for the same GSI, we have the following race related to handling irq_states: CPU 0 clears bit in irq_states. CPU 0 reads irq_state as 0. CPU 1 sets bit in irq_states. CPU 1 calls

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:16:14PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use for the same GSI, we have the following race related to handling irq_states: CPU 0 clears bit in irq_states. CPU 0 reads

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Michael S. Tsirkin
On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use for the same GSI, we have the following race related to handling irq_states: CPU 0 clears bit in irq_states. CPU 0 reads

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Alex Williamson
On Thu, 2012-07-19 at 01:49 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 04:26:41PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use for the same GSI, we have the following race related to handling

Re: [PATCH] kvm: fix race with level interrupts

2012-07-18 Thread Alex Williamson
On Thu, 2012-07-19 at 01:44 +0300, Michael S. Tsirkin wrote: On Wed, Jul 18, 2012 at 04:16:14PM -0600, Alex Williamson wrote: On Thu, 2012-07-19 at 00:52 +0300, Michael S. Tsirkin wrote: When more than 1 source id is in use for the same GSI, we have the following race related to handling