From MAILER-DAEMON Wed Apr 05 09:01:17 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cvkYn-0006Ws-H7
	for mharc-dmidecode-devel@gnu.org; Wed, 05 Apr 2017 09:01:17 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47636)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cvkYh-0006Tr-Oy
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:01:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cvkYc-0007Wo-86
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:01:11 -0400
Received: from mx2.suse.de ([195.135.220.15]:48350)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cvkYc-0007W5-1T
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:01:06 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id D3059AC89
	for <dmidecode-devel@nongnu.org>; Wed,  5 Apr 2017 13:01:03 +0000 (UTC)
Date: Wed, 5 Apr 2017 15:01:02 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170405150102.3f5e6d8d@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH] dmidecode: Decode processor ID of Core M,
 Athlon X4, Opteron X1000/X2000
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 05 Apr 2017 13:01:16 -0000

When these processors were added from SMBIOS specification version
3.0.0, I forgot to update dmi_processor_id accordingly. Do it now and
add a comment so that it does not happen again.

Fixes: a0edbb45b2e6 ("dmidecode: Add enums from the SMBIOS 3.0.0 specification")
---
 dmidecode.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- dmidecode.orig/dmidecode.c	2017-04-04 09:51:13.251502656 +0200
+++ dmidecode/dmidecode.c	2017-04-04 09:57:19.281831668 +0200
@@ -894,6 +894,10 @@ static const char *dmi_processor_family(
 		{ 0x15E, "DSP" },
 		{ 0x1F4, "Video Processor" },
 	};
+	/*
+	 * Note to developers: when adding entries to this list, check if
+	 * function dmi_processor_id below needs updating too.
+	 */
 
 	/* Special case for ambiguous value 0x30 (SMBIOS 2.0 only) */
 	if (ver == 0x0200 && data[0x06] == 0x30 && h->length >= 0x08)
@@ -1030,7 +1034,7 @@ static void dmi_processor_id(u8 type, co
 		}
 	}
 	else if ((type >= 0x0B && type <= 0x15) /* Intel, Cyrix */
-	      || (type >= 0x28 && type <= 0x2B) /* Intel */
+	      || (type >= 0x28 && type <= 0x2C) /* Intel */
 	      || (type >= 0xA1 && type <= 0xB3) /* Intel */
 	      || type == 0xB5 /* Intel */
 	      || (type >= 0xB9 && type <= 0xC7) /* Intel */
@@ -1042,6 +1046,7 @@ static void dmi_processor_id(u8 type, co
 	      || type == 0x1F /* AMD */
 	      || (type >= 0x38 && type <= 0x3F) /* AMD */
 	      || (type >= 0x46 && type <= 0x4F) /* AMD */
+	      || (type >= 0x66 && type <= 0x68) /* AMD */
 	      || (type >= 0x83 && type <= 0x8F) /* AMD */
 	      || (type >= 0xB6 && type <= 0xB7) /* AMD */
 	      || (type >= 0xE4 && type <= 0xEF)) /* AMD */


-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Wed Apr 05 09:03:17 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cvkaj-0007yt-Ah
	for mharc-dmidecode-devel@gnu.org; Wed, 05 Apr 2017 09:03:17 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48129)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cvkaZ-0007sN-47
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:03:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cvkaV-0008Dx-69
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:03:07 -0400
Received: from mx2.suse.de ([195.135.220.15]:48685)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cvkaU-0008D2-Vz
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:03:03 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id F1BA2ACAD
	for <dmidecode-devel@nongnu.org>; Wed,  5 Apr 2017 13:03:01 +0000 (UTC)
Date: Wed, 5 Apr 2017 15:03:00 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170405150300.4b403854@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 1/3] util: Don't leak a file descriptor in
 read_file
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 05 Apr 2017 13:03:16 -0000

If memory allocation fails, we should close the file descriptor
before returning the error.

Also remove unneeded parentheses on return, return isn't a function.

Fixes: 2339e722b49e ("util: Add read_file() function for reading sysfs files")
---
 util.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

--- dmidecode.orig/util.c	2017-04-05 14:06:58.539523034 +0200
+++ dmidecode/util.c	2017-04-05 14:15:14.388017902 +0200
@@ -113,13 +113,13 @@ void *read_file(size_t *max_len, const c
 	{
 		if (errno != ENOENT)
 			perror(filename);
-		return(NULL);
+		return NULL;
 	}
 
 	if ((p = malloc(*max_len)) == NULL)
 	{
 		perror("malloc");
-		return NULL;
+		goto out;
 	}
 
 	do
@@ -129,10 +129,10 @@ void *read_file(size_t *max_len, const c
 		{
 			if (errno != EINTR)
 			{
-				close(fd);
 				perror(filename);
 				free(p);
-				return NULL;
+				p = NULL;
+				goto out;
 			}
 		}
 		else
@@ -140,8 +140,9 @@ void *read_file(size_t *max_len, const c
 	}
 	while (r != 0);
 
-	close(fd);
 	*max_len = r2;
+out:
+	close(fd);
 
 	return p;
 }


-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Wed Apr 05 09:03:43 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cvkb9-0008Ao-Fq
	for mharc-dmidecode-devel@gnu.org; Wed, 05 Apr 2017 09:03:43 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48345)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cvkb3-00088p-30
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:03:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cvkaz-0008O0-T7
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:03:37 -0400
Received: from mx2.suse.de ([195.135.220.15]:48824)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cvkaz-0008Nv-NB
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:03:33 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id A7284ACAD
	for <dmidecode-devel@nongnu.org>; Wed,  5 Apr 2017 13:03:32 +0000 (UTC)
Date: Wed, 5 Apr 2017 15:03:31 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170405150331.59aa6a1a@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 2/3] util: Let callers pass an offset to
 read_file
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 05 Apr 2017 13:03:42 -0000

When reading from a dump file, read_file would be more convenient to
use than mem_chunk, but it lacks an offset parameter.
---
 dmidecode.c |    4 ++--
 util.c      |   12 ++++++++++--
 util.h      |    2 +-
 3 files changed, 13 insertions(+), 5 deletions(-)

