From patchwork Sat Feb 3 09:12:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhao Liu X-Patchwork-Id: 769715 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 607F56E2DC; Sat, 3 Feb 2024 09:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706950936; cv=none; b=QYDZxDz/Y10TU9o9kzTi6OwxQ3SolVp0JFe8VALXNddKUe/12VssOSbckD09/UsS2I7Lb7iSdbkXFrKsh7+AEmQEovZKAxbzOvwa8rETneZEaMxgKqKVkdXkQQTDm3m0hFoS9mUVal+o94IaVa+VfrpYPk2U3ECoZ6D1SW1aReQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706950936; c=relaxed/simple; bh=qd5tUyNdUljBtdVqZxN09u5VE/YXPZNXPRlXvr1e0nQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=G+AkXa9y5shuEoDm/VVuEoZLIRMlxQrwRH+JVSyJAXm8iHlSPljtQkHOzawGqMMfGHlRL7jY5XeJn96rbzqSAfSaUB7kGvtsz4KHa3m5xix5obg4yr5T678X7rVlrIc/SkZjv7Shjd6mP7nliFwkATN0RQUTsULWeAufjx7c8Mw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=VhF4F9uH; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VhF4F9uH" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1706950936; x=1738486936; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qd5tUyNdUljBtdVqZxN09u5VE/YXPZNXPRlXvr1e0nQ=; b=VhF4F9uHPsiQEfgzIALsBC591Bf2JZwj+N/i98F27t8blI4rVupo6T0s MZvk9eESQBodl2jJAbHCdg5iL/J+eYKJWlXYxfLwBUPCgH92SrUevKYrL ZHROiCXCmx4ISEX8hMKUBS8D+7riFxGD9mklvY/i87UngBGJ8mUhrqzxO rpc6gTD0bgRlOqCLPw1/XwDqETadKuUlTVxQsa6PdL7W9WgZC+mIG0LUS CxSOMkXShxLC9FJ29H52Tu6kr/K6M7W+PzRgKYFCq3bSR2ystbs4i2aqI SbeWrqZpVzUqKMR3hqyAfT8STiB/MW3kZPeZy8eyAu3RH1lKCgZQbZcWZ w==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="4132272" X-IronPort-AV: E=Sophos;i="6.05,240,1701158400"; d="scan'208";a="4132272" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2024 01:02:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,240,1701158400"; d="scan'208";a="291619" Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmviesa009.fm.intel.com with ESMTP; 03 Feb 2024 01:02:08 -0800 From: Zhao Liu To: Paolo Bonzini , Sean Christopherson , "Rafael J . Wysocki" , Daniel Lezcano , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H . Peter Anvin" , kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org Cc: Ricardo Neri , Len Brown , Zhang Rui , Zhenyu Wang , Zhuocheng Ding , Dapeng Mi , Yanting Jiang , Yongwei Ma , Vineeth Pillai , Suleiman Souhlal , Masami Hiramatsu , David Dai , Saravana Kannan , Zhao Liu Subject: [RFC 26/26] Documentation: KVM: Add description of pkg_therm_lock Date: Sat, 3 Feb 2024 17:12:14 +0800 Message-Id: <20240203091214.411862-27-zhao1.liu@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240203091214.411862-1-zhao1.liu@linux.intel.com> References: <20240203091214.411862-1-zhao1.liu@linux.intel.com> Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Zhao Liu 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 Signed-off-by: Zhao Liu --- 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.