Re: [PATCH v3 7/8] KVM: x86/mmu: Protect rmaps independently with SRCU

From: Paolo Bonzini
Date: Tue May 11 2021 - 12:46:43 EST


On 11/05/21 18:22, Ben Gardon wrote:
Yes, and I'm arguing that annotating the rmaps as __rcu is wrong because they
themselves are not protected by SRCU. The memslot that contains the rmaps is
protected by SRCU, and because of that asserting SRCU is held for read will hold
true. But, if the memslot code were changed to use a different protection scheme,
e.g. a rwlock for argument's sake, then the SRCU assertion would fail even though
the rmap logic itself didn't change.

I'm inclined to agree with Sean that the extra RCU annotations are
probably unnecessary since we're already doing the srcu dereference
for all the slots. I'll move all these RCU annotations to their own
patch and put it at the end of the series when I send v4.


Fair enough, you can even remove them then.

Paolo