lkml.org 
[lkml]   [2011]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 2/5] firmware: Basic dmi-sysfs support
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-02-25 21:03    [W:0.063 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site