--- dmidecode.orig/util.c	2017-04-05 14:38:20.159930299 +0200
+++ dmidecode/util.c	2017-04-05 14:38:34.148063132 +0200
@@ -89,7 +89,7 @@ int checksum(const u8 *buf, size_t len)
 }
 
 /*
- * Reads all of file, up to max_len bytes.
+ * Reads all of file from given offset, up to max_len bytes.
  * A buffer of max_len bytes is allocated by this function, and
  * needs to be freed by the caller.
  * This provides a similar usage model to mem_chunk()
@@ -98,7 +98,7 @@ int checksum(const u8 *buf, size_t len)
  * sets max_len to the length actually read.
  *
  */
-void *read_file(size_t *max_len, const char *filename)
+void *read_file(off_t base, size_t *max_len, const char *filename)
 {
 	int fd;
 	size_t r2 = 0;
@@ -116,6 +116,14 @@ void *read_file(size_t *max_len, const c
 		return NULL;
 	}
 
+	if (lseek(fd, base, SEEK_SET) == -1)
+	{
+		fprintf(stderr, "%s: ", filename);
+		perror("lseek");
+		p = NULL;
+		goto out;
+	}
+
 	if ((p = malloc(*max_len)) == NULL)
 	{
 		perror("malloc");
--- dmidecode.orig/util.h	2017-04-05 14:38:20.159930299 +0200
+++ dmidecode/util.h	2017-04-05 14:38:34.148063132 +0200
@@ -25,7 +25,7 @@
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof((x)[0]))
 
 int checksum(const u8 *buf, size_t len);
-void *read_file(size_t *len, const char *filename);
+void *read_file(off_t base, size_t *len, const char *filename);
 void *mem_chunk(off_t base, size_t len, const char *devmem);
 int write_dump(size_t base, size_t len, const void *data, const char *dumpfile, int add);
 u64 u64_range(u64 start, u64 end);
--- dmidecode.orig/dmidecode.c	2017-04-05 14:38:20.303931666 +0200
+++ dmidecode/dmidecode.c	2017-04-05 14:38:34.149063141 +0200
@@ -4550,7 +4550,7 @@ static void dmi_table(off_t base, u32 le
 		 * result of the kernel truncating the table on parse error.
 		 */
 		size_t size = len;
-		buf = read_file(&size, devmem);
+		buf = read_file(0, &size, devmem);
 		if (!(opt.flags & FLAG_QUIET) && num && size != (size_t)len)
 		{
 			fprintf(stderr, "Wrong DMI structures length: %u bytes "
@@ -4862,7 +4862,7 @@ int main(int argc, char * const argv[])
 	 */
 	size = 0x20;
 	if (!(opt.flags & FLAG_NO_SYSFS)
-	 && (buf = read_file(&size, SYS_ENTRY_FILE)) != NULL)
+	 && (buf = read_file(0, &size, SYS_ENTRY_FILE)) != NULL)
 	{
 		if (!(opt.flags & FLAG_QUIET))
 			printf("Getting SMBIOS data from sysfs.\n");


-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Wed Apr 05 09:09:48 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cvkh2-00018l-Lk
	for mharc-dmidecode-devel@gnu.org; Wed, 05 Apr 2017 09:09:48 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50128)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cvkh0-00018X-GD
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:09:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cvkgx-000282-9V
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:09:46 -0400
Received: from mx2.suse.de ([195.135.220.15]:49612)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cvkgx-00027I-39
	for dmidecode-devel@nongnu.org; Wed, 05 Apr 2017 09:09:43 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id D3C15AC89
	for <dmidecode-devel@nongnu.org>; Wed,  5 Apr 2017 13:09:41 +0000 (UTC)
Date: Wed, 5 Apr 2017 15:09:40 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170405150940.3d900245@endymion>
In-Reply-To: <20170405150331.59aa6a1a@endymion>
References: <20170405150331.59aa6a1a@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 3/3] dmidecode: Fix reading from SMBIOS 3 dump
 files
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 05 Apr 2017 13:09:47 -0000

In an SMBIOS 3 dump file using the 64-bit entry point format, we
don't know in advance the exact size of the DMI table, only a maximum
size. This is the same situation as when reading the same table from
sysfs, so we should use the same code.
---
 dmidecode.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-05 14:41:58.328004878 +0200
+++ dmidecode/dmidecode.c	2017-04-05 14:43:58.246159057 +0200
@@ -4540,17 +4540,19 @@ static void dmi_table(off_t base, u32 le
 		printf("\n");
 	}
 
-	if (flags & FLAG_NO_FILE_OFFSET)
+	if ((flags & FLAG_NO_FILE_OFFSET) || (opt.flags & FLAG_FROM_DUMP))
 	{
 		/*
-		 * When reading from sysfs, the file may be shorter than
-		 * announced. For SMBIOS v3 this is expcted, as we only know
-		 * the maximum table size, not the actual table size. For older
-		 * implementations (and for SMBIOS v3 too), this would be the
-		 * result of the kernel truncating the table on parse error.
+		 * When reading from sysfs or from a dump file, the file may be
+		 * shorter than announced. For SMBIOS v3 this is expcted, as we
+		 * only know the maximum table size, not the actual table size.
+		 * For older implementations (and for SMBIOS v3 too), this
+		 * would be the result of the kernel truncating the table on
+		 * parse error.
 		 */
 		size_t size = len;
-		buf = read_file(0, &size, devmem);
+		buf = read_file(flags & FLAG_NO_FILE_OFFSET ? 0 : base,
+			&size, devmem);
 		if (!(opt.flags & FLAG_QUIET) && num && size != (size_t)len)
 		{
 			fprintf(stderr, "Wrong DMI structures length: %u bytes "

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Thu Apr 06 10:13:02 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cw89l-0000Z5-Q0
	for mharc-dmidecode-devel@gnu.org; Thu, 06 Apr 2017 10:13:01 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42193)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cw89j-0000XV-Q0
	for dmidecode-devel@nongnu.org; Thu, 06 Apr 2017 10:13:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cw89c-0003fN-VA
	for dmidecode-devel@nongnu.org; Thu, 06 Apr 2017 10:12:59 -0400
Received: from mx2.suse.de ([195.135.220.15]:34272)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cw89c-0003eF-P7
	for dmidecode-devel@nongnu.org; Thu, 06 Apr 2017 10:12:52 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id E08B6AC55
	for <dmidecode-devel@nongnu.org>; Thu,  6 Apr 2017 14:12:50 +0000 (UTC)
Date: Thu, 6 Apr 2017 16:12:49 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170406161249.3d1dabfd@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH] dmidecode: Display IPMI interrupt number as
 decimal
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Thu, 06 Apr 2017 14:13:00 -0000

It is very unusual to use an hexadecimal number to refer to an
interrupt number.

Fixes: a75604166511 ("Finished decoding of DMI type 38 (IPMI).")
---
 dmidecode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- dmidecode.orig/dmidecode.c	2017-04-06 16:11:50.524755695 +0200
+++ dmidecode/dmidecode.c	2017-04-06 16:11:55.269810926 +0200
@@ -4248,7 +4248,7 @@ static void dmi_decode(const struct dmi_
 			}
 			if (data[0x11] != 0x00)
 			{
-				printf("\tInterrupt Number: %x\n",
+				printf("\tInterrupt Number: %u\n",
 					data[0x11]);
 			}
 			break;


-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:51:13 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxVyb-0008UJ-Ld
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:51:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41795)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxVyY-0008Sh-Q8
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:51:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxVyT-0007Yn-Vw
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:51:10 -0400
Received: from mx2.suse.de ([195.135.220.15]:40397)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxVyT-0007YP-P9
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:51:05 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id AEF80AAB2
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:51:04 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:51:03 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 00/10] dmidecode: Add support for SMBIOS version
 3.1.0
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:51:11 -0000

This patch series adds support for version 3.1.0 of the SMBIOS
specification to dmidecode.
-- 
Jean Delvare


From MAILER-DAEMON Mon Apr 10 05:54:03 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW1L-0001rh-Og
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:54:03 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42776)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW1J-0001qJ-ES
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:54:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW1E-0008TB-Je
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:54:01 -0400
Received: from mx2.suse.de ([195.135.220.15]:40994)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW1E-0008Sy-Cf
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:53:56 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 1297EAC4A
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:53:55 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:53:53 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115353.62464b34@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 01/10] dmidecode: Add support for extended BIOS
 ROM size
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:54:02 -0000

Add support for the "Extended BIOS ROM Size" field introduced in
SMBIOS specification version 3.1.0.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-07 10:52:11.574701147 +0200
+++ dmidecode/dmidecode.c	2017-04-07 10:52:32.038909760 +0200
@@ -295,6 +295,18 @@ static void dmi_bios_runtime_size(u32 co
 		printf(" %u kB", code >> 10);
 }
 
+static void dmi_bios_rom_size(u8 code1, u16 code2)
+{
+	static const char *unit[4] = {
+		"MB", "GB", out_of_spec, out_of_spec
+	};
+
+	if (code1 != 0xFF)
+		printf(" %u kB", (code1 + 1) << 6);
+	else
+		printf(" %u %s", code2 & 0x3FFF, unit[code2 >> 14]);
+}
+
 static void dmi_bios_characteristics(u64 code, const char *prefix)
 {
 	/* 7.1.1 */
@@ -3271,8 +3283,9 @@ static void dmi_decode(const struct dmi_
 				dmi_bios_runtime_size((0x10000 - WORD(data + 0x06)) << 4);
 				printf("\n");
 			}
-			printf("\tROM Size: %u kB\n",
-				(data[0x09] + 1) << 6);
+			printf("\tROM Size:");
+			dmi_bios_rom_size(data[0x09], h->length < 0x1A ? 16 : WORD(data + 0x18));
+			printf("\n");
 			printf("\tCharacteristics:\n");
 			dmi_bios_characteristics(QWORD(data + 0x0A), "\t\t");
 			if (h->length < 0x13) break;

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:54:40 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW1v-0002BR-U5
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:54:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42885)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW1t-00028N-Kl
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:54:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW1k-00007D-2G
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:54:32 -0400
Received: from mx2.suse.de ([195.135.220.15]:41099)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW1j-000073-RQ
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:54:27 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id B0106AC65
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:54:26 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:54:25 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115425.13ee8415@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 02/10] dmidecode: Add new enumerated values for
 chassis types
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:54:38 -0000

Add 4 new enumerated values for chassis types from SMBIOS
specification version 3.1.0.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-07 10:52:32.038909760 +0200
+++ dmidecode/dmidecode.c	2017-04-07 10:52:34.452934367 +0200
@@ -565,12 +565,16 @@ static const char *dmi_chassis_type(u8 c
 		"Blade Enclosing",
 		"Tablet",
 		"Convertible",
-		"Detachable" /* 0x20 */
+		"Detachable",
+		"IoT Gateway",
+		"Embedded PC",
+		"Mini PC",
+		"Stick PC" /* 0x24 */
 	};
 
 	code &= 0x7F; /* bits 6:0 are chassis type, 7th bit is the lock bit */
 
-	if (code >= 0x01 && code <= 0x20)
+	if (code >= 0x01 && code <= 0x24)
 		return type[code - 0x01];
 	return out_of_spec;
 }

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:54:59 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW2F-0002Mk-4e
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:54:59 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42966)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW2C-0002LJ-VQ
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:54:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW29-0000D9-21
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:54:57 -0400
Received: from mx2.suse.de ([195.135.220.15]:41169)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW28-0000Cx-Qr
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:54:52 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id AB2C8AC4A
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:54:51 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:54:50 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115450.7baa45f8@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 03/10] dmidecode: Add new enumerated values for
 processors
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:54:58 -0000

Add 6 new enumerated values for processor families and 7 new
enumerated values for processor upgrades from SMBIOS specification
version 3.1.0.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |   23 ++++++++++++++++++-----
 1 file changed, 18 insertions(+), 5 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-07 10:52:50.906102073 +0200
