[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AANLkTi=+-Wc0bWdpvR+X6UszLf7MXKYgi8Oo6anN-jR8@mail.gmail.com>
Date: Wed, 23 Feb 2011 12:28:46 -0800
From: Mike Waychison <mikew@...gle.com>
To: Tony Luck <tony.luck@...el.com>
Cc: Greg KH <greg@...ah.com>, Olof Johansson <olofj@...omium.org>,
Andi Kleen <andi@...stfloor.org>,
Alan Cox <alan@...rguk.ukuu.org.uk>,
Robert Lippert <rlippert@...gle.com>,
Jon Mayer <jonmayer@...gle.com>,
Duncan Laurie <dlaurie@...gle.com>,
Aaron Durbin <adurbin@...gle.com>,
linux-kernel@...r.kernel.org, Tim Hockin <thockin@...gle.com>,
David Hendrix <dhendrix@...omium.org>,
linux-api@...r.kernel.org
Subject: Re: [PATCH v2 2/5] firmware: Basic dmi-sysfs support
On Wed, Feb 23, 2011 at 11:43 AM, Tony Luck <tony.luck@...el.com> wrote:
> On Tue, Feb 22, 2011 at 5:53 PM, Mike Waychison <mikew@...gle.com> wrote:
>> +static void __init dmi_sysfs_register_handle(const struct dmi_header *dh,
>> + void *_ret)
>> +{
>
> I'm seeing some unaligned references from this function
> on ia64. Code is loading a 2-byte value from an odd
> address. We are dereferencing "dh", so looking at the
> dmi_header definition, I'd have thought that we must
> be touching dh->handle:
>
> struct dmi_header {
> u8 type;
> u8 length;
> u16 handle;
> };
>
> I don't see any code in this function that does this,
> so I assume there is some inlining or macro stuff
> happening.
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;
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).
Download attachment "patch" of type "application/octet-stream" (2379 bytes)
Powered by blists - more mailing lists