Skip to contentSkip to conversation

KVM: Add documentation for kvm->srcu lock

PATCH Applied Thomas Huth 2 participants 2 messages Sep 9, 2013 – Sep 12, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: Add documentation for kvm->srcu lock

This patch documents the kvm->srcu lock (using the information from a mail which has been posted by Marcelo Tosatti to the kvm mailing list some months ago, see the following URL for details:
http://www.mail-archive.com/[email protected]/msg90040.html )

---
 Documentation/virtual/kvm/locking.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)
Documentation/virtual/kvm/locking.txt +11 -0
index 41b7ac9..a9f366e 100644
@@ -151,3 +151,14 @@ Type:		spinlock_t
 Arch:		any
 Protects:	-shadow page/shadow tlb entry
 Comment:	it is a spinlock since it is used in mmu notifier.
+
+Name:		kvm->srcu
+Type:		srcu lock
+Arch:		any
+Protects:	- kvm->memslots
+		- kvm->buses
+Comment:	The srcu read lock must be held while accessing memslots (e.g.
+		when using gfn_to_* functions) and while accessing in-kernel
+		MMIO/PIO address->device structure mapping (kvm->buses).
+		The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
+		if it is needed by multiple functions.
Signature · 1 line
1.8.1.4
maintainer Applied
#1 lore raw

Il 09/09/2013 17:32, Thomas Huth ha scritto:

Quoted 21 lines

This patch documents the kvm->srcu lock (using the information from a mail which has been posted by Marcelo Tosatti to the kvm mailing list some months ago, see the following URL for details:
http://www.mail-archive.com/[email protected]/msg90040.html )

---
 Documentation/virtual/kvm/locking.txt | 11 +++++++++++
 1 file changed, 11 insertions(+)
Documentation/virtual/kvm/locking.txt +1 -0
index 41b7ac9..a9f366e 100644
@@ -151,3 +151,14 @@ Type:		spinlock_t
 Arch:		any
 Protects:	-shadow page/shadow tlb entry
 Comment:	it is a spinlock since it is used in mmu notifier.
+

Documentation/virtual/kvm/locking.txt Type: spinlock_t · line 164

Quoted 10 lines
Documentation/virtual/kvm/locking.txt +10 -0
+Name:		kvm->srcu
+Type:		srcu lock
+Arch:		any
+Protects:	- kvm->memslots
+		- kvm->buses
+Comment:	The srcu read lock must be held while accessing memslots (e.g.
+		when using gfn_to_* functions) and while accessing in-kernel
+		MMIO/PIO address->device structure mapping (kvm->buses).
+		The srcu index can be stored in kvm_vcpu->srcu_idx per vcpu
+		if it is needed by multiple functions.

Applied to kvm/queue for 3.12, thanks.