All of lore.kernel.org
 help / color / mirror / Atom feed
* kernel unaligned accesses on 2.6.29.
@ 2009-03-24 17:28 Robin Holt
  2009-03-25  1:14   ` Robin Holt
  0 siblings, 1 reply; 7+ messages in thread
From: Robin Holt @ 2009-03-24 17:28 UTC (permalink / raw)
  To: linux-ia64

I just built and booted an ia64 2.6.29 kernel.  While accessing NFS
filesystems, I occassionally get:

kernel unaligned access to 0xe00007bc3b8f67b9, ip=0xa00000020a61e370
kernel unaligned access to 0xe00007bc3b8f67b1, ip=0xa00000020a61e3d1

grep a00000020a61 /proc/modules
lockd 146448 1 nfs, Live 0xa00000020a610000


These come in pairs.  I tracked it down to the lockd.ko kernel module
and then objdump'd to find we are in:


nsm_get_handle
nsm_init_private():
/data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:280
    e370:       0b 00 98 68 98 11       [MMI]       st8 [r52]=r38;;
/data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:279
    e376:       00 00 00 02 00 00                   nop.m 0x0
    e37c:       92 d0 e9 53                         shl r16=r9,5;;

nsm_display_address():
/data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:86
...
    e3d0:       0a 60 28 1c 8d 39       [MMI]       cmp4.eq p12,p13\x10,r14;;
    e3d6:       00 a8 95 30 23 00                   st8 [r37]=r53
    e3dc:       00 00 04 00                         nop.i 0x0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kernel unaligned accesses on 2.6.29.
  2009-03-24 17:28 kernel unaligned accesses on 2.6.29 Robin Holt
@ 2009-03-25  1:14   ` Robin Holt
  0 siblings, 0 replies; 7+ messages in thread
From: Robin Holt @ 2009-03-25  1:14 UTC (permalink / raw)
  To: Chuck Lever, tony.luck; +Cc: linux-ia64, linux-kernel

Had a few minutes to look around.

On Tue, Mar 24, 2009 at 12:28:57PM -0500, Robin Holt wrote:
> I just built and booted an ia64 2.6.29 kernel.  While accessing NFS
> filesystems, I occassionally get:
> 
> kernel unaligned access to 0xe00007bc3b8f67b9, ip=0xa00000020a61e370
> kernel unaligned access to 0xe00007bc3b8f67b1, ip=0xa00000020a61e3d1
> 
> grep a00000020a61 /proc/modules
> lockd 146448 1 nfs, Live 0xa00000020a610000
> 
> 
> These come in pairs.  I tracked it down to the lockd.ko kernel module
> and then objdump'd to find we are in:
> 
> 
> nsm_get_handle
> nsm_init_private():
> /data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:280
>     e370:       0b 00 98 68 98 11       [MMI]       st8 [r52]=r38;;

This one is:
	u64 *p = (u64 *)&nsm->sm_priv.data;
	...
	*p = (unsigned long)nsm;

sm_priv.data is an unsigned char array, so there are no alignment
rules. You either need to use memcpy, or not define it as an unsigned
char.  Tony, any suggestions?

> /data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:279
>     e376:       00 00 00 02 00 00                   nop.m 0x0
>     e37c:       92 d0 e9 53                         shl r16=r9,5;;
> 
> nsm_display_address():
> /data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:86
> ...
>     e3d0:       0a 60 28 1c 8d 39       [MMI]       cmp4.eq p12,p13\x10,r14;;
>     e3d6:       00 a8 95 30 23 00                   st8 [r37]=r53

Haven't gotten to this one yet.

Robin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kernel unaligned accesses on 2.6.29.
@ 2009-03-25  1:14   ` Robin Holt
  0 siblings, 0 replies; 7+ messages in thread
From: Robin Holt @ 2009-03-25  1:14 UTC (permalink / raw)
  To: Chuck Lever, tony.luck; +Cc: linux-ia64, linux-kernel

Had a few minutes to look around.

On Tue, Mar 24, 2009 at 12:28:57PM -0500, Robin Holt wrote:
> I just built and booted an ia64 2.6.29 kernel.  While accessing NFS
> filesystems, I occassionally get:
> 
> kernel unaligned access to 0xe00007bc3b8f67b9, ip=0xa00000020a61e370
> kernel unaligned access to 0xe00007bc3b8f67b1, ip=0xa00000020a61e3d1
> 
> grep a00000020a61 /proc/modules
> lockd 146448 1 nfs, Live 0xa00000020a610000
> 
> 
> These come in pairs.  I tracked it down to the lockd.ko kernel module
> and then objdump'd to find we are in:
> 
> 
> nsm_get_handle
> nsm_init_private():
> /data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:280
>     e370:       0b 00 98 68 98 11       [MMI]       st8 [r52]=r38;;

This one is:
	u64 *p = (u64 *)&nsm->sm_priv.data;
	...
	*p = (unsigned long)nsm;

sm_priv.data is an unsigned char array, so there are no alignment
rules. You either need to use memcpy, or not define it as an unsigned
char.  Tony, any suggestions?

> /data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:279
>     e376:       00 00 00 02 00 00                   nop.m 0x0
>     e37c:       92 d0 e9 53                         shl r16=r9,5;;
> 
> nsm_display_address():
> /data/lwork/attica2/holt/git-linus/v2.6.29/fs/lockd/mon.c:86
> ...
>     e3d0:       0a 60 28 1c 8d 39       [MMI]       cmp4.eq p12,p13=10,r14;;
>     e3d6:       00 a8 95 30 23 00                   st8 [r37]=r53

Haven't gotten to this one yet.

Robin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kernel unaligned accesses on 2.6.29.
  2009-03-25  1:14   ` Robin Holt
