Re: [PATCH] kvm: get rid of srcu idx

2010-10-26 Thread Michael S. Tsirkin
On Tue, Oct 26, 2010 at 10:06:41AM +0200, Avi Kivity wrote: > On 10/26/2010 10:01 AM, Gleb Natapov wrote: > >On Tue, Oct 26, 2010 at 09:57:08AM +0200, Avi Kivity wrote: > >> On 10/26/2010 08:58 AM, Gleb Natapov wrote: > >> >> > >> >> Well, you just changed where srcu index is saved. I don't

Re: [PATCH] kvm: get rid of srcu idx

2010-10-26 Thread Avi Kivity
On 10/26/2010 10:01 AM, Gleb Natapov wrote: On Tue, Oct 26, 2010 at 09:57:08AM +0200, Avi Kivity wrote: > On 10/26/2010 08:58 AM, Gleb Natapov wrote: > >> > >> Well, you just changed where srcu index is saved. I don't see how it > >> could make a difference in practice. > >> > >If the

Re: [PATCH] kvm: get rid of srcu idx

2010-10-26 Thread Gleb Natapov
On Tue, Oct 26, 2010 at 09:57:08AM +0200, Avi Kivity wrote: > On 10/26/2010 08:58 AM, Gleb Natapov wrote: > >> > >> Well, you just changed where srcu index is saved. I don't see how it > >> could make a difference in practice. > >> > >If there is nested call to srcu read lock if srcu_idx is stor

Re: [PATCH] kvm: get rid of srcu idx

2010-10-26 Thread Avi Kivity
On 10/26/2010 08:58 AM, Gleb Natapov wrote: > > Well, you just changed where srcu index is saved. I don't see how it > could make a difference in practice. > If there is nested call to srcu read lock if srcu_idx is stored in vcpu nested call will override previous srcu_idx value and srcu unloc

Re: [PATCH] kvm: get rid of srcu idx

2010-10-25 Thread Gleb Natapov
On Mon, Oct 25, 2010 at 06:13:56PM -0200, Marcelo Tosatti wrote: > On Mon, Oct 25, 2010 at 03:20:59PM +0200, Michael S. Tsirkin wrote: > > On Mon, Oct 25, 2010 at 11:52:29AM -0200, Marcelo Tosatti wrote: > > > On Sun, Oct 24, 2010 at 07:16:10PM +0200, Michael S. Tsirkin wrote: > > > > srcu_idx is e

Re: [PATCH] kvm: get rid of srcu idx

2010-10-25 Thread Marcelo Tosatti
On Mon, Oct 25, 2010 at 03:20:59PM +0200, Michael S. Tsirkin wrote: > On Mon, Oct 25, 2010 at 11:52:29AM -0200, Marcelo Tosatti wrote: > > On Sun, Oct 24, 2010 at 07:16:10PM +0200, Michael S. Tsirkin wrote: > > > srcu_idx is easy to misuse as it can not be used > > > in nested srcu_read_lock calls.

Re: [PATCH] kvm: get rid of srcu idx

2010-10-25 Thread Michael S. Tsirkin
On Mon, Oct 25, 2010 at 11:52:29AM -0200, Marcelo Tosatti wrote: > On Sun, Oct 24, 2010 at 07:16:10PM +0200, Michael S. Tsirkin wrote: > > srcu_idx is easy to misuse as it can not be used > > in nested srcu_read_lock calls. Switch to local > > index to make correctness easier to verify. > > > > S

Re: [PATCH] kvm: get rid of srcu idx

2010-10-25 Thread Marcelo Tosatti
On Sun, Oct 24, 2010 at 07:16:10PM +0200, Michael S. Tsirkin wrote: > srcu_idx is easy to misuse as it can not be used > in nested srcu_read_lock calls. Switch to local > index to make correctness easier to verify. > > Signed-off-by: Michael S. Tsirkin > > --- Looks good to me. Not needed for

[PATCH] kvm: get rid of srcu idx

2010-10-24 Thread Michael S. Tsirkin
srcu_idx is easy to misuse as it can not be used in nested srcu_read_lock calls. Switch to local index to make correctness easier to verify. Signed-off-by: Michael S. Tsirkin --- Lightly tested. diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 311f6da..edb9dfa 100644 --- a/arch/x86/