From: Greg KH Subject: Re: [PATCH v2 2/5] firmware: Basic dmi-sysfs support Date: Fri, 25 Feb 2011 11:58:10 -0800 Message-ID: <20110225195810.GB8860@kroah.com> References: <20110223015307.13068.14063.stgit@mike.mtv.corp.google.com> <20110223015320.13068.77428.stgit@mike.mtv.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Tony Luck Cc: Mike Waychison , Olof Johansson , Andi Kleen , Alan Cox , Robert Lippert , Jon Mayer , Duncan Laurie , Aaron Durbin , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Tim Hockin , David Hendrix , linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org On Wed, Feb 23, 2011 at 01:29:46PM -0800, Tony Luck wrote: > On Wed, Feb 23, 2011 at 12:28 PM, Mike Waychison w= rote: > > Ya, I don't think there is anything that guarantees that dmi_header= is > > aligned. =A0 The access is probably the struct copy I did here: > > > > =A0 =A0 =A0 =A0/* Set the key */ > > =A0 =A0 =A0 =A0entry->dh =3D *dh; >=20 > 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= =2E >=20 > > What if we changed that guy to use memcpy? =A0We'd probably need to > > memcpy the dmi_system_event_log as well. =A0Patch attached (applies= on > > top of the entire patchset). >=20 > With the patch, all the unaligned accesses go away. >=20 > Tested-by: Tony Luck 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