Hi,
I am working on the MIPS KVM port, and am trying to figure out under
which circumstances do I need to srcu_read_lock()/srcu_read_unlock() the
kvm->srcu.
I am looking at implementing something similar to arch/x86/kvm/x86.c at
__msr_io(), where we see:
.
.
.
idx = srcu_read_lock(&vcpu->kvm->srcu);
for (i = 0; i < msrs->nmsrs; ++i)
if (do_msr(vcpu, entries[i].index, &entries[i].data))
break;
srcu_read_unlock(&vcpu->kvm->srcu, idx);
.
.
.
Why is the srcu_read_lock() taken here? I see no srcu_dereference() in
the code path that would indicate the need for obtaining the lock.
I have a feeling that I am missing some essential concept about the
design of this code, but I don't know what it is.
Can someone explain what is happening here?
Thanks in advance,
David Daney
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html