[RFC 26/26] Documentation: KVM: Add description of pkg_therm_lock

From: Zhao Liu
Date: Sat Feb 03 2024 - 04:10:09 EST


From: Zhao Liu <zhao1.liu@xxxxxxxxx>

pkg_therm_lock is a per-VM lock and used in PTS, HFI and ITD
virtualization supports. Add description about it.

Tested-by: Yanting Jiang <yanting.jiang@xxxxxxxxx>
Signed-off-by: Zhao Liu <zhao1.liu@xxxxxxxxx>
---
Documentation/virt/kvm/locking.rst | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/Documentation/virt/kvm/locking.rst b/Documentation/virt/kvm/locking.rst
index 02880d5552d5..84a138916898 100644
--- a/Documentation/virt/kvm/locking.rst
+++ b/Documentation/virt/kvm/locking.rst
@@ -290,7 +290,7 @@ time it will be set using the Dirty tracking mechanism described above.
wakeup.

``vendor_module_lock``
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+^^^^^^^^^^^^^^^^^^^^^^
:Type: mutex
:Arch: x86
:Protects: loading a vendor module (kvm_amd or kvm_intel)
@@ -298,3 +298,14 @@ time it will be set using the Dirty tracking mechanism described above.
taken outside of kvm_lock, e.g. in KVM's CPU online/offline callbacks, and
many operations need to take cpu_hotplug_lock when loading a vendor module,
e.g. updating static calls.
+
+``pkg_therm_lock``
+^^^^^^^^^^^^^^^^^^
+:Type: mutex
+:Arch: x86 (vmx)
+:Protects: PTS, HFI and ITD emulation
+:Comment: This is a per-VM lock and it is used for VM level thermal features'
+ emulation (PTS, HFI and ITD). When these features' emulated MSRs need to
+ be changed, or when we handle the virtual HFI table's update, this lock is
+ needed to create the atomi context and to avoid competing behavior of other
+ vCPUs in the same VM.
--
2.34.1