summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2022-12-16 10:37:04 +0100
committerJean Delvare <jdelvare@suse.de>2022-12-16 10:37:04 +0100
commit3d6835047f80691678e5db3127f9d573956413f0 (patch)
tree18084540bca8b09a231d60d96a52a46693c7d157
parentc1a2520433a31294fe9a0ccb52136d048f2d76e6 (diff)
downloaddmidecode-git-3d6835047f80691678e5db3127f9d573956413f0.tar.gz
dmidecode: Drop the CPUID exception list
Back in 2003, I had a system where the CPU type was not set. I added a quirk so that it would still be recognized as x86, and the CPUID could be decoded. A few more exceptions where added over the years, but in effect, the list was last modified in 2008. Having such an exception list isn't actually a good idea, for the following reasons: * It requires endless maintenance work if we want to keep it up-to-date. * It adds some (admittedly minimal) burden to the sane systems. * If we were to add more entries to the exception list, it wouldn't scale well (linear algorithmic complexity). This could be improved but at the cost of more complex code. * It sends the wrong message to the hardware manufacturers ("You can get things wrong, we'll add a workaround on our side.") Therefore I would like to get rid of this exception list. Doing so has the nice side effect of simplifying the code and making the binary smaller. If anyone really needs the CPUID information on such non-compliant systems, there are other ways to retrieve it, such as lscpu or /proc/cpuinfo. Signed-off-by: Jean Delvare <jdelvare@suse.de>
-rw-r--r--dmidecode.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/dmidecode.c b/dmidecode.c
index 5aea33e..e2fc882 100644
--- a/dmidecode.c
+++ b/dmidecode.c
@@ -1105,24 +1105,6 @@ static enum cpuid_type dmi_get_cpuid_type(const struct dmi_header *h)
|| (type >= 0xB6 && type <= 0xB7) /* AMD */
|| (type >= 0xE4 && type <= 0xEF)) /* AMD */
return cpuid_x86_amd;
- else if (type == 0x01 || type == 0x02)
- {
- const char *version = dmi_string(h, data[0x10]);
- /*
- * Some X86-class CPU have family "Other" or "Unknown". In this case,
- * we use the version string to determine if they are known to
- * support the CPUID instruction.
- */
- if (strncmp(version, "Pentium III MMX", 15) == 0
- || strncmp(version, "Intel(R) Core(TM)2", 18) == 0
- || strncmp(version, "Intel(R) Pentium(R)", 19) == 0
- || strcmp(version, "Genuine Intel(R) CPU U1400") == 0)
- return cpuid_x86_intel;
- else if (strncmp(version, "AMD Athlon(TM)", 14) == 0
- || strncmp(version, "AMD Opteron(tm)", 15) == 0
- || strncmp(version, "Dual-Core AMD Opteron(tm)", 25) == 0)
- return cpuid_x86_amd;
- }
/* neither X86 nor ARM */
return cpuid_none;