LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute
@ 2015-01-26 13:28 Ivan Khoronzhuk
  2015-01-26 13:28 ` [Patch v2 1/2] firmware: dmi_scan: add symbol to get SMBIOS entry area Ivan Khoronzhuk
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ivan Khoronzhuk @ 2015-01-26 13:28 UTC (permalink / raw)
  To: linux-kernel, ard.biesheuvel
  Cc: dmidecode-devel, grant.likely, leif.lindholm, matt.fleming,
	Ivan Khoronzhuk

Some utils, like dmidecode and smbios, needs to access SMBIOS entry
table area in order to get information like SMBIOS version, size, etc.
Currently it's done via /dev/mem. But for situation when /dev/mem
usage is disabled, the utils have to use dmi sysfs instead, which
doesn't represent SMBIOS entry. So this patch series adds SMBIOS
area to dmi sysfs in order to allow utils in question to work
correctly with dmi sysfs.

v1: https://lkml.org/lkml/2015/1/23/643

v2..v1:
  firmware: dmi_scan: add symbol to get SMBIOS entry area
	- used additional static var to hold SMBIOS raw table size
	- changed format of get_smbios_entry_area symbol
	  returned pointer on const smbios table

  firmware: dmi-sysfs: add SMBIOS entry point area attribute
	- adopted to updated get_smbios_entry_area symbol
  	- removed redundant array to save smbios table

Ivan Khoronzhuk (2):
  firmware: dmi_scan: add symbol to get SMBIOS entry area
  firmware: dmi-sysfs: add SMBIOS entry point area attribute

 drivers/firmware/dmi-sysfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 drivers/firmware/dmi_scan.c  | 26 ++++++++++++++++++++++++++
 include/linux/dmi.h          |  3 +++
 3 files changed, 71 insertions(+)

-- 
1.9.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Patch v2 1/2] firmware: dmi_scan: add symbol to get SMBIOS entry area
  2015-01-26 13:28 [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute Ivan Khoronzhuk
@ 2015-01-26 13:28 ` Ivan Khoronzhuk
  2015-01-26 13:32   ` Ard Biesheuvel
  2015-01-26 13:28 ` [Patch v2 2/2] firmware: dmi-sysfs: add SMBIOS entry point area attribute Ivan Khoronzhuk
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Ivan Khoronzhuk @ 2015-01-26 13:28 UTC (permalink / raw)
  To: linux-kernel, ard.biesheuvel
  Cc: dmidecode-devel, grant.likely, leif.lindholm, matt.fleming,
	Ivan Khoronzhuk

There are situations when code needs to access SMBIOS entry table
area. For example, to pass it via sysfs to userspace when it's not
allowed to get SMBIOS info via /dev/mem.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 drivers/firmware/dmi_scan.c | 26 ++++++++++++++++++++++++++
 include/linux/dmi.h         |  3 +++
 2 files changed, 29 insertions(+)

diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 420c8d8..d94c6b7 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -113,6 +113,8 @@ static void dmi_table(u8 *buf, int len, int num,
 	}
 }
 
+static unsigned char smbios_header[32];
+static int smbios_header_size;
 static phys_addr_t dmi_base;
 static u16 dmi_len;
 static u16 dmi_num;
