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>
Signed-off-by: Len Brown <len.brown@intel.com>
{
int i;
- platform = &default_features;
if (authentic_amd || hygon_genuine) {
+ platform = &default_features;
if (max_extended_level >= 0x80000007) {
unsigned int eax, ebx, ecx, edx;
}
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) {
}
}
+end:
+ if (platform)
+ return;
+
fprintf(stderr, "Unsupported platform detected.\n"
"\tSee RUN THE LATEST VERSION on turbostat(8)\n");
exit(1);