From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60D7DA932; Sat, 28 Feb 2026 06:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772261894; cv=none; b=fFH3olv2N9orNWYzKHereaaZHaznXrpzlsoGNtkHv9M6pdQ6QaOPMlbaCAG3arjiXxT6/ts1DFpMHod/iuhFXjBCrdEWCT5TG89vrQ0/kNjpfHk8Ol1bLKw4UGITn28OZp41jR+zsmS8qV2jAIVrLf8h2UhLDoFazo9DddN7Ho4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772261894; c=relaxed/simple; bh=OZ08akKAa75pF5HX8BdM2b9T1B4d2lEE9VTD0Yyikqo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tvzG8AK3Ks2LQjdu3FkuSDT55SpdbEr9et6MFKLiSEyP2CeJtxVUdNY/lmPoYIf1Sy1Gs6ML7Pn0Ux8vtGlKVduMjtk37fzDANMZW/sRmFPpMblMdb4YNxIrhRF85Qm/p112ui3YTvIESQgSnB7+TjCzW2TSLWzhUAUgd+nw3C4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WZJvSmvp; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="WZJvSmvp" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E3B51C116D0; Sat, 28 Feb 2026 06:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772261893; bh=OZ08akKAa75pF5HX8BdM2b9T1B4d2lEE9VTD0Yyikqo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WZJvSmvpEC6sHP/zivxpALj3tLGejpdvAPR0eMYRI+scB+s1IF4OeEtX5WKMQOtse Y2O4u4bOc8GI/JkEy6r4u1efjOMWWhLBmlfPczD6cmniYI2bymYIkCjhEhIGubJ4gY U9xKn5Z26jVbpiN+tbnYvysYm7bGRQ8U3XJJKW5Mpnhlp7/c6eic5HbKU4NYZzTh4Y eWJy6kT6Z+zFjYDjttC40gAqyP1FxjjNb1CXpDAIZpiSYLp4Vl3s7MEe9JtyMARKCq OsKaO4PPgfcbgTDw33LPxpOolodGKsdhIykRymhYri+JeNTEZUGQdgg0r4NRhV+/z9 uLwVU5xseRMgQ== Date: Fri, 27 Feb 2026 22:58:10 -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 24/25] xor: pass the entire operation to the low-level ops Message-ID: <20260228065810.GJ65277@quark> References: <20260226151106.144735-1-hch@lst.de> <20260226151106.144735-25-hch@lst.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260226151106.144735-25-hch@lst.de> On Thu, Feb 26, 2026 at 07:10:36AM -0800, Christoph Hellwig wrote: > +#define __DO_XOR_BLOCKS(_name, _handle1, _handle2, _handle3, _handle4) \ > +void \ > +xor_gen_##_name(void *dest, void **srcs, unsigned int src_cnt, \ > + unsigned int bytes) \ > +{ \ > + unsigned int src_off = 0; \ > + \ > + while (src_cnt > 0) { \ > + unsigned int this_cnt = min(src_cnt, 4); \ > + unsigned long *p1 = (unsigned long *)srcs[src_off]; \ > + unsigned long *p2 = (unsigned long *)srcs[src_off + 1]; \ > + unsigned long *p3 = (unsigned long *)srcs[src_off + 2]; \ > + unsigned long *p4 = (unsigned long *)srcs[src_off + 3]; \ This reads out of bounds if src_cnt isn't a multiple of 4. - Eric