Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-27 Thread Gleb Natapov
On Tue, Jun 25, 2013 at 06:34:03PM -0400, Paul Gortmaker wrote: In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), I am copying Jan, the author of the patch. Commit message says: Code under this lock requires non-preemptibility, but which code exactly is this? Is this still true?

Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-27 Thread Paolo Bonzini
Il 27/06/2013 13:09, Gleb Natapov ha scritto: On Tue, Jun 25, 2013 at 06:34:03PM -0400, Paul Gortmaker wrote: In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), I am copying Jan, the author of the patch. Commit message says: Code under this lock requires non-preemptibility, but

Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-27 Thread Gleb Natapov
On Thu, Jun 27, 2013 at 01:38:29PM +0200, Paolo Bonzini wrote: Il 27/06/2013 13:09, Gleb Natapov ha scritto: On Tue, Jun 25, 2013 at 06:34:03PM -0400, Paul Gortmaker wrote: In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), I am copying Jan, the author of the patch. Commit

Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-27 Thread Paolo Bonzini
Il 27/06/2013 13:43, Gleb Natapov ha scritto: I am copying Jan, the author of the patch. Commit message says: Code under this lock requires non-preemptibility, but which code exactly is this? Is this still true? hardware_enable_nolock/hardware_disable_nolock does. I suspected

Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-27 Thread Jan Kiszka
On 2013-06-27 13:38, Paolo Bonzini wrote: Il 27/06/2013 13:09, Gleb Natapov ha scritto: On Tue, Jun 25, 2013 at 06:34:03PM -0400, Paul Gortmaker wrote: In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), I am copying Jan, the author of the patch. Commit message says: Code under

Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-27 Thread Gleb Natapov
On Thu, Jun 27, 2013 at 02:16:07PM +0200, Jan Kiszka wrote: On 2013-06-27 13:38, Paolo Bonzini wrote: Il 27/06/2013 13:09, Gleb Natapov ha scritto: On Tue, Jun 25, 2013 at 06:34:03PM -0400, Paul Gortmaker wrote: In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), I am copying

Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-27 Thread Paolo Bonzini
Il 27/06/2013 14:32, Gleb Natapov ha scritto: In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), I am copying Jan, the author of the patch. Commit message says: Code under this lock requires non-preemptibility, but which code exactly is this? Is this still true?

Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-27 Thread Paolo Bonzini
Il 27/06/2013 15:00, Paolo Bonzini ha scritto: Il 27/06/2013 14:32, Gleb Natapov ha scritto: In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), I am copying Jan, the author of the patch. Commit message says: Code under this lock requires non-preemptibility, but which code exactly

Re: [PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-26 Thread Paolo Bonzini
Il 26/06/2013 00:34, Paul Gortmaker ha scritto: In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), the kvm_lock was made a raw lock. However, the kvm mmu_shrink() function tries to grab the (non-raw) mmu_lock within the scope of the raw locked kvm_lock being held. This leads to

[PATCH-next] kvm: don't try to take mmu_lock while holding the main raw kvm_lock

2013-06-25 Thread Paul Gortmaker
In commit e935b8372cf8 (KVM: Convert kvm_lock to raw_spinlock), the kvm_lock was made a raw lock. However, the kvm mmu_shrink() function tries to grab the (non-raw) mmu_lock within the scope of the raw locked kvm_lock being held. This leads to the following: BUG: sleeping function called from