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 6BA9EC433F5 for ; Sat, 18 Dec 2021 09:16:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4A4D081919; Sat, 18 Dec 2021 10:16:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1639818995; bh=g/gv1S+TzMWX9T5Uezinwbc+c6IHkXbrJGkDKWzaJ5w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sfjJMib+GCDjdOKz0uOkm0pJ6H/e/3s6ABMrygpz2kLLBiuRyM0fuEsjz0ZfFOG1V evQq8C08FyHc8ljd2JTWhiLGSIdDJXDr3g1Jl4xjeIGcOA+bSA7GxSVzxLAsywmIFs SnhjxCvr4W24QNsyp/QvqXcn49q259I61PL48dA3VjK3JEpczos7WB/cLXPqhOSkvZ RxmGz8ghwWHLMAl9Jy9SAO6o8PnQIiLm+VCO5DlLbqOs3CEGgaab+aVAalUDNi57Mi tzgXtkip61G6j9IfQnDBpv43jLQ9S7blthdgp5KueubtCr9Gj9CE2cMd5oj2TBIKDa MoH7aN4VXl0Xg== Received: by phobos.denx.de (Postfix, from userid 109) id 0608D82A68; Sat, 18 Dec 2021 10:16:33 +0100 (CET) Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [IPv6:2001:67c:2050:1::465:204]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id DB53A811BB for ; Sat, 18 Dec 2021 10:16:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=fail smtp.mailfrom=sr@denx.de Received: from smtp2.mailbox.org (unknown [91.198.250.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4JGKwY5KlrzQlFG; Sat, 18 Dec 2021 10:16:29 +0100 (CET) Message-ID: <213e8e4e-496d-e288-f78e-8bd69e79e281@denx.de> Date: Sat, 18 Dec 2021 10:16:25 +0100 MIME-Version: 1.0 Subject: Re: [PATCH u-boot-marvell v3 0/9] More verifications for kwbimage in SPL Content-Language: en-US To: =?UTF-8?Q?Marek_Beh=c3=ban?= Cc: u-boot@lists.denx.de, =?UTF-8?Q?Pali_Roh=c3=a1r?= , =?UTF-8?Q?Marek_Beh=c3=ban?= References: <20211214132222.21324-1-kabel@kernel.org> From: Stefan Roese In-Reply-To: <20211214132222.21324-1-kabel@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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 Hi Marek, Hi Pali, working on a "next" branch, I noticed that this patch series fails on some non-MVEBU boards: [stefan@ryzen u-boot-marvell (next)]$ make da850evm_nand_defconfig # # configuration written to .config # [stefan@ryzen u-boot-marvell (next)]$ make -s -j20 common/spl/spl_nand.c: In function 'spl_nand_load_image': common/spl/spl_nand.c:175:48: warning: passing argument 2 of 'spl_nand_load_element' makes pointer from integer without a cast [-Wint-conversion] 175 | err = spl_nand_load_element(spl_image, spl_nand_get_uboot_raw_page(), | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | uint32_t {aka unsigned int} common/spl/spl_nand.c:68:58: note: expected 'struct spl_boot_device *' but argument is of type 'uint32_t' {aka 'unsigned int'} 68 | struct spl_boot_device *bootdev, | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ common/spl/spl_nand.c:176:37: warning: passing argument 3 of 'spl_nand_load_element' makes integer from pointer without a cast [-Wint-conversion] 176 | header); | ^~~~~~ | | | struct image_header * common/spl/spl_nand.c:69:38: note: expected 'int' but argument is of type 'struct image_header *' 69 | int offset, struct image_header *header) | ~~~~^~~~~~ common/spl/spl_nand.c:175:15: error: too few arguments to function 'spl_nand_load_element' 175 | err = spl_nand_load_element(spl_image, spl_nand_get_uboot_raw_page(), | ^~~~~~~~~~~~~~~~~~~~~ common/spl/spl_nand.c:67:12: note: declared here 67 | static int spl_nand_load_element(struct spl_image_info *spl_image, | ^~~~~~~~~~~~~~~~~~~~~ make[2]: *** [scripts/Makefile.build:253: spl/common/spl/spl_nand.o] Error 1 make[1]: *** [scripts/Makefile.spl:515: spl/common/spl] Error 2 make[1]: *** Waiting for unfinished jobs.... I'm droppping this series from my "next" branch for now. Thanks, Stefan On 12/14/21 14:22, Marek Behún wrote: > From: Marek Behún > > Hello Stefan, > > this is v3 of series that adds more checks for kwbimage validity and > consistency to SPL, mainly checking image data checksum. > > Changes since v2: > - changed the error message in patch 6 according to Pali's suggestion > - added R-B tags > > Changes since v1: > - updated error messages as requested by Stefan > - fixed checkpatch warnings for uintN_t types (converted to preferred > uN) > - added more checkpatch fixes > > Marek > > Marek Behún (4): > arm: mvebu: spl: Print srcaddr in error message > arm: mvebu: spl: Use preferred types u8/u16/u32 instead of uintN_t > arm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible > arm: mvebu: spl: Fix 100 column exceeds > > Pali Rohár (5): > arm: mvebu: Check that kwbimage offset and blocksize are valid > SPL: Add struct spl_boot_device parameter into > spl_parse_board_header() > arm: mvebu: Check that kwbimage blockid matches boot mode > SPL: Add support for checking board / BootROM specific image types > arm: mvebu: Check for kwbimage data checksum > > arch/arm/mach-mvebu/spl.c | 153 +++++++++++++++++++--------- > arch/arm/mach-sunxi/spl_spi_sunxi.c | 2 +- > common/spl/spl.c | 13 ++- > common/spl/spl_ext.c | 9 +- > common/spl/spl_fat.c | 11 +- > common/spl/spl_legacy.c | 3 +- > common/spl/spl_mmc.c | 43 +++++--- > common/spl/spl_nand.c | 5 +- > common/spl/spl_net.c | 2 +- > common/spl/spl_nor.c | 4 +- > common/spl/spl_onenand.c | 2 +- > common/spl/spl_ram.c | 2 +- > common/spl/spl_sata.c | 9 +- > common/spl/spl_sdp.c | 2 +- > common/spl/spl_spi.c | 9 +- > common/spl/spl_ubi.c | 4 +- > common/spl/spl_usb.c | 4 +- > common/spl/spl_xip.c | 4 +- > common/spl/spl_ymodem.c | 4 +- > drivers/usb/gadget/f_sdp.c | 12 ++- > include/sdp.h | 3 +- > include/spl.h | 7 ++ > 22 files changed, 201 insertions(+), 106 deletions(-) > Viele Grüße, Stefan Roese -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr@denx.de