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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5A352FEE4CE for ; Sat, 28 Feb 2026 07:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3y/IqGod0OtoNjM34bJe5aCjje6al8v83ndNN1uCr6A=; b=kYqGD0ex4kuXMjrwh/Yi8dqoC3 0lXDPd/0Y0ulgNkMt1apylF8CLjs5izfL/T0NgtuDk/2++v52guwRc1g9tQ18Iev84Bika0xq1vjn Xh+IVPjwMCVOE5MAj5XC7gn1sFpTtvPOq3GR3pBBtqSJWPx1q4pwXjqaoSRDiP8akn7u0o1ZbwLBL wDYw3sj9e0L7MHPq6MEbagzcFZjsJ4+CtRiyiR7ezrusxnj1CVQEA0LbEe2RbcHGXcDpR9tGlNU7r lXWqD3eBYM9nL5arEgTb4kEMreuo89EhIibUKESsgSTt0tBB6DFX967CHnYTRc215M6YLng0DH2p4 MoqJpZ0g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vwEXy-00000009b35-2Dqw; Sat, 28 Feb 2026 07:15:30 +0000 Received: from tor.source.kernel.org ([2600:3c04:e001:324:0:1991:8:25]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vwEXv-00000009b2o-2CYB; Sat, 28 Feb 2026 07:15:27 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id B403E6001D; Sat, 28 Feb 2026 07:15:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 39044C116D0; Sat, 28 Feb 2026 07:15:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772262925; bh=zWqt8Joca1KvplCXgcwLYttswt0fM6g1E9UxDDRiVTY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Vz3k8kyTWZXHMK5zn7xXibfO3tQ+c+PplCLKYAb/nEXG6XVyxylOPTDzXmct2v/wF WmaMWfVwV7ygt8481V3ntzFPARMBXxozM0S4vYM+fu8NTjVMCeXuO/SMU92oOtftWp YviS01hMbTL4Nkd5vseytV1ImcKk3TWqfzHY4gUzr3YvSM+tsz1IZkLgKG1gW+KaxO rZfmvPr+C7N697Fz2WWHkMDqBLHLN/FfRu//s+ea1lU/Ju8ebw+5Si06It93glm1Ff QePblciurUn+VamkBgtZHIFv4AD004DBjvXkKZVZLJlMvZ9IVJkH2jsgcBMJr2hP7p 3dV2gvb5/dQtw== Date: Fri, 27 Feb 2026 23:15:21 -0800 From: Eric Biggers To: Christoph Hellwig Cc: Andrew Morton , Richard Henderson , Matt Turner , Magnus Lindholm , Russell King , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , "David S. Miller" , Andreas Larsson , Richard Weinberger , Anton Ivanov , Johannes Berg , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Herbert Xu , Dan Williams , Chris Mason , David Sterba , Arnd Bergmann , Song Liu , Yu Kuai , Li Nan , linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, linux-crypto@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-arch@vger.kernel.org, linux-raid@vger.kernel.org Subject: Re: [PATCH 09/25] xor: move generic implementations out of asm-generic/xor.h Message-ID: <20260228071521.GK65277@quark> References: <20260226151106.144735-1-hch@lst.de> <20260226151106.144735-10-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260226151106.144735-10-hch@lst.de> X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org On Thu, Feb 26, 2026 at 07:10:21AM -0800, Christoph Hellwig wrote: > Move the generic implementations from asm-generic/xor.h to > per-implementaion .c files in lib/raid. > > Note that this would cause the second xor_block_8regs instance created by > arch/arm/lib/xor-neon.c to be generated instead of discarded as dead > code, so add a NO_TEMPLATE symbol to disable it for this case. > > Signed-off-by: Christoph Hellwig This makes the generic code always be included in xor.ko, even when the architecture doesn't need it. For example, x86_64 doesn't need it, since it always selects either the AVX or SSE code. Have you considered putting the generic code in xor-core.c (or in headers included by it) before xor_arch.h is included, and putting __maybe_unused on the xor_block_template structs? Then they'll still be available for arch_xor_init() to use, but any of them that aren't used in a particular build will be optimized out as dead code by the compiler. lib/crc/ and lib/crypto/ take a similar approach for most algorithms. - Eric