+++ dmidecode/dmidecode.c	2017-04-07 10:52:51.315106242 +0200
@@ -736,7 +736,9 @@ static const char *dmi_processor_family(
 		{ 0x2A, "Core Solo Mobile" },
 		{ 0x2B, "Atom" },
 		{ 0x2C, "Core M" },
-
+		{ 0x2D, "Core m3" },
+		{ 0x2E, "Core m5" },
+		{ 0x2F, "Core m7" },
 		{ 0x30, "Alpha" },
 		{ 0x31, "Alpha 21064" },
 		{ 0x32, "Alpha 21066" },
@@ -788,6 +790,8 @@ static const char *dmi_processor_family(
 		{ 0x66, "Athlon X4" },
 		{ 0x67, "Opteron X1000" },
 		{ 0x68, "Opteron X2000" },
+		{ 0x69, "Opteron A-Series" },
+		{ 0x6A, "Opteron X3000" },
 
 		{ 0x70, "Hobbit" },
 
@@ -899,6 +903,8 @@ static const char *dmi_processor_family(
 		{ 0xFA, "i860" },
 		{ 0xFB, "i960" },
 
+		{ 0x100, "ARMv7" },
+		{ 0x101, "ARMv8" },
 		{ 0x104, "SH-3" },
 		{ 0x105, "SH-4" },
 		{ 0x118, "ARM" },
@@ -1050,7 +1056,7 @@ static void dmi_processor_id(u8 type, co
 		}
 	}
 	else if ((type >= 0x0B && type <= 0x15) /* Intel, Cyrix */
-	      || (type >= 0x28 && type <= 0x2C) /* Intel */
+	      || (type >= 0x28 && type <= 0x2F) /* Intel */
 	      || (type >= 0xA1 && type <= 0xB3) /* Intel */
 	      || type == 0xB5 /* Intel */
 	      || (type >= 0xB9 && type <= 0xC7) /* Intel */
@@ -1062,7 +1068,7 @@ static void dmi_processor_id(u8 type, co
 	      || type == 0x1F /* AMD */
 	      || (type >= 0x38 && type <= 0x3F) /* AMD */
 	      || (type >= 0x46 && type <= 0x4F) /* AMD */
-	      || (type >= 0x66 && type <= 0x68) /* AMD */
+	      || (type >= 0x66 && type <= 0x6A) /* AMD */
 	      || (type >= 0x83 && type <= 0x8F) /* AMD */
 	      || (type >= 0xB6 && type <= 0xB7) /* AMD */
 	      || (type >= 0xE4 && type <= 0xEF)) /* AMD */
@@ -1224,10 +1230,17 @@ static const char *dmi_processor_upgrade
 		"Socket LGA1150",
 		"Socket BGA1168",
 		"Socket BGA1234",
-		"Socket BGA1364" /* 0x30 */
+		"Socket BGA1364",
+		"Socket AM4",
+		"Socket LGA1151",
+		"Socket BGA1356",
+		"Socket BGA1440",
+		"Socket BGA1515",
+		"Socket LGA3647-1",
+		"Socket SP3" /* 0x37 */
 	};
 
-	if (code >= 0x01 && code <= 0x30)
+	if (code >= 0x01 && code <= 0x37)
 		return upgrade[code - 0x01];
 	return out_of_spec;
 }

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:55:20 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW2a-0002f6-Q0
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:55:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43147)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW2X-0002dW-Py
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:55:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW2T-0000NC-V8
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:55:17 -0400
Received: from mx2.suse.de ([195.135.220.15]:41255)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW2T-0000Mk-NZ
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:55:13 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 9A7FDAC4A
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:55:12 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:55:11 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115511.205d2052@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 04/10] dmidecode: Don't assume 8-bit processor
 family in dmi_processor_id
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:55:19 -0000

The processor family code can be 16-bit since SMBIOS version 2.6, add
support for this possibility to function dmi_processor_id.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |   21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-07 10:52:51.315106242 +0200
+++ dmidecode/dmidecode.c	2017-04-07 10:52:53.382127310 +0200
@@ -972,7 +972,7 @@ static const char *dmi_processor_family(
 	}
 }
 
-static void dmi_processor_id(u8 type, const u8 *p, const char *version, const char *prefix)
+static void dmi_processor_id(const struct dmi_header *h, const char *prefix)
 {
 	/* Intel AP-485 revision 36, table 2-4 */
 	static const char *flags[32] = {
@@ -1009,13 +1009,14 @@ static void dmi_processor_id(u8 type, co
 		NULL, /* 30 */
 		"PBE (Pending break enabled)" /* 31 */
 	};
-	/*
-	 * Extra flags are now returned in the ECX register when one calls
-	 * the CPUID instruction. Their meaning is explained in table 3-5, but
-	 * DMI doesn't support this yet.
-	 */
+	const u8 *data = h->data;
+	const u8 *p = data + 0x08;
 	u32 eax, edx;
 	int sig = 0;
+	u16 type;
+
+	type = (data[0x06] == 0xFE && h->length >= 0x2A) ?
+		WORD(data + 0x28) : data[0x06];
 
 	/*
 	 * This might help learn about new processors supporting the
@@ -1075,6 +1076,7 @@ static void dmi_processor_id(u8 type, co
 		sig = 2;
 	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
@@ -1095,6 +1097,11 @@ static void dmi_processor_id(u8 type, co
 	else /* not X86-class */
 		return;
 
+	/*
+	 * Extra flags are now returned in the ECX register when one calls
+	 * the CPUID instruction. Their meaning is explained in table 3-5, but
+	 * DMI doesn't support this yet.
+	 */
 	eax = DWORD(p);
 	edx = DWORD(p + 4);
 	switch (sig)
@@ -3426,7 +3433,7 @@ static void dmi_decode(const struct dmi_
 				dmi_processor_family(h, ver));
 			printf("\tManufacturer: %s\n",
 				dmi_string(h, data[0x07]));
-			dmi_processor_id(data[0x06], data + 0x08, dmi_string(h, data[0x10]), "\t");
+			dmi_processor_id(h, "\t");
 			printf("\tVersion: %s\n",
 				dmi_string(h, data[0x10]));
 			printf("\tVoltage:");

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:55:45 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW2z-0002t9-CP
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:55:45 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43269)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW2w-0002rb-Qe
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:55:43 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW2s-0000SZ-Qy
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:55:42 -0400
Received: from mx2.suse.de ([195.135.220.15]:41313)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW2s-0000SD-G8
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:55:38 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 64125AC4A
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:55:37 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:55:36 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115536.679758f2@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 05/10] dmidecode: Decode the MIDR register on
 ARM processors
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:55:43 -0000

Version 3.1.0 of the SMBIOS specification says that the Processor ID
field maps to the MIDR register on ARM processors, decode it.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
--- dmidecode.orig/dmidecode.c	2017-04-05 15:41:00.952972830 +0200
+++ dmidecode/dmidecode.c	2017-04-06 11:27:12.191062872 +0200
@@ -1056,6 +1056,22 @@ static void dmi_processor_id(const struc
 			return;
 		}
 	}