@@ -474,6 +476,8 @@ static int __init dmi_present(const u8 *buf)
 	if (memcmp(buf, "_SM_", 4) == 0 &&
 	    buf[5] < 32 && dmi_checksum(buf, buf[5])) {
 		smbios_ver = get_unaligned_be16(buf + 6);
+		smbios_header_size = buf[5];
+		memcpy(smbios_header, buf, smbios_header_size);
 
 		/* Some BIOS report weird SMBIOS version, fix that up */
 		switch (smbios_ver) {
@@ -505,6 +509,8 @@ static int __init dmi_present(const u8 *buf)
 				pr_info("SMBIOS %d.%d present.\n",
 				       dmi_ver >> 8, dmi_ver & 0xFF);
 			} else {
+				smbios_header_size = 15;
+				memcpy(smbios_header, buf, smbios_header_size);
 				dmi_ver = (buf[14] & 0xF0) << 4 |
 					   (buf[14] & 0x0F);
 				pr_info("Legacy DMI %d.%d present.\n",
@@ -531,6 +537,8 @@ static int __init dmi_smbios3_present(const u8 *buf)
 		dmi_ver &= 0xFFFFFF;
 		dmi_len = get_unaligned_le32(buf + 12);
 		dmi_base = get_unaligned_le64(buf + 16);
+		smbios_header_size = buf[6];
+		memcpy(smbios_header, buf, smbios_header_size);
 
 		/*
 		 * The 64-bit SMBIOS 3.0 entry point no longer has a field
@@ -944,3 +952,21 @@ void dmi_memdev_name(u16 handle, const char **bank, const char **device)
 	}
 }
 EXPORT_SYMBOL_GPL(dmi_memdev_name);
+
+/**
+ * dmi_get_smbios_entry_area - copy SMBIOS entry point area to array.
+ * @size - pointer to assign actual size of SMBIOS entry point area.
+ *
+ * returns NULL if table is not available, otherwise returns pointer on
+ * SMBIOS entry point area array.
+ */
+const u8 *dmi_get_smbios_entry_area(int *size)
+{
+	if (!smbios_header_size || !dmi_available)
+		return NULL;
+
+	*size = smbios_header_size;
+
+	return smbios_header;
+}
+EXPORT_SYMBOL_GPL(dmi_get_smbios_entry_area);
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index f820f0a..8e1a28d 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -109,6 +109,7 @@ extern int dmi_walk(void (*decode)(const struct dmi_header *, void *),
 	void *private_data);
 extern bool dmi_match(enum dmi_field f, const char *str);
 extern void dmi_memdev_name(u16 handle, const char **bank, const char **device);
+const u8 *dmi_get_smbios_entry_area(int *size);
 
 #else
 
@@ -140,6 +141,8 @@ static inline void dmi_memdev_name(u16 handle, const char **bank,
 		const char **device) { }
 static inline const struct dmi_system_id *
 	dmi_first_match(const struct dmi_system_id *list) { return NULL; }
+static inline const u8 *dmi_get_smbios_entry_area(int *size)
+	{ return NULL; }
 
 #endif
 
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [Patch v2 2/2] firmware: dmi-sysfs: add SMBIOS entry point area attribute
  2015-01-26 13:28 [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute Ivan Khoronzhuk
  2015-01-26 13:28 ` [Patch v2 1/2] firmware: dmi_scan: add symbol to get SMBIOS entry area Ivan Khoronzhuk
@ 2015-01-26 13:28 ` Ivan Khoronzhuk
  2015-01-26 13:34   ` Ard Biesheuvel
  2015-01-27 11:35 ` [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute Matt Fleming
  2015-01-27 16:23 ` Grant Likely
  3 siblings, 1 reply; 8+ messages in thread
From: Ivan Khoronzhuk @ 2015-01-26 13:28 UTC (permalink / raw)
  To: linux-kernel, ard.biesheuvel
  Cc: dmidecode-devel, grant.likely, leif.lindholm, matt.fleming,
	Ivan Khoronzhuk

There are situations when code needs to access SMBIOS entry table
area, but cannot use /dev/mem for this. As the table format is
consistent only for a version, and can be changed, use binary
attribute to give access to raw SMBIOS entry table area.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
---
 drivers/firmware/dmi-sysfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c
index e0f1cb3..61b6a38 100644
--- a/drivers/firmware/dmi-sysfs.c
+++ b/drivers/firmware/dmi-sysfs.c
@@ -29,6 +29,8 @@
 #define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider
 			      the top entry type is only 8 bits */
 
+static const u8 *smbios_raw_header;
+
 struct dmi_sysfs_entry {
 	struct dmi_header dh;
 	struct kobject kobj;
@@ -646,9 +648,37 @@ static void cleanup_entry_list(void)
 	}
 }
 
+static ssize_t smbios_entry_area_raw_read(struct file *filp,
+					  struct kobject *kobj,
+					  struct bin_attribute *bin_attr,
+					  char *buf, loff_t pos, size_t count)
+{
+	ssize_t size;
+
+	size = bin_attr->size;
+
+	if (size > pos)
+		size -= pos;
+	else
+		return 0;
+
+	if (count < size)
+		size = count;
+
+	memcpy(buf, &smbios_raw_header[pos], size);
+
+	return size;
+}
+
+static struct bin_attribute smbios_raw_area_attr = {
+	.read = smbios_entry_area_raw_read,
+	.attr = {.name = "smbios_raw_header", .mode = 0400},
+};
+
 static int __init dmi_sysfs_init(void)
 {
 	int error = -ENOMEM;
+	int size;
 	int val;
 
 	/* Set up our directory */
@@ -669,6 +699,18 @@ static int __init dmi_sysfs_init(void)
 		goto err;
 	}
 
+	smbios_raw_header = dmi_get_smbios_entry_area(&size);
+	if (!smbios_raw_header) {
+		pr_debug("dmi-sysfs: SMBIOS raw data is not available.\n");
+		error = -ENODATA;
+		goto err;
+	}
+
+	/* Create the raw binary file to access the entry area */
+	smbios_raw_area_attr.size = size;
+	if (sysfs_create_bin_file(dmi_kobj, &smbios_raw_area_attr))
+		goto err;
+
 	pr_debug("dmi-sysfs: loaded.\n");
 
 	return 0;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [Patch v2 1/2] firmware: dmi_scan: add symbol to get SMBIOS entry area
  2015-01-26 13:28 ` [Patch v2 1/2] firmware: dmi_scan: add symbol to get SMBIOS entry area Ivan Khoronzhuk
@ 2015-01-26 13:32   ` Ard Biesheuvel
  0 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2015-01-26 13:32 UTC (permalink / raw)
  To: Ivan Khoronzhuk, x86
  Cc: linux-kernel, dmidecode-devel, Grant Likely, Leif Lindholm, Matt Fleming

On 26 January 2015 at 13:28, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
> There are situations when code needs to access SMBIOS entry table
> area. For example, to pass it via sysfs to userspace when it's not
> allowed to get SMBIOS info via /dev/mem.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>  drivers/firmware/dmi_scan.c | 26 ++++++++++++++++++++++++++
>  include/linux/dmi.h         |  3 +++
>  2 files changed, 29 insertions(+)
>
> diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
> index 420c8d8..d94c6b7 100644
> --- a/drivers/firmware/dmi_scan.c
> +++ b/drivers/firmware/dmi_scan.c
> @@ -113,6 +113,8 @@ static void dmi_table(u8 *buf, int len, int num,
>         }
>  }
>
> +static unsigned char smbios_header[32];
> +static int smbios_header_size;
>  static phys_addr_t dmi_base;
>  static u16 dmi_len;
>  static u16 dmi_num;
> @@ -474,6 +476,8 @@ static int __init dmi_present(const u8 *buf)
>         if (memcmp(buf, "_SM_", 4) == 0 &&
>             buf[5] < 32 && dmi_checksum(buf, buf[5])) {
>                 smbios_ver = get_unaligned_be16(buf + 6);
> +               smbios_header_size = buf[5];
> +               memcpy(smbios_header, buf, smbios_header_size);
>
>                 /* Some BIOS report weird SMBIOS version, fix that up */
>                 switch (smbios_ver) {
> @@ -505,6 +509,8 @@ static int __init dmi_present(const u8 *buf)
>                                 pr_info("SMBIOS %d.%d present.\n",
>                                        dmi_ver >> 8, dmi_ver & 0xFF);
>                         } else {
> +                               smbios_header_size = 15;
> +                               memcpy(smbios_header, buf, smbios_header_size);
>                                 dmi_ver = (buf[14] & 0xF0) << 4 |
>                                            (buf[14] & 0x0F);
>                                 pr_info("Legacy DMI %d.%d present.\n",
> @@ -531,6 +537,8 @@ static int __init dmi_smbios3_present(const u8 *buf)
>                 dmi_ver &= 0xFFFFFF;
>                 dmi_len = get_unaligned_le32(buf + 12);
>                 dmi_base = get_unaligned_le64(buf + 16);
> +               smbios_header_size = buf[6];
> +               memcpy(smbios_header, buf, smbios_header_size);
>
>                 /*
>                  * The 64-bit SMBIOS 3.0 entry point no longer has a field
> @@ -944,3 +952,21 @@ void dmi_memdev_name(u16 handle, const char **bank, const char **device)
>         }
>  }
>  EXPORT_SYMBOL_GPL(dmi_memdev_name);
> +
> +/**
> + * dmi_get_smbios_entry_area - copy SMBIOS entry point area to array.
> + * @size - pointer to assign actual size of SMBIOS entry point area.
> + *
> + * returns NULL if table is not available, otherwise returns pointer on
> + * SMBIOS entry point area array.
> + */
> +const u8 *dmi_get_smbios_entry_area(int *size)
> +{
> +       if (!smbios_header_size || !dmi_available)
> +               return NULL;
> +
> +       *size = smbios_header_size;
> +
> +       return smbios_header;
> +}
> +EXPORT_SYMBOL_GPL(dmi_get_smbios_entry_area);
> diff --git a/include/linux/dmi.h b/include/linux/dmi.h
> index f820f0a..8e1a28d 100644
> --- a/include/linux/dmi.h
> +++ b/include/linux/dmi.h
> @@ -109,6 +109,7 @@ extern int dmi_walk(void (*decode)(const struct dmi_header *, void *),
>         void *private_data);
>  extern bool dmi_match(enum dmi_field f, const char *str);
>  extern void dmi_memdev_name(u16 handle, const char **bank, const char **device);
> +const u8 *dmi_get_smbios_entry_area(int *size);
>
>  #else
>
> @@ -140,6 +141,8 @@ static inline void dmi_memdev_name(u16 handle, const char **bank,
>                 const char **device) { }
>  static inline const struct dmi_system_id *
>         dmi_first_match(const struct dmi_system_id *list) { return NULL; }
> +static inline const u8 *dmi_get_smbios_entry_area(int *size)
> +       { return NULL; }
>
>  #endif
>
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch v2 2/2] firmware: dmi-sysfs: add SMBIOS entry point area attribute
  2015-01-26 13:28 ` [Patch v2 2/2] firmware: dmi-sysfs: add SMBIOS entry point area attribute Ivan Khoronzhuk
@ 2015-01-26 13:34   ` Ard Biesheuvel
  0 siblings, 0 replies; 8+ messages in thread
From: Ard Biesheuvel @ 2015-01-26 13:34 UTC (permalink / raw)
  To: Ivan Khoronzhuk, x86
  Cc: linux-kernel, dmidecode-devel, Grant Likely, Leif Lindholm, Matt Fleming

On 26 January 2015 at 13:28, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org> wrote:
> There are situations when code needs to access SMBIOS entry table
> area, but cannot use /dev/mem for this. As the table format is
> consistent only for a version, and can be changed, use binary
> attribute to give access to raw SMBIOS entry table area.
>
> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>

Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>

> ---
>  drivers/firmware/dmi-sysfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>
> diff --git a/drivers/firmware/dmi-sysfs.c b/drivers/firmware/dmi-sysfs.c
> index e0f1cb3..61b6a38 100644
> --- a/drivers/firmware/dmi-sysfs.c
> +++ b/drivers/firmware/dmi-sysfs.c
> @@ -29,6 +29,8 @@
>  #define MAX_ENTRY_TYPE 255 /* Most of these aren't used, but we consider
>                               the top entry type is only 8 bits */
>
> +static const u8 *smbios_raw_header;
> +
>  struct dmi_sysfs_entry {
>         struct dmi_header dh;
>         struct kobject kobj;
> @@ -646,9 +648,37 @@ static void cleanup_entry_list(void)
>         }
>  }
>
> +static ssize_t smbios_entry_area_raw_read(struct file *filp,
> +                                         struct kobject *kobj,
> +                                         struct bin_attribute *bin_attr,
> +                                         char *buf, loff_t pos, size_t count)
> +{
> +       ssize_t size;
> +
> +       size = bin_attr->size;
> +
> +       if (size > pos)
> +               size -= pos;
> +       else
> +               return 0;
> +
> +       if (count < size)
> +               size = count;
> +
> +       memcpy(buf, &smbios_raw_header[pos], size);
> +
> +       return size;
> +}
> +
> +static struct bin_attribute smbios_raw_area_attr = {
> +       .read = smbios_entry_area_raw_read,
> +       .attr = {.name = "smbios_raw_header", .mode = 0400},
> +};
> +
>  static int __init dmi_sysfs_init(void)
>  {
>         int error = -ENOMEM;
> +       int size;
>         int val;
>
>         /* Set up our directory */
> @@ -669,6 +699,18 @@ static int __init dmi_sysfs_init(void)
>                 goto err;
>         }
>
> +       smbios_raw_header = dmi_get_smbios_entry_area(&size);
> +       if (!smbios_raw_header) {
> +               pr_debug("dmi-sysfs: SMBIOS raw data is not available.\n");
> +               error = -ENODATA;
> +               goto err;
> +       }
> +
> +       /* Create the raw binary file to access the entry area */
> +       smbios_raw_area_attr.size = size;
> +       if (sysfs_create_bin_file(dmi_kobj, &smbios_raw_area_attr))
> +               goto err;
> +
>         pr_debug("dmi-sysfs: loaded.\n");
>
>         return 0;
> --
> 1.9.1
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute
  2015-01-26 13:28 [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute Ivan Khoronzhuk
  2015-01-26 13:28 ` [Patch v2 1/2] firmware: dmi_scan: add symbol to get SMBIOS entry area Ivan Khoronzhuk
  2015-01-26 13:28 ` [Patch v2 2/2] firmware: dmi-sysfs: add SMBIOS entry point area attribute Ivan Khoronzhuk
@ 2015-01-27 11:35 ` Matt Fleming
  2015-01-27 16:23 ` Grant Likely
  3 siblings, 0 replies; 8+ messages in thread
From: Matt Fleming @ 2015-01-27 11:35 UTC (permalink / raw)
  To: Ivan Khoronzhuk
  Cc: linux-kernel, ard.biesheuvel, dmidecode-devel, grant.likely,
	leif.lindholm, matt.fleming

On Mon, 26 Jan, at 03:28:36PM, Ivan Khoronzhuk wrote:
> Some utils, like dmidecode and smbios, needs to access SMBIOS entry
> table area in order to get information like SMBIOS version, size, etc.
> Currently it's done via /dev/mem. But for situation when /dev/mem
> usage is disabled, the utils have to use dmi sysfs instead, which
> doesn't represent SMBIOS entry. So this patch series adds SMBIOS
> area to dmi sysfs in order to allow utils in question to work
> correctly with dmi sysfs.
> 
> v1: https://lkml.org/lkml/2015/1/23/643
> 
> v2..v1:
>   firmware: dmi_scan: add symbol to get SMBIOS entry area
> 	- used additional static var to hold SMBIOS raw table size
> 	- changed format of get_smbios_entry_area symbol
> 	  returned pointer on const smbios table
> 
>   firmware: dmi-sysfs: add SMBIOS entry point area attribute
> 	- adopted to updated get_smbios_entry_area symbol
>   	- removed redundant array to save smbios table
> 
> Ivan Khoronzhuk (2):
>   firmware: dmi_scan: add symbol to get SMBIOS entry area
>   firmware: dmi-sysfs: add SMBIOS entry point area attribute
> 
>  drivers/firmware/dmi-sysfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>  drivers/firmware/dmi_scan.c  | 26 ++++++++++++++++++++++++++
>  include/linux/dmi.h          |  3 +++
>  3 files changed, 71 insertions(+)

Unless anyone beats me to it, I'll pickup these two patches.

-- 
Matt Fleming, Intel Open Source Technology Center

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute
  2015-01-26 13:28 [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute Ivan Khoronzhuk
                   ` (2 preceding siblings ...)
  2015-01-27 11:35 ` [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute Matt Fleming
@ 2015-01-27 16:23 ` Grant Likely
  2015-01-27 18:13   ` Ivan Khoronzhuk
  3 siblings, 1 reply; 8+ messages in thread
From: Grant Likely @ 2015-01-27 16:23 UTC (permalink / raw)
  To: Ivan Khoronzhuk, linux-kernel, ard.biesheuvel
  Cc: dmidecode-devel, leif.lindholm, matt.fleming, Ivan Khoronzhuk

On Mon, 26 Jan 2015 15:28:36 +0200
, Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
 wrote:
> Some utils, like dmidecode and smbios, needs to access SMBIOS entry
> table area in order to get information like SMBIOS version, size, etc.
> Currently it's done via /dev/mem. But for situation when /dev/mem
> usage is disabled, the utils have to use dmi sysfs instead, which
> doesn't represent SMBIOS entry. So this patch series adds SMBIOS
> area to dmi sysfs in order to allow utils in question to work
> correctly with dmi sysfs.
> 
> v1: https://lkml.org/lkml/2015/1/23/643

Hi Ivan,

The change looks good to me, but it is an ABI addition, so it needs to
be documented. You'll need to add a description to:

Documentation/ABI/testing/sysfs-testing/sysfs-firmware-dmi

Second, (minor point), there is no reason to split this up into two
patches. It is one feature, and would be better as a single patch.

g.

> 
> v2..v1:
>   firmware: dmi_scan: add symbol to get SMBIOS entry area
> 	- used additional static var to hold SMBIOS raw table size
> 	- changed format of get_smbios_entry_area symbol
> 	  returned pointer on const smbios table
> 
>   firmware: dmi-sysfs: add SMBIOS entry point area attribute
> 	- adopted to updated get_smbios_entry_area symbol
>   	- removed redundant array to save smbios table
> 
> Ivan Khoronzhuk (2):
>   firmware: dmi_scan: add symbol to get SMBIOS entry area
>   firmware: dmi-sysfs: add SMBIOS entry point area attribute
> 
>  drivers/firmware/dmi-sysfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>  drivers/firmware/dmi_scan.c  | 26 ++++++++++++++++++++++++++
>  include/linux/dmi.h          |  3 +++
>  3 files changed, 71 insertions(+)
> 
> -- 
> 1.9.1
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute
  2015-01-27 16:23 ` Grant Likely
@ 2015-01-27 18:13   ` Ivan Khoronzhuk
  0 siblings, 0 replies; 8+ messages in thread
From: Ivan Khoronzhuk @ 2015-01-27 18:13 UTC (permalink / raw)
  To: Grant Likely, linux-kernel, ard.biesheuvel
  Cc: dmidecode-devel, leif.lindholm, matt.fleming


On 01/27/2015 06:23 PM, Grant Likely wrote:
> On Mon, 26 Jan 2015 15:28:36 +0200
> , Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
>   wrote:
>> Some utils, like dmidecode and smbios, needs to access SMBIOS entry
>> table area in order to get information like SMBIOS version, size, etc.
>> Currently it's done via /dev/mem. But for situation when /dev/mem
>> usage is disabled, the utils have to use dmi sysfs instead, which
>> doesn't represent SMBIOS entry. So this patch series adds SMBIOS
>> area to dmi sysfs in order to allow utils in question to work
>> correctly with dmi sysfs.
>>
>> v1: https://lkml.org/lkml/2015/1/23/643
> Hi Ivan,
>
> The change looks good to me, but it is an ABI addition, so it needs to
> be documented. You'll need to add a description to:
>
> Documentation/ABI/testing/sysfs-testing/sysfs-firmware-dmi

Ups...
Ok, It'll be in Documentation/ABI/testing/sysfs-firmware-dmi
Thanks!

>
> Second, (minor point), there is no reason to split this up into two
> patches. It is one feature, and would be better as a single patch.
>
> g.

Ok, it'll be one patch, including documentation

>
>> v2..v1:
>>    firmware: dmi_scan: add symbol to get SMBIOS entry area
>> 	- used additional static var to hold SMBIOS raw table size
>> 	- changed format of get_smbios_entry_area symbol
>> 	  returned pointer on const smbios table
>>
>>    firmware: dmi-sysfs: add SMBIOS entry point area attribute
>> 	- adopted to updated get_smbios_entry_area symbol
>>    	- removed redundant array to save smbios table
>>
>> Ivan Khoronzhuk (2):
>>    firmware: dmi_scan: add symbol to get SMBIOS entry area
>>    firmware: dmi-sysfs: add SMBIOS entry point area attribute
>>
>>   drivers/firmware/dmi-sysfs.c | 42 ++++++++++++++++++++++++++++++++++++++++++
>>   drivers/firmware/dmi_scan.c  | 26 ++++++++++++++++++++++++++
>>   include/linux/dmi.h          |  3 +++
>>   3 files changed, 71 insertions(+)
>>
>> -- 
>> 1.9.1
>>


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-01-27 18:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-26 13:28 [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute Ivan Khoronzhuk
2015-01-26 13:28 ` [Patch v2 1/2] firmware: dmi_scan: add symbol to get SMBIOS entry area Ivan Khoronzhuk
2015-01-26 13:32   ` Ard Biesheuvel
2015-01-26 13:28 ` [Patch v2 2/2] firmware: dmi-sysfs: add SMBIOS entry point area attribute Ivan Khoronzhuk
2015-01-26 13:34   ` Ard Biesheuvel
2015-01-27 11:35 ` [Patch v2 0/2] firmware: dmi-sysfs: add SMBIOS entry point area raw attribute Matt Fleming
2015-01-27 16:23 ` Grant Likely
2015-01-27 18:13   ` Ivan Khoronzhuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).