Message ID | 20240203091214.411862-18-zhao1.liu@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-50995-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp1087732dyc; Sat, 3 Feb 2024 08:05:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFgm6CO20XSE1vqgLj300U+Z+FbihZne4PqQKBgLwNm45XoRS3UakTHSv0F43j0FTo4EH5Q X-Received: by 2002:a05:6a20:4285:b0:19e:4e41:7ae0 with SMTP id o5-20020a056a20428500b0019e4e417ae0mr2488490pzj.20.1706976300606; Sat, 03 Feb 2024 08:05:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706976300; cv=pass; d=google.com; s=arc-20160816; b=PrKuJXcY4r98EnwsOsbCDM72U1Y4efd3wcNbPPw+w5aZZYmcVl62GbRnMh9r1aNlj0 244lAKq04Q0kBqDfKOVNYRgsPPxzvN2gIshYDiDPcWuym2nbFymSbQ342Rm3EsMcfbIO Gsszh+ozA284xvApUHM0qoKyeiIGNP5Mc1YcXmCfb1NRID51MtDWnMb75DPHYdouYnw7 +IJOWZRWuNp7WyR6BgM3rNl6PmkUihwh+Jefe5kZ8RF1k/zZ9HmJbafY0vapmVOlAuJg aYmoz/5Zs5knKqoam5sPCGw6ImqulHrrhu+ZlkzNf/RXHudcFd90K36+NMTa+AtMfTcd AUHA== 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=u7iQHIbBvtTKzSPzobrhjZTLXH+UzZsELcRawFJp4Ck=; fh=Lhz2qcG7myzsv/cZ2zKMxB5peDgmyCmn08qySPN5O0c=; b=MHXvu5wS80gkXav0/ztF2h1IhVitwYPuyUYSe8zH/urYqpRmmQL8oItTjFvY4ztPko aQZ7OljlkyumlzQakOZ4XQhqredI+tACLc1xFGcaS63NPjmF0tVe19tW/BjZn8nwOqtt NfjM9cIkTBxutf/4ODTb4qSw35dG+zodaRj4LXX7Q+SP4n/VI2GED38otOnwzN80xKOy O+Lsii4vVzcow1gr2rQE2OlwdjDRo5jYZEEw8A9p/BG6OVSzfgf+UJV1MHAHxvmwEzKn 45f2htqBmk8JwfVGJp3sAII5fhKljCVoPdCPWg27EsAX1/A05bvzZem+AuX39FTS/ye6 aL+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AWRm4P9l; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-50995-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50995-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Forwarded-Encrypted: i=1; AJvYcCVBY6C5eUPNt4Ti9//L5k5UsLNuLXM77nCKhejP0LPW2+E39/jKBjRV5477O+Fj54N36waLA3HEukcfO2jFR8JMPumT/A== Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id 2-20020a631842000000b005dbd0ff2e5dsi3380093pgy.811.2024.02.03.08.05.00 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Feb 2024 08:05:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50995-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AWRm4P9l; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-50995-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50995-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 81A43B2AFAD for <ouuuleilei@gmail.com>; Sat, 3 Feb 2024 09:06:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2605D612DF; Sat, 3 Feb 2024 09:01:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AWRm4P9l" 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 EB9C45D489; Sat, 3 Feb 2024 09:01:24 +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=1706950886; cv=none; b=hqfQireyjwqG8rMVmn70vqkSPtYmPr6+y95c9cC4zpNyPlqkPI8pteJ5dtfA1y3eqc1aOY3a8jWcabAKRwsT6Sd1zU/puyTFivwdAQWiflqF3eTyYw7uDHxnbN/1kBKtzRvbk5594gUDcCJCrb6B7lhh6tCUtq6eOOG9bdubNtY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706950886; c=relaxed/simple; bh=SMoF3nIPJhY2CvvIts5nS/Mk2TwIlNjiRdux5w3q9k8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=L7e0QZd/iimOaJ4hsH9HHb+Kw7D9wWlFTsHEcEbf7RmGAreprzaUFaInu8pGbog5L844+lHDd+uSHwSEK1ouAifXE7iOs4KsGTOc/ixm5fjMkK77ZsU1bIy0k/DOUR18r4aCT92d42zF9BqNyjJu6QfQBEDlHQ3p/pjoIfq5xGs= 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=AWRm4P9l; 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=1706950885; x=1738486885; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SMoF3nIPJhY2CvvIts5nS/Mk2TwIlNjiRdux5w3q9k8=; b=AWRm4P9lOt9jckK0W6gew+9NvQoJCEKUaNX1QZvA+GPVwjjGfwPc3xeF Bmuq7/zV05gFQQJ8S0ZoER1p0C77FBuQ+7LWgh1gMgXFvaMh/qHKgdm8o NE2qS4A/HESDHIQPVfXSmIBjkFqKpf4oNTT+Y5p6xjSo0r/zrGtvW9zZJ ej0ueyTlte1W+ROoNk27EhYW6uKxwNZVKSExFSl1mdpCADYgNOcHa7V/W lTdCaUknK8FuwX+djLi0oBdZzjcUfpZDfwEiLZCadmHntxdmzZ6HagHp0 Rlpny6jWxckhzUdAr19vGRC3++m4Xb0q2lskJ1P+ZCl+CQWqBL15D31bC A==; X-IronPort-AV: E=McAfee;i="6600,9927,10971"; a="4132070" X-IronPort-AV: E=Sophos;i="6.05,240,1701158400"; d="scan'208";a="4132070" 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:01:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.05,240,1701158400"; d="scan'208";a="291478" Received: from liuzhao-optiplex-7080.sh.intel.com ([10.239.160.36]) by fmviesa009.fm.intel.com with ESMTP; 03 Feb 2024 01:01:17 -0800 From: Zhao Liu <zhao1.liu@linux.intel.com> To: Paolo Bonzini <pbonzini@redhat.com>, Sean Christopherson <seanjc@google.com>, "Rafael J . Wysocki" <rafael@kernel.org>, Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>, Dave Hansen <dave.hansen@linux.intel.com>, "H . Peter Anvin" <hpa@zytor.com>, kvm@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org Cc: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>, Len Brown <len.brown@intel.com>, Zhang Rui <rui.zhang@intel.com>, Zhenyu Wang <zhenyu.z.wang@intel.com>, Zhuocheng Ding <zhuocheng.ding@intel.com>, Dapeng Mi <dapeng1.mi@intel.com>, Yanting Jiang <yanting.jiang@intel.com>, Yongwei Ma <yongwei.ma@intel.com>, Vineeth Pillai <vineeth@bitbyteword.org>, Suleiman Souhlal <suleiman@google.com>, Masami Hiramatsu <mhiramat@google.com>, David Dai <davidai@google.com>, Saravana Kannan <saravanak@google.com>, Zhao Liu <zhao1.liu@intel.com> Subject: [RFC 17/26] KVM: VMX: Allow to inject thermal interrupt without HFI update Date: Sat, 3 Feb 2024 17:12:05 +0800 Message-Id: <20240203091214.411862-18-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: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789894381759325891 X-GMAIL-MSGID: 1789894381759325891 |
Series |
Intel Thread Director Virtualization
|
|
Commit Message
Zhao Liu
Feb. 3, 2024, 9:12 a.m. UTC
From: Zhao Liu <zhao1.liu@intel.com> When the HFI table memory address is set by MSR_IA32_HW_FEEDBACK_PTR or when MSR_IA32_HW_FEEDBACK_CONFIG enables the HFI feature, the hardware sends an initial HFI notification via thermal interrupt and sets the thermal status bit. To prepare for the above cases, extend vmx_update_hfi_table() to allow the forced thermal interrupt injection (with the thermal status bit set) regardless of whether there is the HFI table change to be updated. Tested-by: Yanting Jiang <yanting.jiang@intel.com> Signed-off-by: Zhao Liu <zhao1.liu@intel.com> --- arch/x86/kvm/vmx/vmx.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kvm/vmx/vmx.c b/arch/x86/kvm/vmx/vmx.c index 44c09c995120..97bb7b304213 100644 --- a/arch/x86/kvm/vmx/vmx.c +++ b/arch/x86/kvm/vmx/vmx.c @@ -1616,7 +1616,7 @@ static int vmx_build_hfi_table(struct kvm *kvm) return 1; } -static void vmx_update_hfi_table(struct kvm *kvm) +static void vmx_update_hfi_table(struct kvm *kvm, bool forced_int) { struct kvm_vmx *kvm_vmx = to_kvm_vmx(kvm); struct hfi_desc *kvm_vmx_hfi = &kvm_vmx->pkg_therm.hfi_desc; @@ -1635,7 +1635,7 @@ static void vmx_update_hfi_table(struct kvm *kvm) } ret = vmx_build_hfi_table(kvm); - if (ret <= 0) + if (ret < 0 || (!ret && !forced_int)) return; kvm_vmx_hfi->hfi_update_status = true; @@ -1731,7 +1731,7 @@ static void vmx_dynamic_update_hfi_table(struct kvm_vcpu *vcpu) * of the same VM are sharing the one HFI table. Therefore, one * vCPU can update the HFI table for the whole VM. */ - vmx_update_hfi_table(vcpu->kvm); + vmx_update_hfi_table(vcpu->kvm, false); mutex_unlock(&kvm_vmx->pkg_therm.pkg_therm_lock); }