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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 9CF62FEE4CC for ; Sat, 28 Feb 2026 07:15:30 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fNGgN6kwbz30hg; Sat, 28 Feb 2026 18:15:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip=172.105.4.254 ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772262928; cv=none; b=R/vuKp5948zHo9WBsBf4aEtGSyXFewm0f0cm5pp6U9SEMbh6XKx3JVDJv5zwG0EQ1akHbOhrRFv8wxWwsxuU9/3na/46E3xxvPblfJZy4jXdpw78NqmDDDpdLVl0tx+uG2JXq0Fw399AyZCOaJ8HkcJde1WkdfeimrBz4xobk8lg60KWXHPXx+ksUmqjy+QTWk+plCC5dTzkD6oIh/xveNMwo9tt8B80aaiH8wneRHhe44CmdQA1wG+etA26IgnKhssaDiMLgYCzEec7umUhHNHmJVykIynyirLWzBmsXN4pl1wvierySAaUZ4UKsC6i7FRb7wDA+Y3j2sCfA/nROg== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1772262928; c=relaxed/relaxed; bh=3y/IqGod0OtoNjM34bJe5aCjje6al8v83ndNN1uCr6A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aNEesA0tjO9m29QG4I0aMj+xec67nDYQS+qkH/F+xTW8SeMb40qKfh6do7wRL4k/rLOcWbLNOBmBI8i1MfSUba05rWihFlbo1sf3G9ivZpkNYSRpMmOhg9x5xil52XTDBloFKoZ38dh4lBli2wAO1qfuwvTZy43sPbVFX43/+7piGHTlut2ihXEt0W9PsffWxH5RBox97mGY9NG8JK98L0O18plkBlDCxUfONsIhXOLvXf1Bv2U7MSKna9ZK1RcJTgINp6KanvAsc+9S7+ZtgDNR2mL6d3L+iHi6o1PNaMOZGPjPADfsWl77kgMuLWYMl7jHGRVIPKJqPxuFLZ8XEg== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Vz3k8kyT; dkim-atps=neutral; spf=pass (client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=ebiggers@kernel.org; receiver=lists.ozlabs.org) smtp.mailfrom=kernel.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=Vz3k8kyT; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=172.105.4.254; helo=tor.source.kernel.org; envelope-from=ebiggers@kernel.org; receiver=lists.ozlabs.org) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fNGgN0YRTz30BR for ; Sat, 28 Feb 2026 18:15:28 +1100 (AEDT) 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> X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260226151106.144735-10-hch@lst.de> 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