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: 196253 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp985656dyc; Sat, 3 Feb 2024 04:15:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGmGgmj0hz99vPO4aSBLFBA7r+8GA/n9NZDu2HbVkJFH6yT54i9JWI9ptJVxuNngNMIKsH X-Received: by 2002:a05:6214:2622:b0:68c:746f:734b with SMTP id gv2-20020a056214262200b0068c746f734bmr1750532qvb.26.1706962509866; Sat, 03 Feb 2024 04:15:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706962509; cv=pass; d=google.com; s=arc-20160816; b=S+wTZZucqjioPr9ScTIweArkc0wx8b81OtSW3+tCf/ZRgoEskIl7bnkGAm6SmWMKwI xHaPO7JW3XmX8jAhN+cWgE69GF0IqUAmTkagNFefw2uWgiNmLqJCXoKqiaRz4iGpCJLT NBHrQiIv8gC307z6tXS+bvAiIObrzHiR8b8uWGEkK8mpFdDCAmK7VhwSDFkZORWS4GlH STqOpelb4aSJVkmC02pGwLgyBi6iLG7E4piIWy0VcVoFbC3V0sMdgc6WFUgcdz13PU8x 6aJ7FOTU4tOUTKBydScENUMmfTLkOc8cqLLOoWpy/253PErdvWIcZaCRfstlzMKQBd7o //sg== 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=jgf4Hta0rdwPUhzaXZB6W7vdBzWFGrq9vgA4Wl0cgUo=; b=OsfFQzXhE43M3NLD8Igp4sTSAotsxeYZ5q0dk555jxabRIvgZ98at0GneFC4w09b8y Q+/Z2T3JvrIssNGCa86WnSMjy1KUIj95NvjgZiXWHHZRuGG3pugyHsHdD3f8JVwAF6zp U0+2BP0zvwYqnMSyHBad7cZBiGVe2vJfU90WuKUx0yO6tHVUElQGeNy5iK/ApW0xGP6h jRvwYHwqbhFCq74T599UDKZIKTD4Upyc/jdW0A/Nny0pvHxQORttrImwBaZni+pKhyz5 p2B7s6vx8B2zQX89rgt8RfDRGEOcxYo/TPfhEhC4B3u/+Ljn170Wg6mNdk+MNtgMLezL 3r1w==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51004-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCU5w+cJ7ZbxT5on7ape9aNvirYNS5XvtpRy2YMQG8oyBodm59lj/kXe+KBIredjJz6MiuxZmAjH2bzLScBijVN33gKc8A== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id df9-20020a056214080900b0068c5c709faasi4166416qvb.171.2024.02.03.04.15.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 04:15:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-51004-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; 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-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-51004-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id CF4F31C27548 for ; Sat, 3 Feb 2024 09:10:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E2CE5EE80; Sat, 3 Feb 2024 09:02:19 +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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789879920916337042 X-GMAIL-MSGID: 1789879920916337042 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.