All of lore.kernel.org
 help / color / mirror / Atom feed
* Missing memory clobber in ip_fast_csum
@ 2008-05-31 11:13 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2008-05-31 11:13 UTC (permalink / raw)
  To: dhowells, lethal, linux-sh, chris; +Cc: linux-arch, Kyle McMartin


Kyle McMartin just tracked down a bug on parisc to a missing "memory"
clobber in the inline assembly implementation of ip_fast_csum.  The FRV,
SH and Xtensa ports are also missing a memory clobber, so I thought it
would be polite to let you know.

The bug manifests as dropped network packets (obviously they have the
wrong checksum).  It started appearing for parisc with GCC 4.3.

The GCC manual says:

 If your assembler instructions access memory in an unpredictable
 fashion, add `memory' to the list of clobbered registers.  This will
 cause GCC to not keep memory values cached in registers across the
 assembler instruction and not optimize stores or loads to that memory.

I see that FRV has a 400 byte memory output which may prevent this
problem from appearing, but SH and Xtensa have nothing to prevent this
bug.  Hope this saves you a few days of debugging.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

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

* Missing memory clobber in ip_fast_csum
@ 2008-05-31 11:13 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2008-05-31 11:13 UTC (permalink / raw)
  To: dhowells, lethal, linux-sh, chris; +Cc: linux-arch, Kyle McMartin


Kyle McMartin just tracked down a bug on parisc to a missing "memory"
clobber in the inline assembly implementation of ip_fast_csum.  The FRV,
SH and Xtensa ports are also missing a memory clobber, so I thought it
would be polite to let you know.

The bug manifests as dropped network packets (obviously they have the
wrong checksum).  It started appearing for parisc with GCC 4.3.

The GCC manual says:

 If your assembler instructions access memory in an unpredictable
 fashion, add `memory' to the list of clobbered registers.  This will
 cause GCC to not keep memory values cached in registers across the
 assembler instruction and not optimize stores or loads to that memory.

I see that FRV has a 400 byte memory output which may prevent this
problem from appearing, but SH and Xtensa have nothing to prevent this
bug.  Hope this saves you a few days of debugging.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."

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

end of thread, other threads:[~2008-05-31 11:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-31 11:13 Missing memory clobber in ip_fast_csum Matthew Wilcox
2008-05-31 11:13 ` Matthew Wilcox

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.