X86 platform drivers
 help / color / mirror / Atom feed
From: srinivas pandruvada <srinivas.pandruvada@linux.intel.com>
To: lirongqing <lirongqing@baidu.com>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	platform-driver-x86@vger.kernel.org
Subject: Re: [PATCH] platform/x86: ISST: Check HWP support before MSR access
Date: Sat, 28 Feb 2026 15:01:55 -0800	[thread overview]
Message-ID: <30ec4399cc038ee2471a7ba158a0139637103756.camel@linux.intel.com> (raw)
In-Reply-To: <20260228122441.2284-1-lirongqing@baidu.com>

On Sat, 2026-02-28 at 07:24 -0500, lirongqing wrote:
> From: Li RongQing <lirongqing@baidu.com>
> 
> On some systems, HWP can be explicitly disabled in the BIOS settings
> When HWP is disabled by firmware, the HWP CPUID bit is not set, and
> attempting to read MSR_PM_ENABLE will result in a General Protection
> (GP) fault.
> 
> [  426.715441] unchecked MSR access error: RDMSR from 0x770 at rIP:
> 0xffffffffc33db92e (disable_dynamic_sst_features+0xe/0x50
> [isst_tpmi_core])
> [  426.715450] Call Trace:
> [  426.715453]  <TASK>
> [  426.715454]  ? ex_handler_msr+0xf6/0x150
> [  426.715461]  ? fixup_exception+0x1ad/0x340
> [  426.715462]  ? gp_try_fixup_and_notify+0x1e/0xb0
> [  426.715466]  ? exc_general_protection+0xc9/0x390
> [  426.715470]  ? terminate_walk+0x64/0x100
> [  426.715474]  ? asm_exc_general_protection+0x22/0x30
> [  426.715477]  ? disable_dynamic_sst_features+0xe/0x50
> [isst_tpmi_core]
> [  426.715480]  isst_if_def_ioctl+0xece/0x1050 [isst_tpmi_core]
> [  426.715484]  ? ioctl_has_perm.constprop.42+0xe0/0x130
> [  426.715489]  isst_if_def_ioctl+0x10d/0x1a0 [isst_if_common]
> [  426.715495]  __se_sys_ioctl+0x86/0xc0
> [  426.715498]  do_syscall_64+0x8a/0x100
> [  426.715500]  entry_SYSCALL_64_after_hwframe+0x78/0xe2
> [  426.715503] RIP: 0033:0x7f36eaef54a7
> 
> Add a check for X86_FEATURE_HWP before accessing the MSR. If HWP is
> not available, return false safely.
> 
> Fixes: 12a7d2cb811dd8a ("platform/x86: ISST: Add SST-CP support via
> TPMI")
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> ---
>  drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git
> a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> index b8cdaa2..6f46cbb 100644
> --- a/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> +++ b/drivers/platform/x86/intel/speed_select_if/isst_tpmi_core.c
> @@ -558,6 +558,9 @@ static bool disable_dynamic_sst_features(void)
>  {
>  	u64 value;
>  
> +	if (!static_cpu_has(X86_FEATURE_HWP))
> +		return true;
> +
>  	rdmsrq(MSR_PM_ENABLE, value);
>  	return !(value & 0x1);
>  }

  reply	other threads:[~2026-02-28 23:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 12:24 [PATCH] platform/x86: ISST: Check HWP support before MSR access lirongqing
2026-02-28 23:01 ` srinivas pandruvada [this message]
2026-02-28 23:03 ` srinivas pandruvada
2026-03-02  2:20 ` 答复: " Li,Rongqing(ACG CCN)
2026-03-02 16:16   ` srinivas pandruvada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30ec4399cc038ee2471a7ba158a0139637103756.camel@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lirongqing@baidu.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox