dmidecode-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dmidecode] [PATCH] dmidecode: Drop the CPUID exception list


From: Jean Delvare
Subject: [dmidecode] [PATCH] dmidecode: Drop the CPUID exception list
Date: Fri, 30 Sep 2022 10:59:51 +0200

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>
---
 dmidecode.c |   18 ------------------
 1 file changed, 18 deletions(-)

--- dmidecode.orig/dmidecode.c
+++ dmidecode/dmidecode.c
@@ -1105,24 +1105,6 @@ static enum cpuid_type dmi_get_cpuid_typ
              || (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;


-- 
Jean Delvare
SUSE L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]