diff --git a/SOURCES/0001-dmidecode-Add-processor-support-from-SMBIOS-3.6.0.patch b/SOURCES/0001-dmidecode-Add-processor-support-from-SMBIOS-3.6.0.patch new file mode 100644 index 0000000..f6c720c --- /dev/null +++ b/SOURCES/0001-dmidecode-Add-processor-support-from-SMBIOS-3.6.0.patch @@ -0,0 +1,72 @@ +From ac65cf23af7cccecb4175d3c13460928e8e2f51d Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Fri, 26 May 2023 17:41:51 +0200 +Subject: [PATCH] dmidecode: Add processor support from SMBIOS 3.6.0 + +SMBIOS 3.6.0 adds the following to the Processor Information +structure (type 4): +* 9 socket types +* 1 processor family +* 1 field (Thread Enabled) + +Signed-off-by: Jean Delvare +--- + dmidecode.c | 19 ++++++++++++++++--- + 1 file changed, 16 insertions(+), 3 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 75b58b1..0e8a98c 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -974,6 +974,7 @@ static const char *dmi_processor_family(const struct dmi_header *h, u16 ver) + + { 0x100, "ARMv7" }, + { 0x101, "ARMv8" }, ++ { 0x102, "ARMv9" }, + { 0x104, "SH-3" }, + { 0x105, "SH-4" }, + { 0x118, "ARM" }, +@@ -1073,7 +1074,7 @@ static enum cpuid_type dmi_get_cpuid_type(const struct dmi_header *h) + else + return cpuid_80486; + } +- else if ((type >= 0x100 && type <= 0x101) /* ARM */ ++ else if ((type >= 0x100 && type <= 0x102) /* ARM */ + || (type >= 0x118 && type <= 0x119)) /* ARM */ + { + /* +@@ -1415,10 +1416,19 @@ static const char *dmi_processor_upgrade(u8 code) + "Socket BGA1528", + "Socket LGA4189", + "Socket LGA1200", +- "Socket LGA4677" /* 0x3F */ ++ "Socket LGA4677", ++ "Socket LGA1700", ++ "Socket BGA1744", ++ "Socket BGA1781", ++ "Socket BGA1211", ++ "Socket BGA2422", ++ "Socket LGA1211", ++ "Socket LGA2422", ++ "Socket LGA5773", ++ "Socket BGA5773" /* 0x48 */ + }; + +- if (code >= 0x01 && code <= 0x3F) ++ if (code >= 0x01 && code <= 0x48) + return upgrade[code - 0x01]; + return out_of_spec; + } +@@ -4451,6 +4461,9 @@ static void dmi_decode(const struct dmi_header *h, u16 ver) + pr_attr("Thread Count", "%u", + h->length >= 0x30 && data[0x25] == 0xFF ? + WORD(data + 0x2E) : data[0x25]); ++ if (h->length >= 0x32 && WORD(data + 0x30) != 0) ++ pr_attr("Thread Enabled", "%u", ++ WORD(data + 0x30)); + dmi_processor_characteristics("Characteristics", + WORD(data + 0x26)); + break; +-- +2.43.0 + diff --git a/SOURCES/0002-Consistently-use-read_file-when-reading-from-a-dump-.patch b/SOURCES/0002-Consistently-use-read_file-when-reading-from-a-dump-.patch new file mode 100644 index 0000000..e1f41bd --- /dev/null +++ b/SOURCES/0002-Consistently-use-read_file-when-reading-from-a-dump-.patch @@ -0,0 +1,64 @@ +From c76ddda0ba0aa99a55945e3290095c2ec493c892 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Wed, 26 Apr 2023 15:44:27 +0200 +Subject: [PATCH] Consistently use read_file() when reading from a dump file + +Use read_file() instead of mem_chunk() to read the entry point from a +dump file. This is faster, and consistent with how we then read the +actual DMI table from that dump file. + +This made no functional difference so far, which is why it went +unnoticed for years. But now that a file type check was added to the +mem_chunk() function, we must stop using it to read from regular +files. + +This will again allow root to use the --from-dump option. + +Signed-off-by: Jean Delvare +Tested-by: Jerry Hoemann +--- + dmidecode.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 54f59c1..52ddbf1 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -6025,17 +6025,25 @@ int main(int argc, char * const argv[]) + pr_comment("dmidecode %s", VERSION); + + /* Read from dump if so instructed */ ++ size = 0x20; + if (opt.flags & FLAG_FROM_DUMP) + { + if (!(opt.flags & FLAG_QUIET)) + pr_info("Reading SMBIOS/DMI data from file %s.", + opt.dumpfile); +- if ((buf = mem_chunk(0, 0x20, opt.dumpfile)) == NULL) ++ if ((buf = read_file(0, &size, opt.dumpfile)) == NULL) + { + ret = 1; + goto exit_free; + } + ++ /* Truncated entry point can't be processed */ ++ if (size < 0x20) ++ { ++ ret = 1; ++ goto done; ++ } ++ + if (memcmp(buf, "_SM3_", 5) == 0) + { + if (smbios3_decode(buf, opt.dumpfile, 0)) +@@ -6059,7 +6067,6 @@ int main(int argc, char * const argv[]) + * contain one of several types of entry points, so read enough for + * the largest one, then determine what type it contains. + */ +- size = 0x20; + if (!(opt.flags & FLAG_NO_SYSFS) + && (buf = read_file(0, &size, SYS_ENTRY_FILE)) != NULL) + { +-- +2.43.0 + diff --git a/SOURCES/0003-dmidecode-Expand-list-of-recognized-CPU-sockets.patch b/SOURCES/0003-dmidecode-Expand-list-of-recognized-CPU-sockets.patch new file mode 100644 index 0000000..a332064 --- /dev/null +++ b/SOURCES/0003-dmidecode-Expand-list-of-recognized-CPU-sockets.patch @@ -0,0 +1,45 @@ +From 93b819ef7805264dbd0f60015e4c24084ebb091d Mon Sep 17 00:00:00 2001 +From: Armin Wolf +Date: Tue, 19 Dec 2023 17:25:34 +0100 +Subject: [PATCH] dmidecode: Expand list of recognized CPU sockets + +On an AMD Ryzen 5 7600, the Processor Upgrade field +displays due to it not recognizing the +AM5 CPU socket. +Fix this by expanding the list of CPU sockets to match +the list specified in SMBIOS 3.7.0. + +Signed-off-by: Armin Wolf +Signed-off-by: Jean Delvare +--- + dmidecode.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +diff --git a/dmidecode.c b/dmidecode.c +index 77cb2fc..1261749 100644 +--- a/dmidecode.c ++++ b/dmidecode.c +@@ -1453,10 +1453,18 @@ static const char *dmi_processor_upgrade(u8 code) + "Socket LGA1211", + "Socket LGA2422", + "Socket LGA5773", +- "Socket BGA5773" /* 0x48 */ ++ "Socket BGA5773", ++ "Socket AM5", ++ "Socket SP5", ++ "Socket SP6", ++ "Socket BGA883", ++ "Socket BGA1190", ++ "Socket BGA4129", ++ "Socket LGA4710", ++ "Socket LGA7529" /* 0x50 */ + }; + +- if (code >= 0x01 && code <= 0x48) ++ if (code >= 0x01 && code <= 0x50) + return upgrade[code - 0x01]; + return out_of_spec; + } +-- +2.43.0 + diff --git a/SPECS/dmidecode.spec b/SPECS/dmidecode.spec index 84f72b7..341dd48 100644 --- a/SPECS/dmidecode.spec +++ b/SPECS/dmidecode.spec @@ -1,7 +1,7 @@ Summary: Tool to analyse BIOS DMI data Name: dmidecode Version: 3.5 -Release: 1%{?dist} +Release: 3%{?dist} Epoch: 1 License: GPLv2+ Source0: https://download.savannah.gnu.org/releases/%{name}/%{name}-%{version}.tar.xz @@ -9,6 +9,10 @@ URL: https://www.nongnu.org/dmidecode/ BuildRequires: gcc make ExclusiveArch: %{ix86} x86_64 ia64 aarch64 +Patch0: 0001-dmidecode-Add-processor-support-from-SMBIOS-3.6.0.patch +Patch1: 0002-Consistently-use-read_file-when-reading-from-a-dump-.patch +Patch2: 0003-dmidecode-Expand-list-of-recognized-CPU-sockets.patch + %description dmidecode reports information about x86 & ia64 hardware as described in the system BIOS according to the SMBIOS/DMI standard. This information @@ -22,6 +26,9 @@ I/O ports (e.g. serial, parallel, USB). %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 %build %make_build CFLAGS="%{optflags}" LDFLAGS="%{__global_ldflags}" @@ -41,6 +48,13 @@ I/O ports (e.g. serial, parallel, USB). %{_mandir}/man8/* %changelog +* Tue Jan 09 2024 Lichen Liu - 1:3.5-3 +- Expanding the list of CPU sockets to match the list specified in SMBIOS 3.7.0 + +* Fri Dec 22 2023 Lichen Liu - 1:3.5-2 +- Add processor support from SMBIOS-3.6.0 +- Consistently use read_file when reading from a dump file + * Fri Sep 22 2023 MSVSphere Packaging Team - 1:3.5-1 - Rebuilt for MSVSphere 9.3 beta