Re: [PATCH v2] KVM: x86: Handle SRCU initialization failure during page track init
From: Paolo Bonzini
Date: Tue Sep 21 2021 - 13:47:38 EST
On 03/09/21 18:18, Sean Christopherson wrote:
Before moving forward with a fix, I'd like to get Paolo's input on dropping
track_srcu in favor of kvm->srcu and avoiding this altogheter. Note, Paolo is on
vacation at the moment, so this won't get attention for a week or more.
The reason for track_srcu's existence is to avoid complications in
kvm_arch_flush_shadow_memslot, which is called from the _write_ side of
kvm->srcu but is on the _read_ side of track_srcu.
I think this should be fixed easily by taking slots_lock in
kvm_page_track_register_notifier and kvm_page_track_unregister_notifier,
however it's a bit more complicated from the point of view of the lock
hierarchy and possible deadlocks.
So I'm open to patches that drop track_srcu, but for now I applied this
patch.
Paolo