From nobody Mon Apr 13 03:42:13 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=vates.tech ARC-Seal: i=1; a=rsa-sha256; t=1771254571; cv=none; d=zohomail.com; s=zohoarc; b=jSSMm5q6b/dRQjqd/TdkTGS3eEfsz9sRHzfy7IS1MnOIYRZxvL17Z8T+hMS+8cLa7+EUPDuyqhyaiftyJ+twCRvudcRqRL09qfVZ6nFrYq1EfeBw2N3w1X20+mNf8PXEO8Q2gMWkJL8X0QWeCsVznH3mDS657enLSiWSWCyRHjE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771254571; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MNh9V4qzhn2ZOOkfvPZMwx5Ld1KsvgvSoYa8cKgDe8M=; b=JnM+nZLK+ivj/2rjcvg2VyvIwnRDSKELOB7CFhe3qyF8EV5gXMugJ2w0tozkqLxkvorAMbMPh2sXJH2sds1fXIUG2U/3r5HCRHUWBbyHuY6B33tMXR887A11NC6mTuHncvACYAaBNdagLAISH1yGIpgWqHItDegJDc3WOWkqB3U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=teddy.astie@vates.tech; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1771254571173513.1836819727599; Mon, 16 Feb 2026 07:09:31 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.1234255.1537558 (Exim 4.92) (envelope-from ) id 1vs0Do-0004xu-JL; Mon, 16 Feb 2026 15:09:12 +0000 Received: by outflank-mailman (output) from mailman id 1234255.1537558; Mon, 16 Feb 2026 15:09:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vs0Do-0004xn-GO; Mon, 16 Feb 2026 15:09:12 +0000 Received: by outflank-mailman (input) for mailman id 1234255; Mon, 16 Feb 2026 15:09:10 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1vs0Dm-0004xf-HK for xen-devel@lists.xenproject.org; Mon, 16 Feb 2026 15:09:10 +0000 Received: from mail187-15.suw11.mandrillapp.com (mail187-15.suw11.mandrillapp.com [198.2.187.15]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 7127173b-0b49-11f1-b163-2bf370ae4941; Mon, 16 Feb 2026 16:09:09 +0100 (CET) Received: from pmta09.mandrill.prod.suw01.rsglab.com (localhost [127.0.0.1]) by mail187-15.suw11.mandrillapp.com (Mailchimp) with ESMTP id 4fF5lR4ctPzPm0PmZ for ; Mon, 16 Feb 2026 15:09:07 +0000 (GMT) Received: from [37.26.189.201] by mandrillapp.com id 5066572243034d21a92e9fbd6e222e04; Mon, 16 Feb 2026 15:09:07 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 7127173b-0b49-11f1-b163-2bf370ae4941 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandrillapp.com; s=mte1; t=1771254547; x=1771524547; bh=MNh9V4qzhn2ZOOkfvPZMwx5Ld1KsvgvSoYa8cKgDe8M=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=AvXpHF0kTk6Uhw1AQ/kcv+N/GJyi05LRRWj6cENq0a5PAN9xfuntGvfutNxpVG4Ud OjLVQiAQBOfIdXxBlVNtBX5K4WFPWZUjTnBr+daBpXOhjJPwJRX3q7x70ywnVlG4s8 A2xnQrC/2ets+RTwkvF4/zp/j7bvH6s4kQvSN4X3q9g6VF1Z5cwCVlryExSor9EgZ3 wOMQsDBPwz/N96bMDEEmyu5qrZdSk5i3kH7LeD+OEMgBjFF9LtKN4UZ1mon1McrDTp pCDwHT7ro+jvONFA8vlHsB+1hegVMoZQ4dw3+5bFvVUEQRNaaPU5nM9S7vCMxLivR1 NPZE4yOlRQHqA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vates.tech; s=mte1; t=1771254547; x=1771515047; i=teddy.astie@vates.tech; bh=MNh9V4qzhn2ZOOkfvPZMwx5Ld1KsvgvSoYa8cKgDe8M=; h=From:Subject:To:Cc:Message-Id:Feedback-ID:Date:MIME-Version: Content-Type:Content-Transfer-Encoding:CC:Date:Subject:From; b=I0cAxBS+QqRl/lEqnvZKVDVxpBCqLLYpsjYfXPGDbuPQQdqU89D3cfwdjeAPoCi+U YOpiwuPMLV01LNR4bba9/w2Fh0FvYpMZSNJOLDGG5wd2UvIBnNwG0Pu2WlBE14YLsm LnaYvrGyJMy6vJzqmzBEwB371hC/4IuhzA4Oog3Tn6Cq7HtXD1a8xRVU5RcXExwuHm 7zJk66cwi3sHo4thwJhc+kU1wK3x496cvkoIhnLoX4uZe36B4W4nLqaybTRzxA4q5w NY5IcXXV7uhOSLuLx9b/OllmX1Mvm+V2FTbdKwLDITY9eW7CAk8dsCLgLgngNFVrCW U40aTdDsR7Eog== From: "Teddy Astie" Subject: =?utf-8?Q?[PATCH]=20x86/platform:=20Consider=20PTM=20for=20exposing=20package-related=20MSR?= X-Mailer: git-send-email 2.53.0 X-Bm-Disclaimer: Yes X-Bm-Milter-Handled: 4ffbd6c1-ee69-4e1b-aabd-f977039bd3e2 X-Bm-Transport-Timestamp: 1771254546639 To: xen-devel@lists.xenproject.org Cc: "Teddy Astie" , "Jan Beulich" , "Andrew Cooper" , "=?utf-8?Q?Roger=20Pau=20Monn=C3=A9?=" , "Tu Dinh" Message-Id: X-Native-Encoded: 1 X-Report-Abuse: =?UTF-8?Q?Please=20forward=20a=20copy=20of=20this=20message,=20including=20all=20headers,=20to=20abuse@mandrill.com.=20You=20can=20also=20report=20abuse=20here:=20https://mandrillapp.com/contact/abuse=3Fid=3D30504962.5066572243034d21a92e9fbd6e222e04?= X-Mandrill-User: md_30504962 Feedback-ID: 30504962:30504962.20260216:md Date: Mon, 16 Feb 2026 15:09:07 +0000 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity teddy.astie@vates.tech) (identity @mandrillapp.com) X-ZM-MESSAGEID: 1771254573455154100 Content-Type: text/plain; charset="utf-8" Package-related MSR is actually gated behind "PTM" CPUID flag rather than "DTS" one. Make sure we check the right CPUID for package-related MSR. Check for either DTS or PTM for MSR_TEMPERATURE_TARGET. The only visible difference in practice would be that EPERM would now be reported instead of EFAULT if we tried accessing the package MSR on a platform that doesn't have it. Amends: 615c9f3f820 ("x86/platform: Expose DTS sensors MSR") Reported-by: Tu Dinh Signed-off-by: Teddy Astie --- xen/arch/x86/platform_hypercall.c | 5 ++++- xen/include/xen/lib/x86/cpu-policy.h | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/platform_hypercall.c b/xen/arch/x86/platform_hype= rcall.c index c6c5135806..a52fed3bd6 100644 --- a/xen/arch/x86/platform_hypercall.c +++ b/xen/arch/x86/platform_hypercall.c @@ -89,9 +89,12 @@ static bool msr_read_allowed(unsigned int msr) return cpu_has_srbds_ctrl; =20 case MSR_IA32_THERM_STATUS: + return host_cpu_policy.basic.digital_temp_sensor; case MSR_TEMPERATURE_TARGET: + return host_cpu_policy.basic.digital_temp_sensor || + host_cpu_policy.basic.package_therm_management; case MSR_PACKAGE_THERM_STATUS: - return host_cpu_policy.basic.digital_temp_sensor; + return host_cpu_policy.basic.package_therm_management; } =20 if ( ppin_msr && msr =3D=3D ppin_msr ) diff --git a/xen/include/xen/lib/x86/cpu-policy.h b/xen/include/xen/lib/x86= /cpu-policy.h index db8d035589..d9d57e932a 100644 --- a/xen/include/xen/lib/x86/cpu-policy.h +++ b/xen/include/xen/lib/x86/cpu-policy.h @@ -132,7 +132,7 @@ struct cpu_policy :1, :1, :1, - :1, + package_therm_management:1, hwp:1, hwp_interrupt:1, hwp_activity_window:1, --=20 2.53.0 -- Teddy Astie | Vates XCP-ng Developer XCP-ng & Xen Orchestra - Vates solutions web: https://vates.tech