CPU (Windows): try detecting invalid data in SMBIOS

Work around #800
This commit is contained in:
李通洲
2024-04-21 17:57:32 +08:00
parent 4580f3fd54
commit aa58a0999d
+5 -6
View File
@@ -64,13 +64,12 @@ static const char* detectMaxSpeedBySmbios(FFCPUResult* cpu)
return "No active CPU is found in SMBIOS data";
}
if (data->MaxSpeed > 0 && data->MaxSpeed < 30000) // VMware reports weird values
{
double speed = data->MaxSpeed / 1000.0;
if (cpu->frequencyBase < speed)
cpu->frequencyMax = speed;
}
double speed = data->MaxSpeed / 1000.0;
// Sometimes SMBIOS reports invalid value. We assume that max speed is small than 2x of base
if (speed < cpu->frequencyBase || speed > cpu->frequencyBase * 2)
return "Possible invalid CPU max speed in SMBIOS data. See #800";
cpu->frequencyMax = speed;
return NULL;
}