linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Exporting DMI entries via sysfs
@ 2011-02-23  1:53 Mike Waychison
  2011-02-23  1:53 ` [PATCH v2 1/5] firmware: Add DMI entry types to the headers Mike Waychison
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Mike Waychison @ 2011-02-23  1:53 UTC (permalink / raw)
  To: Greg KH, Olof Johansson, Andi Kleen, Alan Cox, Robert Lippert
  Cc: Jon Mayer, Tony Luck, Duncan Laurie, Aaron Durbin, linux-kernel,
	Tim Hockin, David Hendrix, linux-api

This patchset applies to v2.6.38-rc6.

The following series exports information the DMI / SMBIOS tables via
sysfs under the path /sys/firmware/dmi.

For our purposes, we actively use the System Event Log, as described by
DMI entry Type 15.  Currently, we have to grub around /dev/mem to find
this thing, and potentially need to issue IOs directly from userland to
get at the event log, which is suboptimal in terms of security and
architecture.

This series implements the basics needed to iterate through the DMI
entries safely from userland.  Each entry has the handle, the formatted
length and the raw bytes exposed in their own sub-directory under
/sys/firmware/dmi/entries/<type>-<instance>.

As well, this series explodes type 15 as a proof-of-concept of how we
can expose kernel interpretations of the entry data.  For most entries,
there isn't much sense in parsing the entry and exposing each field
as a sysfs attribute as they can be interpreted from userland by
accessing the raw entry itself.  Type 15 however describes an
indirection (pointing at the system event log), and it is generally
useful to export this log in raw form to the user (which requires
interpreting the DMI entry).

This driver relies solely on dmi_walk() for access to the dmi entries.
They are not kept mapped in the "rest" state.  The only bits memo-ized
by the objects in sysfs are the dmi headers, which are used to the find
the entries via dmi_walk on read.   Reading the raw bytes however is
'uncached' by this driver, so that any changes to the entries themselves
are reflected properly by the user-exposed interface.

We intend to use this on our production servers, though it seems to
also be sufficient in suiting Chrome OS's needs
(http://code.google.com/p/chromium-os/issues/detail?id=6795).

Thanks,

Mike Waychison

Related discussions
===================

   - Andi Kleen suggesting that perhaps this data could be exported via
     sysfs:

http://kerneltrap.org/mailarchive/linux-kernel/2010/9/28/4625643/thread

   - Tim Hockin suggesting a potential layout:

https://lkml.org/lkml/2011/2/10/550


Patchset summary
================

firmware: Add DMI entry types to the headers
firmware: Basic dmi-sysfs support
firmware: Break out system_event_log in dmi-sysfs
firmware: Expose DMI type 15 System Event Log
firmware: Add documentation for /sys/firmware/dmi

Diffstat
========

 Documentation/ABI/testing/sysfs-firmware-dmi |  110 ++++
 drivers/firmware/Kconfig                     |   11 
 drivers/firmware/Makefile                    |    1 
 drivers/firmware/dmi-sysfs.c                 |  698 +++++++++++++++++++++++++++
 include/linux/dmi.h                          |   47 +
 5 files changed, 867 insertions(+)

Changelog:
==========
- v2
   - Added 'type', 'instance' and 'position' attributes to each DMI entry.
   - Don't printk KERN_INFO on module load/unload.
   - Default to 'n' for Kconfig.
   - Grammar fixes.
   - Fixed bug reading raw files when multiple instances of the same
     type exist.
- v1
   - Initial public send-out.

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

end of thread, other threads:[~2011-02-25 23:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23  1:53 [PATCH v2 0/5] Exporting DMI entries via sysfs Mike Waychison
2011-02-23  1:53 ` [PATCH v2 1/5] firmware: Add DMI entry types to the headers Mike Waychison
2011-02-23  1:53 ` [PATCH v2 2/5] firmware: Basic dmi-sysfs support Mike Waychison
2011-02-23 19:43   ` Tony Luck
     [not found]     ` <AANLkTinjhY3oiFTq2xq4fwQ-mtLZ8ph435+nc5irM7wZ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-23 20:28       ` Mike Waychison
     [not found]         ` <AANLkTi=+-Wc0bWdpvR+X6UszLf7MXKYgi8Oo6anN-jR8-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-23 21:29           ` Tony Luck
     [not found]             ` <AANLkTi=dE5_VjJ+5H6cWf9nAtdkLiqhSXo6Gvd_uGQ25-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-02-25 19:58               ` Greg KH
2011-02-23  1:53 ` [PATCH v2 4/5] firmware: Expose DMI type 15 System Event Log Mike Waychison
2011-02-23  1:53 ` [PATCH v2 5/5] firmware: Add documentation for /sys/firmware/dmi Mike Waychison
     [not found] ` <20110223015307.13068.14063.stgit-tzAwxxnF6Tt6FDdRrpk8kO4/NqBCd+6Q@public.gmane.org>
2011-02-23  1:53   ` [PATCH v2 3/5] firmware: Break out system_event_log in dmi-sysfs Mike Waychison
2011-02-25 20:03   ` [PATCH v2 0/5] Exporting DMI entries via sysfs Greg KH
2011-02-25 23:06   ` [PATCH v2 6/5] Fix unaligned memory accesses in dmi-sysfs Mike Waychison
     [not found]     ` <4D6835F1.2050304-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2011-02-25 23:20       ` Greg KH
2011-02-25 23:41   ` [resend PATCH " Mike Waychison

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).