From: Zhang Rui <rui.zhang@intel.com>
To: rafael.j.wysocki@intel.com, lenb@kernel.org
Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org
Subject: [PATCH 2/4] tools/power turbostat: Exit on unsupported Vendors
Date: Tue, 3 Dec 2024 15:51:17 +0800 [thread overview]
Message-ID: <20241203075119.584419-3-rui.zhang@intel.com> (raw)
In-Reply-To: <20241203075119.584419-1-rui.zhang@intel.com>
Turbostat currently supports x86 processors from Intel, AMD, and Hygon.
The behavior of turbostat on CPUs from other vendors has not been
evaluated and may lead to incorrect or undefined behavior.
Enhance turbostat to exit by default when running on an unsupported CPU
vendor. This ensures that users are aware that their CPU is not
currently supported by turbostat, guiding them to seek support for their
specific hardware through future patches.
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
---
tools/power/x86/turbostat/turbostat.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/power/x86/turbostat/turbostat.c b/tools/power/x86/turbostat/turbostat.c
index bb65c5e1273c..508d65e60981 100644
--- a/tools/power/x86/turbostat/turbostat.c
+++ b/tools/power/x86/turbostat/turbostat.c
@@ -1056,9 +1056,9 @@ void probe_platform_features(unsigned int family, unsigned int model)
{
int i;
- platform = &default_features;
if (authentic_amd || hygon_genuine) {
+ platform = &default_features;
if (max_extended_level >= 0x80000007) {
unsigned int eax, ebx, ecx, edx;
@@ -1071,7 +1071,7 @@ void probe_platform_features(unsigned int family, unsigned int model)
}
if (!genuine_intel)
- return;
+ goto end;
for (i = 0; turbostat_pdata[i].features; i++) {
if (VFM_FAMILY(turbostat_pdata[i].vfm) == family && VFM_MODEL(turbostat_pdata[i].vfm) == model) {
@@ -1080,6 +1080,10 @@ void probe_platform_features(unsigned int family, unsigned int model)
}
}
+end:
+ if (platform)
+ return;
+
fprintf(stderr, "Unsupported platform detected.\n"
"\tTo get latest turbostat support, please contact\n"
"\t lenb@kernel.org\n"
--
2.43.0
next prev parent reply other threads:[~2024-12-03 7:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-03 7:51 [PATCH 0/4] tools/power turbostat: Improve handling for unsupported platforms Zhang Rui
2024-12-03 7:51 ` [PATCH 1/4] tools/power turbostat: Exit on unsupported Intel models Zhang Rui
2024-12-03 16:43 ` Len Brown
2024-12-03 7:51 ` Zhang Rui [this message]
2024-12-03 7:51 ` [PATCH 3/4] tools/power turbostat: Improve --help output Zhang Rui
2024-12-03 7:51 ` [PATCH 4/4] tools/power turbostat: Introduce --force parameter Zhang Rui
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=20241203075119.584419-3-rui.zhang@intel.com \
--to=rui.zhang@intel.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rafael.j.wysocki@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
all inboxes | Powered by JetHome®