+	else if ((type >= 0x100 && type <= 0x101) /* ARM */
+	      || (type >= 0x118 && type <= 0x119)) /* ARM */
+	{
+		u32 midr = DWORD(p);
+		/*
+		 * The format of this field was not defined for ARM processors
+		 * before version 3.1.0 of the SMBIOS specification, so we
+		 * silently skip it if it reads all zeroes.
+		 */
+		if (midr == 0)
+			return;
+		printf("%sSignature: Implementor 0x%02x, Variant 0x%x, Architecture %u, Part 0x%03x, Revision %u\n",
+			prefix, midr >> 24, (midr >> 20) & 0xF,
+			(midr >> 16) & 0xF, (midr >> 4) & 0xFFF, midr & 0xF);
+		return;
+	}
 	else if ((type >= 0x0B && type <= 0x15) /* Intel, Cyrix */
 	      || (type >= 0x28 && type <= 0x2F) /* Intel */
 	      || (type >= 0xA1 && type <= 0xB3) /* Intel */
@@ -1094,7 +1110,7 @@ static void dmi_processor_id(const struc
 		else
 			return;
 	}
-	else /* not X86-class */
+	else /* neither X86 nor ARM */
 		return;
 
 	/*

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:56:09 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW3N-00033o-0E
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:56:09 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43350)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW3K-00033R-Sy
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW3F-0000Zt-BP
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:06 -0400
Received: from mx2.suse.de ([195.135.220.15]:41382)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW3F-0000Zc-3t
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:01 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id EA902AC66
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:55:59 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:55:58 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115558.4e4095dd@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 06/10] dmidecode: Add support for large cache
 sizes
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:56:07 -0000

Add support for the "Maximum Cache Size 2" and "Installed Cache Size
2" fields introduced in SMBIOS specification version 3.1.0.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |   25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-06 11:56:45.472191930 +0200
+++ dmidecode/dmidecode.c	2017-04-06 14:40:08.561804923 +0200
@@ -1536,6 +1536,21 @@ static void dmi_cache_size(u16 code)
 		printf(" %u kB", code);
 }
 
+static void dmi_cache_size_2(u32 code)
+{
+	if (code & 0x80000000)
+	{
+		code &= 0x7FFFFFFFLU;
+		/* Use a more convenient unit for large cache size */
+		if (code >= 0x8000)
+			printf(" %u MB", code >> 4);
+		else
+			printf(" %u kB", code << 6);
+	}
+	else
+		printf(" %u kB", code);
+}
+
 static void dmi_cache_types(u16 code, const char *sep)
 {
 	/* 7.8.2 */
@@ -3576,10 +3591,16 @@ static void dmi_decode(const struct dmi_
 			printf("\tLocation: %s\n",
 				dmi_cache_location((WORD(data + 0x05) >> 5) & 0x0003));
 			printf("\tInstalled Size:");
-			dmi_cache_size(WORD(data + 0x09));
+			if (h->length >= 0x1B)
+				dmi_cache_size_2(DWORD(data + 0x17));
+			else
+				dmi_cache_size(WORD(data + 0x09));
 			printf("\n");
 			printf("\tMaximum Size:");
-			dmi_cache_size(WORD(data + 0x07));
+			if (h->length >= 0x17)
+				dmi_cache_size_2(DWORD(data + 0x13));
+			else
+				dmi_cache_size(WORD(data + 0x07));
 			printf("\n");
 			printf("\tSupported SRAM Types:");
 			dmi_cache_types(WORD(data + 0x0B), "\n\t\t");

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:56:27 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW3f-00036i-4A
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:56:27 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43425)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW3d-00036a-EU
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW3Z-0000h0-J4
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:25 -0400
Received: from mx2.suse.de ([195.135.220.15]:41408)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW3Z-0000gX-Cf
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:21 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 4399EAC4A
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:56:20 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:56:19 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115619.46a621df@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 07/10] dmidecode: Add Mini PCIe system slot
 enumerated values
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:56:26 -0000

