diff mbox

KVM: Start lock documentation

Message ID 4D52A090.5010308@siemens.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Kiszka Feb. 9, 2011, 2:11 p.m. UTC
None
diff mbox

Patch

diff --git a/Documentation/kvm/locking.txt b/Documentation/kvm/locking.txt
new file mode 100644
index 0000000..23f9092
--- /dev/null
+++ b/Documentation/kvm/locking.txt
@@ -0,0 +1,30 @@ 
+KVM Lock Overview
+=================
+
+1. Acquisition Orders
+---------------------
+
+kvm_lock
++-> kvm::srcu / kvm::lock
+    +-> kvm::slots_lock
+        +-> kvm::mmu_lock
+...
+
+
+2. Reference
+------------
+
+Name:		kvm_lock
+Type:		raw_spinlock
+Arch:		any
+Protects:	- vm_list
+		- hardware virtualization enable/disable
+Comment:	'raw' because hardware enabling/disabling must be atomic /wrt
+		migration.
+
+Name:		kvm_arch::tsc_write_lock
+Type:		raw_spinlock
+Arch:		x86
+Protects:	- kvm_arch::{last_tsc_write,last_tsc_nsec,last_tsc_offset}
+		- tsc offset in vmcb
+Comment:	'raw' because updating the tsc offsets must not be preempted.