From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11395C433ED for ; Fri, 7 May 2021 22:14:27 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6F4C76135F for ; Fri, 7 May 2021 22:14:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F4C76135F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Y5ONgA4AcrFaXJYZwXYkwQYAayx5APE4Ij0ySeItPQ0=; b=jJMywerjtfMoeKidWBP485ePJ +8YiskzftSe+vuwdR0dfEja1hOsDmOF2XFRrymmGJ5L7pEkyDgNGC+qQpDt8a1MP5Klxzd03sQWDA Oso1BjX2q9NqH1uojAAeyfR4qWmGuT2SBLY516jn5MZJHys7GNs171AN4MiUhLrsq7j5+vQR5/MVH TzKQETk9iEhC9U6Y0xyL05mKT8MjUfEKaMxzvkrB8NjeR08tGlS5RoF6P4MYV2yYQhNuORUu2yoCx VRa9tXHQxT87TES9fkzvzpaW0FbuLM0ez5EhV6a7Rv+Zon4v5RLesfrWhc/GDkusgRcbBPlK4Erhq Wa66IkOhg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lf8i8-00898D-1c; Fri, 07 May 2021 22:12:40 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lf8i5-008975-Ck for linux-arm-kernel@desiato.infradead.org; Fri, 07 May 2021 22:12:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender :Reply-To:Content-Type:Content-ID:Content-Description; bh=DLFkeFWqqnqMGk6E8NQ//pG5LCohNbcK3u44FxpBHow=; b=i+BXVVp+36HuW1K2ScyYvGiLoq iMKUVs0zkVsP+BgJveU1jcdj5EFPyTv5DT+w99YYQd+nq5QIkdPRi4Q/4LomWbMQd+hMR7yKBKTJw HApdwa1SRVzH/OKrLIfk+LdH+FIQvI3U2DwdQdSDIQJIie0GJvb/YqYYjHzJWdkpS+04bWQawb/iF EaKmD9YB2Kn2BKH4wvpsDxnwvLa2hy5ZPUkCEGJ40/wqRgGzxaja9+aLjtMvs8gnyWB5breNzcXUP LjCmxNLZEJ+4/HFONPMT/q7cd6RJsu/9XkjpdlE+PC7qUACDyH9u6jfKDJgT34A7zay+1tWFf0CW1 /zJ0cy2A==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lf8i2-007DWX-Cy for linux-arm-kernel@lists.infradead.org; Fri, 07 May 2021 22:12:36 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1AD8261164; Fri, 7 May 2021 22:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620425553; bh=pLN/AlAGxiGZnqtkHzoskF1g1y+Og1zx70nNd/gvob8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pBsqGsNNIzjK+PGIuts/XJxLGOfdWKWNQVtev9dvJeI9RqUXAPVHM6cB4lC4k81Hl 28ml/1Uop7UbH/8srSlLCVXory4QCnr6iBhIRfAakrAY4KDvqUgFcZzG4l9KjWsqLZ 1ILyYT6adToShnPi3qkl/uIOVl0ZGZbipmb17NNa+nXxicmvENBPr96/1hcOQ5PZVP BRn98uSDpeE3wKOZc/l6L72CW9sbzwnplXYrD23MZ+JmEHxEl7SRHqKVHkxNPgfVIc XrHB4s6umTZIX5a0bj91HFX0XMUHeGCXDfaVxxZ2OFTngzRJkxGXNYwougNvu/FeJP hIgVgry1MeXrg== From: Arnd Bergmann To: linux-arch@vger.kernel.org Cc: Linus Torvalds , Vineet Gupta , Arnd Bergmann , Amitkumar Karwar , Benjamin Herrenschmidt , Borislav Petkov , Eric Dumazet , Florian Fainelli , Ganapathi Bhat , Geert Uytterhoeven , "H. Peter Anvin" , Ingo Molnar , Jakub Kicinski , James Morris , Jens Axboe , John Johansen , Jonas Bonn , Kalle Valo , Michael Ellerman , Paul Mackerras , Rich Felker , "Richard Russon (FlatCap)" , Russell King , "Serge E. Hallyn" , Sharvari Harisangam , Stafford Horne , Stefan Kristiansson , Thomas Gleixner , Vladimir Oltean , Xinming Hu , Yoshinori Sato , x86@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-m68k@lists.linux-m68k.org, linux-crypto@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, linux-block@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-security-module@vger.kernel.org Subject: [RFC 0/12] Unify asm/unaligned.h around struct helper Date: Sat, 8 May 2021 00:07:58 +0200 Message-Id: <20210507220813.365382-14-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210507220813.365382-1-arnd@kernel.org> References: <20210507220813.365382-1-arnd@kernel.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210507_151234_499775_D41B3E94 X-CRM114-Status: GOOD ( 17.34 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Arnd Bergmann 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. I've pushed the patches to the asm-generic git tree for testing. Arnd 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: git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic.git unaligned-rework Arnd Bergmann (12): 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: 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.h | 2 +- block/partitions/msdos.c | 2 +- drivers/net/wireless/marvell/mwifiex/pcie.c | 10 +- include/asm-generic/unaligned.h | 149 ++++++++++++--- 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 +- 30 files changed, 137 insertions(+), 1000 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 Cc: Amitkumar Karwar Cc: Arnd Bergmann Cc: Benjamin Herrenschmidt Cc: Borislav Petkov Cc: Eric Dumazet Cc: Florian Fainelli Cc: Ganapathi Bhat Cc: Geert Uytterhoeven Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Jakub Kicinski Cc: James Morris Cc: Jens Axboe Cc: John Johansen Cc: Jonas Bonn Cc: Kalle Valo Cc: Michael Ellerman Cc: Paul Mackerras Cc: Rich Felker Cc: "Richard Russon (FlatCap)" Cc: Russell King Cc: "Serge E. Hallyn" Cc: Sharvari Harisangam Cc: Stafford Horne Cc: Stefan Kristiansson Cc: Thomas Gleixner Cc: Vladimir Oltean Cc: Xinming Hu Cc: Yoshinori Sato Cc: x86@kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-crypto@vger.kernel.org Cc: openrisc@lists.librecores.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-sh@vger.kernel.org Cc: sparclinux@vger.kernel.org Cc: linux-ntfs-dev@lists.sourceforge.net Cc: linux-block@vger.kernel.org Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Cc: linux-arch@vger.kernel.org Cc: linux-security-module@vger.kernel.org -- 2.29.2 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel