All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Hellstrom <daniel@gaisler.com>
To: sparclinux@vger.kernel.org
Subject: Re: [PATCH]SPARC32: Fixed unaligned memory copying in function __csum_partial_copy_sparc_generic
Date: Wed, 11 May 2011 12:53:40 +0000	[thread overview]
Message-ID: <4DCA86D4.7020506@gaisler.com> (raw)
In-Reply-To: <1304845558.9492.14.camel@big>

Tkhai Kirill wrote:

>When we are in the label cc_dword_align, registers %o0 and %o1 have the same last 2 bits,
>but it's not guaranteed one of they is zero. So we can get unaligned memory access
>in label ccte. Example of parameters which lead to this:
>%o0=0x7ff183e9, %o1=0x8e709e7d, %g1=3
>  
>
I just wanted to add that I also got unaligned accesses in the checksum 
calculation on the SPARC32/LEON. Bad alignment is bad for performance of 
course, in my case the MNA-trap handler was erroneous storing 
incorrectly and that was the reason for me to notice it. I did not look 
at the reason for the unaligned access in the first place though.

Daniel


commit 2492218c63dca0fb4f041bdc366d243ae3426b40
Author: Daniel Hellstrom <daniel@gaisler.com>
Date:   Tue Feb 1 12:39:59 2011 -0800

    sparc32: unaligned memory access (MNA) trap handler bug

    Since commit f0e98c387e61de00646be31fab4c2fa0224e1efb ("[SPARC]: Fix
    link errors with gcc-4.3") the MNA trap handler does not emulate
    stores to unaligned addresses correctly. MNA operation from both
    kernel and user space are affected.

    A typical effect of this bug is nr_frags in skbs are overwritten
    during buffer copying/checksum-calculation, or maximally 6 bytes
    of data in the network buffer will be overwitten with garbage.

    Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>


  parent reply	other threads:[~2011-05-11 12:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-08  9:05 [PATCH]SPARC32: Fixed unaligned memory copying in function kirill
2011-05-08 23:44 ` David Miller
2011-05-09  8:49 ` [PATCH]SPARC32: Fixed unaligned memory copying in function __csum_partial_copy_sparc_generic Tkhai Kirill
2011-05-09 18:33 ` [PATCH]SPARC32: Fixed unaligned memory copying in function David Miller
2011-05-09 19:55 ` [PATCH]SPARC32: Fixed unaligned memory copying in function __csum_partial_copy_sparc_generic Tkhai Kirill
2011-05-10 12:31 ` Tkhai Kirill
2011-05-10 20:28 ` [PATCH]SPARC32: Fixed unaligned memory copying in function David Miller
2011-05-10 23:21 ` [PATCH]SPARC32: Fixed unaligned memory copying in function __csum_partial_copy_sparc_generic Tkhai Kirill
2011-05-11 12:53 ` Daniel Hellstrom [this message]
2011-05-11 17:10 ` [PATCH]SPARC32: Fixed unaligned memory copying in function David Miller
2011-05-12  4:38 ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DCA86D4.7020506@gaisler.com \
    --to=daniel@gaisler.com \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.