@ 2009-03-25  1:21     ` Robin Holt
  -1 siblings, 0 replies; 7+ messages in thread
From: Robin Holt @ 2009-03-25  1:21 UTC (permalink / raw)
  To: Chuck Lever, tony.luck; +Cc: linux-ia64, linux-kernel

On Tue, Mar 24, 2009 at 08:14:18PM -0500, Robin Holt wrote:
> Had a few minutes to look around.
...
> This one is:
> 	u64 *p = (u64 *)&nsm->sm_priv.data;
> 	...
> 	*p = (unsigned long)nsm;
...
> >     e3d0:       0a 60 28 1c 8d 39       [MMI]       cmp4.eq p12,p13\x10,r14;;
> >     e3d6:       00 a8 95 30 23 00                   st8 [r37]=r53
> 

Well, that was easy.  This is the store part of
	*p++ = timespec_to_ns(&ts);

Again, comes down to &nsm->sm_priv.data not being aligned.

Robin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kernel unaligned accesses on 2.6.29.
@ 2009-03-25  1:21     ` Robin Holt
  0 siblings, 0 replies; 7+ messages in thread
From: Robin Holt @ 2009-03-25  1:21 UTC (permalink / raw)
  To: Chuck Lever, tony.luck; +Cc: linux-ia64, linux-kernel

On Tue, Mar 24, 2009 at 08:14:18PM -0500, Robin Holt wrote:
> Had a few minutes to look around.
...
> This one is:
> 	u64 *p = (u64 *)&nsm->sm_priv.data;
> 	...
> 	*p = (unsigned long)nsm;
...
> >     e3d0:       0a 60 28 1c 8d 39       [MMI]       cmp4.eq p12,p13=10,r14;;
> >     e3d6:       00 a8 95 30 23 00                   st8 [r37]=r53
> 

Well, that was easy.  This is the store part of
	*p++ = timespec_to_ns(&ts);

Again, comes down to &nsm->sm_priv.data not being aligned.

Robin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kernel unaligned accesses on 2.6.29.
  2009-03-25  1:14   ` Robin Holt
@ 2009-03-25  2:04     ` David Miller
  -1 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-03-25  2:04 UTC (permalink / raw)
  To: holt; +Cc: chuck.lever, tony.luck, linux-ia64, linux-kernel

From: Robin Holt <holt@sgi.com>
Date: Tue, 24 Mar 2009 20:14:18 -0500

> You either need to use memcpy, or not define it as an unsigned char.
> Tony, any suggestions?

memcpy() might not work in this scenerio.

GCC can still emit an inline 64-bit memory access if it
deems that the objects involved should be sufficiently
aligned.

It might not be able to in this specific case, but it is
something to be aware of.  Don't be convinced of any fix
for this until the assembler is inspected by hand :-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: kernel unaligned accesses on 2.6.29.
@ 2009-03-25  2:04     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-03-25  2:04 UTC (permalink / raw)
  To: holt; +Cc: chuck.lever, tony.luck, linux-ia64, linux-kernel

From: Robin Holt <holt@sgi.com>
Date: Tue, 24 Mar 2009 20:14:18 -0500

> You either need to use memcpy, or not define it as an unsigned char.
> Tony, any suggestions?

memcpy() might not work in this scenerio.

GCC can still emit an inline 64-bit memory access if it
deems that the objects involved should be sufficiently
aligned.

It might not be able to in this specific case, but it is
something to be aware of.  Don't be convinced of any fix
for this until the assembler is inspected by hand :-)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-03-25  2:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-24 17:28 kernel unaligned accesses on 2.6.29 Robin Holt
2009-03-25  1:14 ` Robin Holt
2009-03-25  1:14   ` Robin Holt
2009-03-25  1:21   ` Robin Holt
2009-03-25  1:21     ` Robin Holt
2009-03-25  2:04   ` David Miller
2009-03-25  2:04     ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.