Add 3 new enumerated values for system slots from SMBIOS specification
version 3.1.0.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-06 14:40:08.561804923 +0200
+++ dmidecode/dmidecode.c	2017-04-06 14:49:18.246172245 +0200
@@ -1787,7 +1787,10 @@ static const char *dmi_slot_type(u8 code
 		"MXM 3.0 Type A",
 		"MXM 3.0 Type B",
 		"PCI Express 2 SFF-8639",
-		"PCI Express 3 SFF-8639" /* 0x20 */
+		"PCI Express 3 SFF-8639",
+		"PCI Express Mini 52-pin with bottom-side keep-outs",
+		"PCI Express Mini 52-pin without bottom-side keep-outs",
+		"PCI Express Mini 76-pin" /* 0x23 */
 	};
 	static const char *type_0xA0[] = {
 		"PC-98/C20", /* 0xA0 */
@@ -1819,7 +1822,7 @@ static const char *dmi_slot_type(u8 code
 	 * function dmi_slot_id below needs updating too.
 	 */
 
-	if (code >= 0x01 && code <= 0x20)
+	if (code >= 0x01 && code <= 0x23)
 		return type[code - 0x01];
 	if (code >= 0xA0 && code <= 0xB6)
 		return type_0xA0[code - 0xA0];
@@ -1901,6 +1904,9 @@ static void dmi_slot_id(u8 code1, u8 cod
 		case 0x13: /* AGP */
 		case 0x1F: /* PCI Express 2 */
 		case 0x20: /* PCI Express 3 */
+		case 0x21: /* PCI Express Mini */
+		case 0x22: /* PCI Express Mini */
+		case 0x23: /* PCI Express Mini */
 		case 0xA5: /* PCI Express */
 		case 0xA6: /* PCI Express */
 		case 0xA7: /* PCI Express */

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:56:53 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW45-00038r-8O
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:56:53 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43541)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW43-00038h-Pa
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW3z-0000rb-U3
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:51 -0400
Received: from mx2.suse.de ([195.135.220.15]:41480)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW3z-0000rL-N8
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:56:47 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 91D22AC66
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:56:46 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:56:45 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115645.7a9b9bca@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 08/10] dmidecode: Clarify the memory speed unit
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:56:52 -0000

Change the memory speed unit from MHz to MT/s as advised by version
3.1.0 of the SMBIOS specification.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- dmidecode.orig/dmidecode.c	2017-04-06 14:49:18.246172245 +0200
+++ dmidecode/dmidecode.c	2017-04-06 15:11:44.818787121 +0200
@@ -2490,7 +2490,7 @@ static void dmi_memory_device_speed(u16
 	if (code == 0)
 		printf(" Unknown");
 	else
-		printf(" %u MHz", code);
+		printf(" %u MT/s", code);
 }
 
 /*

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:58:20 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW5U-0003ud-5N
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:58:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43895)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW5R-0003tE-K6
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:58:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW5N-000191-MC
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:58:17 -0400
Received: from mx2.suse.de ([195.135.220.15]:41716)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW5N-00018j-BH
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:58:13 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 3AC18AC65
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:58:12 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:58:11 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115811.45a70828@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 09/10] dmidecode: Add support for structure type
 43 (TPM Device)
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:58:18 -0000

SMBIOS 3.1.0 introduces a new structure type (43) for TPM devices.
Add support for it.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
Note 1: this is untested, as I do not have access to any system
implementing this structure.
Note 2: if someone can make any sense of the TPM_VERSION structure,
as described in the TPM part 2 v1.2 specification, please let me
know. It looks to me like the engineers in charge were drunk when
they updated that part of the TPM specification. All I can see is
that they tried to solve a problem which did not exist, and created
one instead.

 dmidecode.c |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 98 insertions(+), 3 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-06 16:13:11.568686604 +0200
+++ dmidecode/dmidecode.c	2017-04-07 10:46:05.378964261 +0200
@@ -2,7 +2,7 @@
  * DMI Decode
  *
  *   Copyright (C) 2000-2002 Alan Cox <alan@redhat.com>
- *   Copyright (C) 2002-2015 Jean Delvare <jdelvare@suse.de>
+ *   Copyright (C) 2002-2017 Jean Delvare <jdelvare@suse.de>
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
@@ -50,6 +50,12 @@
  *  - DMTF DSP0239 version 1.1.0
  *    "Management Component Transport Protocol (MCTP) IDs and Codes"
  *    http://www.dmtf.org/standards/pmci
+ *  - "TPM Main, Part 2 TPM Structures"
+ *    Specification version 1.2, level 2, revision 116
+ *    https://trustedcomputinggroup.org/tpm-main-specification/
+ *  - "PC Client Platform TPM Profile (PTP) Specification"
+ *    Family "2.0", Level 00, Revision 00.43, January 26, 2015
+ *    https://trustedcomputinggroup.org/pc-client-platform-tpm-profile-ptp-specification/
  */
 
 #include <stdio.h>
@@ -170,12 +176,13 @@ static const char *dmi_smbios_structure_
 		"Power Supply",
 		"Additional Information",
 		"Onboard Device",
-		"Management Controller Host Interface", /* 42 */
+		"Management Controller Host Interface",
+		"TPM Device", /* 43 */
 	};
 
 	if (code >= 128)
 		return "OEM-specific";
-	if (code <= 42)
+	if (code <= 43)
 		return type[code];
 	return out_of_spec;
 }
@@ -3310,6 +3317,57 @@ static const char *dmi_management_contro
 }
 
 /*
+ * 7.44 TPM Device (Type 43)
+ */
+
+static void dmi_tpm_vendor_id(const u8 *p)
+{
+	char vendor_id[5];
+	int i;
+
+	/* ASCII filtering */
+	for (i = 0; i < 4 && p[i] != 0; i++)
+	{
+		if (p[i] < 32 || p[i] >= 127)
+			vendor_id[i] = '.';
+		else
+			vendor_id[i] = p[i];
+	}
+
+	/* Terminate the string */
+	vendor_id[i] = '\0';
+
+	printf(" %s", vendor_id);
+}
+
+static void dmi_tpm_characteristics(u64 code, const char *prefix)
+{
+	/* 7.1.1 */
+	static const char *characteristics[] = {
+		"TPM Device characteristics not supported", /* 2 */
+		"Family configurable via firmware update",
+		"Family configurable via platform software support",
+		"Family configurable via OEM proprietary mechanism" /* 5 */
+	};
+	int i;
+
+	/*
+	 * This isn't very clear what this bit is supposed to mean
+	 */
+	if (code.l & (1 << 2))
+	{
+		printf("%s%s\n",
+			prefix, characteristics[0]);
+		return;
+	}
+
+	for (i = 3; i <= 5; i++)
+		if (code.l & (1 << i))
+			printf("%s%s\n",
+				prefix, characteristics[i - 2]);
+}
+
+/*
  * Main
  */
 
@@ -4425,6 +4483,43 @@ static void dmi_decode(const struct dmi_
 			}
 			break;
 
+		case 43: /* 7.44 TPM Device */
+			printf("TPM Device\n");
+			if (h->length < 0x1B) break;
+			printf("\tVendor ID:");
+			dmi_tpm_vendor_id(data + 0x04);
+			printf("\n");
+			printf("\tSpecification Version: %d.%d", data[0x08], data[0x09]);
+			switch (data[0x08])
+			{
+				case 0x01:
+					/*
+					 * We skip the first 2 bytes, which are
+					 * redundant with the above, and uncoded
+					 * in a silly way.
+					 */
+					printf("\tFirmware Revision: %u.%u\n",
+						data[0x0C], data[0x0D]);
+					break;
+				case 0x02:
+					printf("\tFirmware Revision: %u.%u\n",
+						DWORD(data + 0x0A) >> 16,
+						DWORD(data + 0x0A) && 0xFF);
+					/*
+					 * We skip the next 4 bytes, as their
+					 * format is not standardized and their
+					 * usefulness seems limited anyway.
+					 */
+					break;
+			}
+			printf("\tDescription: %s", dmi_string(h, data[0x12]));
+			printf("\tCharacteristics:\n");
+			dmi_tpm_characteristics(QWORD(data + 0x13), "\t\t");
+			if (h->length < 0x1F) break;
+			printf("\tOEM-specific Information: 0x%08X\n",
+				DWORD(data + 0x1B));
+			break;
+
 		case 126: /* 7.44 Inactive */
 			printf("Inactive\n");
 			break;

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Mon Apr 10 05:58:43 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cxW5r-0003y9-K6
	for mharc-dmidecode-devel@gnu.org; Mon, 10 Apr 2017 05:58:43 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43996)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW5p-0003y1-Gc
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:58:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cxW5l-0001DE-Lu
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:58:41 -0400
Received: from mx2.suse.de ([195.135.220.15]:41753)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cxW5l-0001Cy-FM
	for dmidecode-devel@nongnu.org; Mon, 10 Apr 2017 05:58:37 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 50F3EAC65
	for <dmidecode-devel@nongnu.org>; Mon, 10 Apr 2017 09:58:36 +0000 (UTC)
