The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: Hans de Goede <hansg@kernel.org>,
	platform-driver-x86@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] platform/x86: ISST: Avoid model check for recent servers
Date: Tue, 18 Aug 2026 16:03:20 +0300 (EEST)	[thread overview]
Message-ID: <9cbea11b-ef1c-cda5-8fdd-e9cff29612ff@linux.intel.com> (raw)
In-Reply-To: <20260729180512.2048114-1-srinivas.pandruvada@linux.intel.com>

On Wed, 29 Jul 2026, Srinivas Pandruvada wrote:

> To enable SST functions, a CPU model entry is required. This causes
> unnecessary delays in deploying new servers on older kernels.
> 
> To avoid this, if no CPU model match is found, allow the SST common
> driver to load, when all of the following conditions are met:
> 
> - Not running as a guest
> - The platform is identified as a server via ACPI PM profile
> - The CPU belongs to Intel family 0x19

Hi,

Sashiko notes this shouldn't be hex (and is contradicting with the code 
that uses decimal)? 

-- 
 i.


> - MSR 0x54 is present to retrieve the PM logical ID
> 
> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
> ---
>  .../intel/speed_select_if/isst_if_common.c    | 61 ++++++++++++++++++-
>  1 file changed, 60 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
> index 1c48bf6d5457..8b87dec2a4cd 100644
> --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
> +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c
> @@ -7,6 +7,7 @@
>   * Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>   */
>  
> +#include <linux/acpi.h>
>  #include <linux/cpufeature.h>
>  #include <linux/cpuhotplug.h>
>  #include <linux/fs.h>
> @@ -774,6 +775,58 @@ void isst_if_cdev_unregister(int device_type)
>  }
>  EXPORT_SYMBOL_GPL(isst_if_cdev_unregister);
>  
> +#ifdef CONFIG_ACPI
> +
> +static bool acpi_pm_profile_server(void)
> +{
> +	if (acpi_gbl_FADT.preferred_profile == PM_ENTERPRISE_SERVER ||
> +	    acpi_gbl_FADT.preferred_profile == PM_PERFORMANCE_SERVER)
> +		return true;
> +
> +	return false;
> +}
> +
> +#else
> +
> +static bool acpi_pm_profile_server(void)
> +{
> +	return false;
> +}
> +
> +#endif
> +
> +static const struct x86_cpu_id sst_allowed_families[] = {
> +	X86_MATCH_VENDOR_FAM(INTEL, 19, NULL),
> +	{}
> +};
> +
> +static bool isst_features_allowed(void)
> +{
> +	const struct x86_cpu_id *id;
> +	u64 data;
> +	int ret;
> +
> +	/* For hypervisors, explicit model addition is required */
> +	if (cpu_feature_enabled(X86_FEATURE_HYPERVISOR))
> +		return false;
> +
> +	/* SST is server only feature */
> +	if (!acpi_pm_profile_server())
> +		return false;
> +
> +	/* Match for family 19 only */
> +	id = x86_match_cpu(sst_allowed_families);
> +	if (!id)
> +		return false;
> +
> +	/* Check for presence of MSR 0x54 */
> +	ret = rdmsrq_safe(MSR_PM_LOGICAL_ID, &data);
> +	if (ret)
> +		return false;
> +
> +	return true;
> +}
> +
>  #define SST_HPM_SUPPORTED	0x01
>  #define SST_MBOX_SUPPORTED	0x02
>  
> @@ -798,8 +851,13 @@ static int __init isst_if_common_init(void)
>  	const struct x86_cpu_id *id;
>  
>  	id = x86_match_cpu(isst_cpu_ids);
> -	if (!id)
> +	if (!id) {
> +		if (isst_features_allowed()) {
> +			isst_hpm_support = true;
> +			goto misc_reg;
> +		}
>  		return -ENODEV;
> +	}
>  
>  	if (id->driver_data == SST_HPM_SUPPORTED) {
>  		isst_hpm_support = true;
> @@ -812,6 +870,7 @@ static int __init isst_if_common_init(void)
>  			return -ENODEV;
>  	}
>  
> +misc_reg:
>  	return isst_misc_reg();
>  }
>  module_init(isst_if_common_init)
> 

  reply	other threads:[~2026-08-18 13:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-29 18:05 [PATCH] platform/x86: ISST: Avoid model check for recent servers Srinivas Pandruvada
2026-08-18 13:03 ` Ilpo Järvinen [this message]
2026-08-18 13:19   ` 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=9cbea11b-ef1c-cda5-8fdd-e9cff29612ff@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=srinivas.pandruvada@linux.intel.com \
    /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