Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp1316359rdb; Sat, 3 Feb 2024 01:10:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCO8hGdNUbRl3Lk8dfDGghfNgrdmCn317+o+wW0pyJ5qFYhZHW2bfNO05dgeGd3eeis3An X-Received: by 2002:a05:651c:10c7:b0:2cf:4fbd:82b4 with SMTP id l7-20020a05651c10c700b002cf4fbd82b4mr4929992ljn.22.1706951409750; Sat, 03 Feb 2024 01:10:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706951409; cv=pass; d=google.com; s=arc-20160816; b=zu9nvh8jrVnRRMkW+8SGk9cWAoFrsAcesAU6G63Nv7QOd5lyqpHpCIVAgcIcxxbu4G OmYQDzygkhJKlL3Ca+pEBtiWsl4B+QwEIs2YCtBKfNToLhpzURvSe0Z+S+PMT7GenNHd gENwifqHVcYGnNsmV0bsUUtl0RnlsZ5/RqCh5ymc96LAPU65KXFj4q5yVgryiwCf/elA GX662H2sOBCEVgWXAZc6l82J/Tcge3BaqPhTeRGxnQ9t346wuhU7/LQiyban9VxS7xdm 1FqAFZWP6wLKxlL8Tsksxnx9yZ1LYd6aE4TkiGavNpSGfQ9HAmuPxMZ8eDzMpXzDKIN5 hB7w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=EhueQjbwjy3XIJG8eyEvYW5MNVNUoEyuA9tJ7a5l93w=; fh=dsaKuUy+diNsKBLkGqX6+MZ0I/w5x96VpcB/Oz61E9E=; b=icZGnQ0UqlH0AkjtgOjOF6IDEIauljKXWRIUOpP3o6Kb7TuwbqPDWfGuQSe/QN+xTF 0Qqp1HPrUF+luqEou5Lhjcq3gJf0BgANCDj2COwrZGVa9arT0li4fzS/NwgeoC5X4+NU 6UUwMYynqh2WBcgtbkQlTIBZpEufNqSXCo3GG8NHefP0tiE72kN4cL61KUNtPqeXNqH4 0BIvx2j3F6gsbx16vNhbozI6cMvxXHPWQLbq5JYF4+pqkuqBe/AH4zkDpsp6XG+Zb4et MG9AvRYuQDZBIPYRtXo6BVR5UchdF2OB4GVv0WMXrxP08xgG4JWNbg+BxlVBhzS1+Zj0 XZww==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VhF4F9uH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51004-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51004-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCUKh1CSLvm7wRH0mMC5SV5C7d4rp5fb6ZHcq45WtAeEQLGhIFH6ItRix+MK3shyzkVzRMGRm11bMziVFtiRIiFxTF/vnju+ZEyD1ttVKg== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id l12-20020aa7c3cc000000b0055fab93a8aesi1620162edr.613.2024.02.03.01.10.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 01:10:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51004-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=VhF4F9uH; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-51004-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51004-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 7A8BD1F2D69F for ; Sat, 3 Feb 2024 09:10:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BDCA6EB43; Sat, 3 Feb 2024 09:02:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="VhF4F9uH" 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 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-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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. -- 2.34.1