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=-5.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 54543C433DB for ; Thu, 7 Jan 2021 22:19:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 113482343B for ; Thu, 7 Jan 2021 22:19:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 113482343B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=armlinux.org.uk 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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SUjHx59UaRGhO9eYPZYtwZNefHD5fEepxypY+aWVhHM=; b=C1w8+8WezFsD4M+MCP9b1hDbu VemZ7biUeknTZubZ7NeNqSh7rbNIwBPJ21LYETlNdQkDifqbqB4lb6j2yuvu9XKOxM9fKJ9RQDKbO ngMrOEhwi0oSGouFULc1NmUpPKEXGBT75aRAQZW7YawwxRSu1wF9wedjm+WclRpIzQuf2dVyEZiw8 VEn51YIhpyJQpVDOVjO8QCDl9jt3SuL3tcMcOdOnDqa0U1cXuTyL5D8jrEEULmTAVvdtWhjxN3u/p EUgQv5wN4zHAcPnMpOEjQ6JOXZ+/oS4IdAf3/4AQuVY8oqyyHUf7VBAmIYzkB2YmFfwkYM+flf5LR DyM2Qvqow==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxdbc-0007FN-5B; Thu, 07 Jan 2021 22:18:08 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kxdbZ-0006wa-L6 for linux-arm-kernel@lists.infradead.org; Thu, 07 Jan 2021 22:18:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender: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-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=hp/hzbK32x3dtwPGRRysL2rjHsQS0TM3qH9C23QvpIA=; b=j7hHcXeFfYP57LBpWFdXW7V+U +Z6qUX2TtBeaa6rYBqBgNCiVvJT4ilYColt4Yvs0NBPxitPL4ichfEXLoev4YFuUPvGgowKub2LDd AAe9iJDQpPwA9J4yx/uwzlLuBEP5TSDhawMa2Zes3IguK0D+su1mc6Q+31oJCXPCTeCZ8fQOQeVHw 1XfnbhMZ8VT+apBUPs/9Wg1nlVOdzrqwdYyMWxw7L/0r7tWp3puyrb2PFeDZOLFEXbHQ8itkvAZ9i TSShIJO/Ke1uITaWdzD/ytM/4PaG/zGLJdt5pAIV2oHT0lUed972s4YgQG2P8V+vgWeV3IV3k50+u tMHKXRq0w==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:45240) by pandora.armlinux.org.uk with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kxdYR-0003GN-2H; Thu, 07 Jan 2021 22:14:51 +0000 Received: from linux by shell.armlinux.org.uk with local (Exim 4.92) (envelope-from ) id 1kxdYM-0001W8-SH; Thu, 07 Jan 2021 22:14:46 +0000 Date: Thu, 7 Jan 2021 22:14:46 +0000 From: Russell King - ARM Linux admin To: Arnd Bergmann Subject: Re: Aarch64 EXT4FS inode checksum failures - seems to be weak memory ordering issues Message-ID: <20210107221446.GS1551@shell.armlinux.org.uk> References: <20210106115359.GB26994@C02TD0UTHF1T.local> <20210106135253.GJ1551@shell.armlinux.org.uk> <20210106172033.GA2165@willie-the-truck> <20210106223223.GM1551@shell.armlinux.org.uk> <20210107111841.GN1551@shell.armlinux.org.uk> <20210107124506.GO1551@shell.armlinux.org.uk> <20210107133747.GP1551@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210107_171805_742953_1DB6CF71 X-CRM114-Status: GOOD ( 23.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Theodore Ts'o , "linux-kernel@vger.kernel.org" , Andreas Dilger , linux-toolchains@vger.kernel.org, Ext4 Developers List , Will Deacon , Linux ARM 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 On Thu, Jan 07, 2021 at 10:48:05PM +0100, Arnd Bergmann wrote: > On Thu, Jan 7, 2021 at 5:27 PM Theodore Ts'o wrote: > > > > On Thu, Jan 07, 2021 at 01:37:47PM +0000, Russell King - ARM Linux admin wrote: > > > > The gcc bugzilla mentions backports into gcc-linaro, but I do not see > > > > them in my git history. > > > > > > So, do we raise the minimum gcc version for the kernel as a whole to 5.1 > > > or just for aarch64? > > > > Russell, Arnd, thanks so much for tracking down the root cause of the > > bug! > > There is one more thing that I wondered about when looking through > the ext4 code: Should it just call the crc32c_le() function directly > instead of going through the crypto layer? It seems that with Ard's > rework from 2018, that can just call the underlying architecture specific > implementation anyway. Yes, I've been wondering about that too. To me, it looks like the ext4 code performs a layering violation by going "under the covers" - there are accessor functions to set the CRC and retrieve it. ext4 instead just makes the assumption that the CRC value is stored after struct shash_desc. Especially as the crypto/crc32c code references the value using: struct chksum_desc_ctx *ctx = shash_desc_ctx(desc); Not even crypto drivers are allowed to assume that desc+1 is where the CRC is stored. However, struct shash_desc is already 128 bytes in size on aarch64, and the proper way of doing it via SHASH_DESC_ON_STACK() is overkill, being strangely 2 * sizeof(struct shash_desc) + 360 (which looks like another bug to me!) #define HASH_MAX_DESCSIZE (sizeof(struct shash_desc) + 360) ^^^^^^^^^^^^^^^^^^^^^^^^^ #define SHASH_DESC_ON_STACK(shash, ctx) \ char __##shash##_desc[sizeof(struct shash_desc) + \ ^^^^^^^^^^^^^^^^^^^^^^^^^ HASH_MAX_DESCSIZE] CRYPTO_MINALIGN_ATTR; \ struct shash_desc *shash = (struct shash_desc *)__##shash##_desc So, I agree with you wrt crc32c_le(), especially as it would be more efficient, and as the use of crc32c is already hard coded in the ext4 code - not only with crypto_alloc_shash("crc32c", 0, 0) but also with the fixed-size structure in ext4_chksum(). However, it's ultimately up to the ext4 maintainers to decide. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel