mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Tony Luck <tony.luck@intel.com>
Cc: Mike Waychison <mikew@google.com>,
	Olof Johansson <olofj@chromium.org>,
	Andi Kleen <andi@firstfloor.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	Robert Lippert <rlippert@google.com>,
	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: Re: [PATCH v2 2/5] firmware: Basic dmi-sysfs support
Date: Fri, 25 Feb 2011 11:58:10 -0800	[thread overview]
Message-ID: <20110225195810.GB8860@kroah.com> (raw)
In-Reply-To: <AANLkTi=dE5_VjJ+5H6cWf9nAtdkLiqhSXo6Gvd_uGQ25@mail.gmail.com>

On Wed, Feb 23, 2011 at 01:29:46PM -0800, Tony Luck wrote:
> On Wed, Feb 23, 2011 at 12:28 PM, Mike Waychison <mikew@google.com> wrote:
> > Ya, I don't think there is anything that guarantees that dmi_header is
> > aligned.   The access is probably the struct copy I did here:
> >
> >        /* Set the key */
> >        entry->dh = *dh;
> 
> Yup - looking back at the assembly I see that one of the 2-byte
> accesses is offset 2
> (picking up ->handle), but the second is offset 0 (picking up ->type
> and ->length). The
> compiler assumed the structure was 2-byte aligned because of ->handle.
> 
> > What if we changed that guy to use memcpy?  We'd probably need to
> > memcpy the dmi_system_event_log as well.  Patch attached (applies on
> > top of the entire patchset).
> 
> With the patch, all the unaligned accesses go away.
> 
> Tested-by: Tony Luck <tony.luck@intel.com>

Great!

Mike, care to resend this last patch as a 6/5 patch with a proper
subject, changelog comment, and signed-off-by: section so that I can
queue it up?

thanks,

greg k-h

  reply	other threads:[~2011-02-25 20:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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
2011-02-23 20:28     ` Mike Waychison
2011-02-23 21:29       ` Tony Luck
2011-02-25 19:58         ` Greg KH [this message]
2011-02-23  1:53 ` [PATCH v2 3/5] firmware: Break out system_event_log in dmi-sysfs Mike Waychison
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
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
2011-02-25 23:20   ` Greg KH
2011-02-25 23:41 ` [resend PATCH " Mike Waychison

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=20110225195810.GB8860@kroah.com \
    --to=greg@kroah.com \
    --cc=adurbin@google.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=andi@firstfloor.org \
    --cc=dhendrix@chromium.org \
    --cc=dlaurie@google.com \
    --cc=jonmayer@google.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikew@google.com \
    --cc=olofj@chromium.org \
    --cc=rlippert@google.com \
    --cc=thockin@google.com \
    --cc=tony.luck@intel.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