• Chris Metcalf's avatar
    connector: improved unaligned access error fix · f0173a11
    Chris Metcalf authored
    [ Upstream commit 1ca1a4cf59ea343a1a70084fe7cc96f37f3cf5b1 ]
    In af3e095a, Erik Jacobsen fixed one type of unaligned access
    bug for ia64 by converting a 64-bit write to use put_unaligned().
    Unfortunately, since gcc will convert a short memset() to a series
    of appropriately-aligned stores, the problem is now visible again
    on tilegx, where the memset that zeros out proc_event is converted
    to three 64-bit stores, causing an unaligned access panic.
    A better fix for the original problem is to ensure that proc_event
    is aligned to 8 bytes here.  We can do that relatively easily by
    arranging to start the struct cn_msg aligned to 8 bytes and then
    offset by 4 bytes.  Doing so means that the immediately following
    proc_event structure is then correctly aligned to 8 bytes.
    The result is that the memset() stores are now aligned, and as an
    added benefit, we can remove the put_unaligned() calls in the code.
    Signed-off-by: 's avatarChris Metcalf <cmetcalf@tilera.com>
    Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Last commit
Last update
Kconfig Loading commit data...
Makefile Loading commit data...
cn_proc.c Loading commit data...
cn_queue.c Loading commit data...
connector.c Loading commit data...