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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1A2ABC433EF for ; Sat, 25 Dec 2021 18:10:48 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6124D834A3; Sat, 25 Dec 2021 19:10:45 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="UTIFvkSc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 415DA837B9; Sat, 25 Dec 2021 19:10:43 +0100 (CET) Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C579A834A3 for ; Sat, 25 Dec 2021 19:10:39 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9417960B0E; Sat, 25 Dec 2021 18:10:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B33FAC36AE5; Sat, 25 Dec 2021 18:10:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640455837; bh=1+vFTp/a4CP87aozU0nsUjQR1OsOKQG/nUrKSCGzIhw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UTIFvkScTi8t7IJmKA4IJoQJ/gebKQAInyRDZHUBuwW9vs3650M3VMvRUAcIwggkF f5UkEK62Zx1YcFSk84ACybm4vpTD9dj+DVe27+fcmpVx7CmJ61UoBrgA2H9wYYpx7J 0TeDYJFBiUMlvFNCNlJPLbO0RZoxmMgLhZ3OVN8sEwbp3XgZj+4CQEklb2ZbIdxESW x3f7m0F/AXRS1Xsd4S7cqzoenaAVwnRwYoQksU85mr2lb0QjhErdeiVMD+/uxoXmwW Lg9lm7qtl4lpr52wAy2aqQoZx197wTQqPDVb+yOuXDRSvm71Siysbn3YeJSJo+SSRH LgS7Z6/m0t3bQ== Received: by pali.im (Postfix) id 312867B4; Sat, 25 Dec 2021 19:10:35 +0100 (CET) Date: Sat, 25 Dec 2021 19:10:35 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Pierre Bourdon Cc: Marek =?utf-8?B?QmVow7pu?= , Stefan Roese , u-boot@lists.denx.de, Marek =?utf-8?B?QmVow7pu?= Subject: Re: [PATCH u-boot-marvell 09/11] tools: kwbimage: Fill the real header size into the main header Message-ID: <20211225181035.gyi54yj4iw4iggvh@pali> References: <20211108171251.25382-1-kabel@kernel.org> <20211108171251.25382-10-kabel@kernel.org> <20211225175710.vtr35zodwypfgp2u@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20180716 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean On Saturday 25 December 2021 19:06:13 Pierre Bourdon wrote: > On Sat, Dec 25, 2021 at 6:57 PM Pali Rohár wrote: > > Hello! I'm using this patch for more than month and I have not seen any > > boot issue related to this patch A385 board. > > FWIW I'm testing this on a Prestera board, so Armada XP based. > > > Just moving "main_hdr->checksum = image_checksum8(main_hdr, headersz);" > > after the "main_hdr->headersz_msb = (headersz & 0xFFFF0000) >> 16;" > > should be enough. Are you going to prepare a fixup for master branch? > > I've actually tested this earlier -- csum8 works, Ok! > but csum32 still > doesn't pass in kwboot / mkimage. Note that I haven't checked whether > the hardware accepts it (I know it didn't like the broken csum8), so > this could be that the csum32 verification code is not tolerant to > your modified headersz. csum32 is checksum of data, not including header. If generated image does not pass kwboot verification then it is invalid. Has it worked with some previous version? If yes, can you bisect git commit which broke it? > Thanks for the really quick response! > > Best, > > -- > Pierre Bourdon > Software Engineer @ Zürich, Switzerland > https://delroth.net/