mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mike Waychison <mikew@google.com>
To: Greg KH <greg@kroah.com>, Olof Johansson <olofj@chromium.org>,
	Andi Kleen <andi@firstfloor.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Robert Lippert <rlippert@google.com>
Cc: Jon Mayer <jonmayer@google.com>,
	Duncan Laurie <dlaurie@google.com>,
	Aaron Durbin <adurbin@google.com>,
	linux-kernel@vger.kernel.org, Tim Hockin <thockin@google.com>,
	David Hendrix <dhendrix@chromium.org>,
	linux-api@vger.kernel.org
Subject: [PATCH v1 0/5] Exporting DMI entries via syfs
Date: Thu, 17 Feb 2011 13:27:55 -0800	[thread overview]
Message-ID: <20110217212754.3967.98648.stgit@mike.mtv.corp.google.com> (raw)

This patchset applies to v2.6.38-rc5.

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 it
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 to suit Chrome OS's needs
(http://code.google.com/p/chromium-os/issues/detail?id=6795) as well.

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 |  101 ++++
 drivers/firmware/Kconfig                     |   11 
 drivers/firmware/Makefile                    |    1 
 drivers/firmware/dmi-sysfs.c                 |  664 +++++++++++++++++++++++++++
 include/linux/dmi.h                          |   47 +
 5 files changed, 824 insertions(+)

changeLog:
==========
- v1
   - Initial public send-out.

             reply	other threads:[~2011-02-17 21:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-17 21:27 Mike Waychison [this message]
2011-02-17 21:28 ` [PATCH v1 1/5] firmware: Add DMI entry types to the headers Mike Waychison
2011-02-17 21:28 ` [PATCH v1 2/5] firmware: Basic dmi-sysfs support Mike Waychison
2011-02-17 21:42   ` Tim Hockin
2011-02-17 21:56   ` Greg KH
2011-02-22 23:31     ` Mike Waychison
2011-02-23  0:07       ` Luck, Tony
2011-02-22 23:49   ` Rob Lippert
2011-02-22 23:58     ` Mike Waychison
2011-02-17 21:28 ` [PATCH v1 3/5] firmware: Break out system_event_log in dmi-sysfs Mike Waychison
2011-02-17 21:28 ` [PATCH v1 4/5] firmware: Expose DMI type 15 System Event Log Mike Waychison
2011-02-17 21:28 ` [PATCH v1 5/5] firmware: Add documentation for /sys/firmware/dmi Mike Waychison
2011-02-17 21:50   ` Tim Hockin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110217212754.3967.98648.stgit@mike.mtv.corp.google.com \
    --to=mikew@google.com \
    --cc=adurbin@google.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andi@firstfloor.org \
    --cc=dhendrix@chromium.org \
    --cc=dlaurie@google.com \
    --cc=greg@kroah.com \
    --cc=jonmayer@google.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=olofj@chromium.org \
    --cc=rlippert@google.com \
    --cc=thockin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome