linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-arch <linux-arch@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [GIT PULL 2/2] asm-generic: Unify asm/unaligned.h around struct helper
Date: Fri, 2 Jul 2021 15:49:30 +0200	[thread overview]
Message-ID: <CAK8P3a3Y1FHaS0yRAeBYmq0Z-yXtvHBRRiO1tNHKf-TaWVrFzQ@mail.gmail.com> (raw)
In-Reply-To: <CAK8P3a2oZ-+qd3Nhpy9VVXCJB3DU5N-y-ta2JpP0t6NHh=GVXw@mail.gmail.com>

The following changes since commit 6efb943b8616ec53a5e444193dccf1af9ad627b5:

  Linux 5.13-rc1 (2021-05-09 14:17:44 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
tags/asm-generic-unaligned-5.14

for you to fetch changes up to 803f4e1eab7a8938ba3a3c30dd4eb5e9eeef5e63:

  asm-generic: simplify asm/unaligned.h (2021-05-17 13:30:29 +0200)

----------------------------------------------------------------
asm-generic/unaligned: Unify asm/unaligned.h around struct helper

The get_unaligned()/put_unaligned() helpers are traditionally architecture
specific, with the two main variants being the "access-ok.h" version
that assumes unaligned pointer accesses always work on a particular
architecture, and the "le-struct.h" version that casts the data to a
byte aligned type before dereferencing, for architectures that cannot
always do unaligned accesses in hardware.

Based on the discussion linked below, it appears that the access-ok
version is not realiable on any architecture, but the struct version
probably has no downsides. This series changes the code to use the
same implementation on all architectures, addressing the few exceptions
separately.

Link: https://lore.kernel.org/lkml/75d07691-1e4f-741f-9852-38c0b4f520bc@synopsys.com/
Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100363
Link: https://lore.kernel.org/lkml/20210507220813.365382-14-arnd@kernel.org/
Link: git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git
unaligned-rework-v2
Link: https://lore.kernel.org/lkml/CAHk-=whGObOKruA_bU3aPGZfoDqZM1_9wBkwREp0H0FgR-90uQ@mail.gmail.com/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

----------------------------------------------------------------
Arnd Bergmann (13):
      asm-generic: use asm-generic/unaligned.h for most architectures
      openrisc: always use unaligned-struct header
      sh: remove unaligned access for sh4a
      m68k: select CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
      powerpc: use linux/unaligned/le_struct.h on LE power7
      asm-generic: unaligned: remove byteshift helpers
      asm-generic: unaligned always use struct helpers
      partitions: msdos: fix one-byte get_unaligned()
      apparmor: use get_unaligned() only for multi-byte words
      mwifiex: re-fix for unaligned accesses
      netpoll: avoid put_unaligned() on single character
      asm-generic: uaccess: 1-byte access is always aligned
      asm-generic: simplify asm/unaligned.h

 arch/alpha/include/asm/unaligned.h          |  12 --
 arch/arm/include/asm/unaligned.h            |  27 ----
 arch/ia64/include/asm/unaligned.h           |  12 --
 arch/m68k/Kconfig                           |   1 +
 arch/m68k/include/asm/unaligned.h           |  26 ----
 arch/microblaze/include/asm/unaligned.h     |  27 ----
 arch/mips/crypto/crc32-mips.c               |   2 +-
 arch/openrisc/include/asm/unaligned.h       |  47 -------
 arch/parisc/include/asm/unaligned.h         |   6 +-
 arch/powerpc/include/asm/unaligned.h        |  22 ---
 arch/sh/include/asm/unaligned-sh4a.h        | 199 ----------------------------
 arch/sh/include/asm/unaligned.h             |  13 --
 arch/sparc/include/asm/unaligned.h          |  11 --
 arch/x86/include/asm/unaligned.h            |  15 ---
 arch/xtensa/include/asm/unaligned.h         |  29 ----
 block/partitions/ldm.c                      |   2 +-
 block/partitions/ldm.h                      |   3 -
 block/partitions/msdos.c                    |  24 ++--
 drivers/net/wireless/marvell/mwifiex/pcie.c |  10 +-
 include/asm-generic/uaccess.h               |   4 +-
 include/asm-generic/unaligned.h             | 141 ++++++++++++++++----
 include/linux/unaligned/access_ok.h         |  68 ----------
 include/linux/unaligned/be_byteshift.h      |  71 ----------
 include/linux/unaligned/be_memmove.h        |  37 ------
 include/linux/unaligned/be_struct.h         |  37 ------
 include/linux/unaligned/generic.h           | 115 ----------------
 include/linux/unaligned/le_byteshift.h      |  71 ----------
 include/linux/unaligned/le_memmove.h        |  37 ------
 include/linux/unaligned/le_struct.h         |  37 ------
 include/linux/unaligned/memmove.h           |  46 -------
 net/core/netpoll.c                          |   4 +-
 security/apparmor/policy_unpack.c           |   2 +-
 32 files changed, 141 insertions(+), 1017 deletions(-)
 delete mode 100644 arch/alpha/include/asm/unaligned.h
 delete mode 100644 arch/arm/include/asm/unaligned.h
 delete mode 100644 arch/ia64/include/asm/unaligned.h
 delete mode 100644 arch/m68k/include/asm/unaligned.h
 delete mode 100644 arch/microblaze/include/asm/unaligned.h
 delete mode 100644 arch/openrisc/include/asm/unaligned.h
 delete mode 100644 arch/powerpc/include/asm/unaligned.h
 delete mode 100644 arch/sh/include/asm/unaligned-sh4a.h
 delete mode 100644 arch/sh/include/asm/unaligned.h
 delete mode 100644 arch/sparc/include/asm/unaligned.h
 delete mode 100644 arch/x86/include/asm/unaligned.h
 delete mode 100644 arch/xtensa/include/asm/unaligned.h
 delete mode 100644 include/linux/unaligned/access_ok.h
 delete mode 100644 include/linux/unaligned/be_byteshift.h
 delete mode 100644 include/linux/unaligned/be_memmove.h
 delete mode 100644 include/linux/unaligned/be_struct.h
 delete mode 100644 include/linux/unaligned/generic.h
 delete mode 100644 include/linux/unaligned/le_byteshift.h
 delete mode 100644 include/linux/unaligned/le_memmove.h
 delete mode 100644 include/linux/unaligned/le_struct.h
 delete mode 100644 include/linux/unaligned/memmove.h

  reply	other threads:[~2021-07-02 13:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-02 13:47 [GIT PULL 1/2] asm-generic: rework PCI I/O space access Arnd Bergmann
2021-07-02 13:49 ` Arnd Bergmann [this message]
2021-07-02 20:13   ` [GIT PULL 2/2] asm-generic: Unify asm/unaligned.h around struct helper pr-tracker-bot
2021-07-02 19:42 ` [GIT PULL 1/2] asm-generic: rework PCI I/O space access Linus Torvalds
2021-07-03 12:12   ` Arnd Bergmann
2021-07-05 10:06     ` Arnd Bergmann
2021-08-03  9:46       ` John Garry
2021-08-03 10:06         ` Arnd Bergmann
2021-08-03 11:23           ` John Garry
2021-08-03 12:15             ` Arnd Bergmann
2021-08-04  7:55               ` John Garry
2021-08-04  8:52                 ` Arnd Bergmann
2021-08-10  9:19                   ` John Garry
2021-08-10 11:33                     ` Arnd Bergmann
2021-09-03  8:31                       ` Niklas Schnelle
2021-12-17 13:19                       ` Niklas Schnelle
2021-12-17 13:32                         ` Arnd Bergmann
2021-12-17 13:52                           ` Niklas Schnelle
2021-12-17 14:05                             ` Arnd Bergmann
2021-12-17 14:27                             ` John Garry
2021-12-17 14:32                               ` Arnd Bergmann
2021-12-17 15:27                                 ` John Garry
2021-12-17 15:55                                   ` Arnd Bergmann
2021-12-17 16:30                                     ` John Garry
2021-12-20  9:27                                       ` Niklas Schnelle
2021-12-21 16:48                                         ` John Garry
2021-12-21 16:57                                           ` Niklas Schnelle
2021-12-19 14:23                               ` David Laight
2021-12-21 16:21                                 ` John Garry
2021-07-05 12:40     ` Niklas Schnelle

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=CAK8P3a3Y1FHaS0yRAeBYmq0Z-yXtvHBRRiO1tNHKf-TaWVrFzQ@mail.gmail.com \
    --to=arnd@kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).