Date: Mon, 10 Apr 2017 11:58:35 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170410115835.781d35f3@endymion>
In-Reply-To: <20170410115103.187bd8cf@endymion>
References: <20170410115103.187bd8cf@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 10/10] dmidecode: SMBIOS 3.1.0 is fully
 supported now
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Mon, 10 Apr 2017 09:58:42 -0000

All pieces of the SMBIOS 3.1.0 specification are supported now.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-07 10:47:22.558752494 +0200
+++ dmidecode/dmidecode.c	2017-04-07 10:48:15.058288465 +0200
@@ -25,7 +25,7 @@
  *   are deemed to be part of the source code.
  *
  * Unless specified otherwise, all references are aimed at the "System
- * Management BIOS Reference Specification, Version 3.0.0" document,
+ * Management BIOS Reference Specification, Version 3.1.0" document,
  * available from http://www.dmtf.org/standards/smbios.
  *
  * Note to contributors:
@@ -75,7 +75,7 @@
 #define out_of_spec "<OUT OF SPEC>"
 static const char *bad_index = "<BAD INDEX>";
 
-#define SUPPORTED_SMBIOS_VER 0x0300
+#define SUPPORTED_SMBIOS_VER 0x0301
 
 #define FLAG_NO_FILE_OFFSET     (1 << 0)
 #define FLAG_STOP_AT_EOT        (1 << 1)

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Wed Apr 12 12:31:50 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cyLBO-00075u-Kb
	for mharc-dmidecode-devel@gnu.org; Wed, 12 Apr 2017 12:31:50 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51835)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cyLBK-000742-Ii
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:31:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cyLBG-0004WF-LS
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:31:46 -0400
Received: from mx2.suse.de ([195.135.220.15]:49729)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cyLBG-0004V7-Ez
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:31:42 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 2E55CADDA
	for <dmidecode-devel@nongnu.org>; Wed, 12 Apr 2017 16:31:40 +0000 (UTC)
Date: Wed, 12 Apr 2017 18:31:38 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170412183138.0f5103f7@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 0/2] dmidecode: Add support for SMBIOS version
 3.1.1
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 12 Apr 2017 16:31:49 -0000

This patch series adds support for version 3.1.1 of the SMBIOS
specification to dmidecode.

Note that I voluntarily left out the changes in type 42, as they refer
to external specifications that I don't have the time to read. I find
this structure confusing even after the clarifications, and apparently
I am not alone, as I could not spot any implementation of it in the
wild. So I'd rather wait for at least one manufacturer to expose a type
42 structure in their DMI table before looking into it again.

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Wed Apr 12 12:32:26 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cyLBx-0007WE-SM
	for mharc-dmidecode-devel@gnu.org; Wed, 12 Apr 2017 12:32:25 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51950)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cyLBv-0007Tv-RL
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:32:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cyLBr-0004wr-UN
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:32:23 -0400
Received: from mx2.suse.de ([195.135.220.15]:49822)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cyLBr-0004uq-ON
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:32:19 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id BE032AD10
	for <dmidecode-devel@nongnu.org>; Wed, 12 Apr 2017 16:32:18 +0000 (UTC)
Date: Wed, 12 Apr 2017 18:32:17 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170412183217.10b4f1c2@endymion>
In-Reply-To: <20170412183138.0f5103f7@endymion>
References: <20170412183138.0f5103f7@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 1/2] dmidecode: Add support for 3-digit versions
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 12 Apr 2017 16:32:25 -0000

The version of the SMBIOS specification being implemented includes
the 3rd digit since version 3.0.0, so we should use it when comparing
with what dmidecode supports.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |   21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-12 18:10:01.410945323 +0200
+++ dmidecode/dmidecode.c	2017-04-12 18:10:09.708032249 +0200
@@ -75,7 +75,7 @@
 #define out_of_spec "<OUT OF SPEC>"
 static const char *bad_index = "<BAD INDEX>";
 
-#define SUPPORTED_SMBIOS_VER 0x0301
+#define SUPPORTED_SMBIOS_VER 0x030101
 
 #define FLAG_NO_FILE_OFFSET     (1 << 0)
 #define FLAG_STOP_AT_EOT        (1 << 1)
@@ -4689,16 +4689,18 @@ static void dmi_table_decode(u8 *buf, u3
 	}
 }
 
-static void dmi_table(off_t base, u32 len, u16 num, u16 ver, const char *devmem,
+static void dmi_table(off_t base, u32 len, u16 num, u32 ver, const char *devmem,
 		      u32 flags)
 {
 	u8 *buf;
 
 	if (ver > SUPPORTED_SMBIOS_VER && !(opt.flags & FLAG_QUIET))
 	{
-		printf("# SMBIOS implementations newer than version %u.%u are not\n"
+		printf("# SMBIOS implementations newer than version %u.%u.%u are not\n"
 		       "# fully supported by this version of dmidecode.\n",
-		       SUPPORTED_SMBIOS_VER >> 8, SUPPORTED_SMBIOS_VER & 0xFF);
+		       SUPPORTED_SMBIOS_VER >> 16,
+		       (SUPPORTED_SMBIOS_VER >> 8) & 0xFF,
+		       SUPPORTED_SMBIOS_VER & 0xFF);
 	}
 
 	if (!(opt.flags & FLAG_QUIET))
@@ -4753,7 +4755,7 @@ static void dmi_table(off_t base, u32 le
 	if (opt.flags & FLAG_DUMP_BIN)
 		dmi_table_dump(buf, len);
 	else
-		dmi_table_decode(buf, len, num, ver, flags);
+		dmi_table_decode(buf, len, num, ver >> 8, flags);
 
 	free(buf);
 }
@@ -4790,13 +4792,13 @@ static void overwrite_smbios3_address(u8
 
 static int smbios3_decode(u8 *buf, const char *devmem, u32 flags)
 {
-	u16 ver;
+	u32 ver;
 	u64 offset;
 
 	if (!checksum(buf, buf[0x06]))
 		return 0;
 
-	ver = (buf[0x07] << 8) + buf[0x08];
+	ver = (buf[0x07] << 16) + (buf[0x08] << 8) + buf[0x09];
 	if (!(opt.flags & FLAG_QUIET))
 		printf("SMBIOS %u.%u.%u present.\n",
 		       buf[0x07], buf[0x08], buf[0x09]);
@@ -4861,7 +4863,7 @@ static int smbios_decode(u8 *buf, const
 			ver >> 8, ver & 0xFF);
 
 	dmi_table(DWORD(buf + 0x18), WORD(buf + 0x16), WORD(buf + 0x1C),
-		ver, devmem, flags);
+		ver << 8, devmem, flags);
 
 	if (opt.flags & FLAG_DUMP_BIN)
 	{
@@ -4889,7 +4891,8 @@ static int legacy_decode(u8 *buf, const
 			buf[0x0E] >> 4, buf[0x0E] & 0x0F);
 
 	dmi_table(DWORD(buf + 0x08), WORD(buf + 0x06), WORD(buf + 0x0C),
-		((buf[0x0E] & 0xF0) << 4) + (buf[0x0E] & 0x0F), devmem, flags);
+		((buf[0x0E] & 0xF0) << 12) + ((buf[0x0E] & 0x0F) << 8),
+		devmem, flags);
 
 	if (opt.flags & FLAG_DUMP_BIN)
 	{

-- 
Jean Delvare
SUSE L3 Support


From MAILER-DAEMON Wed Apr 12 12:33:00 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1cyLCW-0007ny-1X
	for mharc-dmidecode-devel@gnu.org; Wed, 12 Apr 2017 12:33:00 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52155)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cyLCT-0007ni-GE
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:32:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jdelvare@suse.de>) id 1cyLCP-0005HO-Ir
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:32:57 -0400
Received: from mx2.suse.de ([195.135.220.15]:49883)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <jdelvare@suse.de>) id 1cyLCP-0005HG-CD
	for dmidecode-devel@nongnu.org; Wed, 12 Apr 2017 12:32:53 -0400
X-Virus-Scanned: by amavisd-new at test-mx.suse.de
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])
	by mx2.suse.de (Postfix) with ESMTP id 64ECBAD10
	for <dmidecode-devel@nongnu.org>; Wed, 12 Apr 2017 16:32:52 +0000 (UTC)
Date: Wed, 12 Apr 2017 18:32:51 +0200
From: Jean Delvare <jdelvare@suse.de>
To: dmidecode-devel@nongnu.org
Message-ID: <20170412183251.582be252@endymion>
In-Reply-To: <20170412183138.0f5103f7@endymion>
References: <20170412183138.0f5103f7@endymion>
Organization: SUSE Linux
X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.31; x86_64-suse-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 195.135.220.15
Subject: [dmidecode] [PATCH 2/2] dmidecode: Add new enumerated values for
 processors
X-BeenThere: dmidecode-devel@nongnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: <dmidecode-devel.nongnu.org>
List-Unsubscribe: <https://lists.nongnu.org/mailman/options/dmidecode-devel>, 
	<mailto:dmidecode-devel-request@nongnu.org?subject=unsubscribe>
List-Archive: <http://lists.nongnu.org/archive/html/dmidecode-devel/>
List-Post: <mailto:dmidecode-devel@nongnu.org>
List-Help: <mailto:dmidecode-devel-request@nongnu.org?subject=help>
List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/dmidecode-devel>,
	<mailto:dmidecode-devel-request@nongnu.org?subject=subscribe>
X-List-Received-Date: Wed, 12 Apr 2017 16:32:58 -0000

Add 1 new enumerated value for processor families and 1 new
enumerated value for processor upgrades from SMBIOS specification
version 3.1.1.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
 dmidecode.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- dmidecode.orig/dmidecode.c	2017-04-07 10:54:34.211154746 +0200
+++ dmidecode/dmidecode.c	2017-04-07 11:27:53.323040269 +0200
@@ -25,7 +25,7 @@
  *   are deemed to be part of the source code.
  *
  * Unless specified otherwise, all references are aimed at the "System
- * Management BIOS Reference Specification, Version 3.1.0" document,
+ * Management BIOS Reference Specification, Version 3.1.1" document,
  * available from http://www.dmtf.org/standards/smbios.
  *
  * Note to contributors:
@@ -799,6 +799,7 @@ static const char *dmi_processor_family(
 		{ 0x68, "Opteron X2000" },
 		{ 0x69, "Opteron A-Series" },
 		{ 0x6A, "Opteron X3000" },
+		{ 0x6B, "Zen" },
 
 		{ 0x70, "Hobbit" },
 
@@ -1092,7 +1093,7 @@ static void dmi_processor_id(const struc
 	      || type == 0x1F /* AMD */
 	      || (type >= 0x38 && type <= 0x3F) /* AMD */
 	      || (type >= 0x46 && type <= 0x4F) /* AMD */
-	      || (type >= 0x66 && type <= 0x6A) /* AMD */
+	      || (type >= 0x66 && type <= 0x6B) /* AMD */
 	      || (type >= 0x83 && type <= 0x8F) /* AMD */
 	      || (type >= 0xB6 && type <= 0xB7) /* AMD */
 	      || (type >= 0xE4 && type <= 0xEF)) /* AMD */
@@ -1267,10 +1268,11 @@ static const char *dmi_processor_upgrade
 		"Socket BGA1440",
 		"Socket BGA1515",
 		"Socket LGA3647-1",
-		"Socket SP3" /* 0x37 */
+		"Socket SP3",
+		"Socket SP3r2" /* 0x38 */
 	};
 
-	if (code >= 0x01 && code <= 0x37)
+	if (code >= 0x01 && code <= 0x38)
 		return upgrade[code - 0x01];
 	return out_of_spec;
 }

-- 
Jean Delvare
SUSE L3 Support


