From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jjc9F-0000bh-NH for barebox@lists.infradead.org; Fri, 12 Jun 2020 05:22:39 +0000 Date: Fri, 12 Jun 2020 07:22:34 +0200 From: Oleksij Rempel Message-ID: <20200612052234.dafdsfq6yuoeakjn@pengutronix.de> References: <20200611080207.6482-1-cleger@kalray.eu> MIME-Version: 1.0 In-Reply-To: <20200611080207.6482-1-cleger@kalray.eu> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============6836464562630220856==" Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: [PATCH v5 0/7] elf: add better bootm support To: Clement Leger Cc: barebox@lists.infradead.org, Oleksij Rempel --===============6836464562630220856== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="g5qz4xm4vv4hn4xh" Content-Disposition: inline --g5qz4xm4vv4hn4xh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Clement, suddenly I was not able to apply you changes on current barebox/master branch. There seems to be some missing changes? For example, you patch is changing this struct: @@ -405,7 +405,8 @@ struct elf_image { u64 entry; void *low_addr; void *high_addr; - void *buf; + void *hdr_buf; + char *filename; }; =20 But, current version of it is: struct elf_image { struct list_head list; u8 class; u64 entry; void *buf; }; On Thu, Jun 11, 2020 at 10:02:00AM +0200, Clement Leger wrote: > Currently, when booting an elf file using "bootm /dev/mtdx", bootm will > simply pass the file to the bootm handler and the read done on it will > read the entire flash partition. This series starts by some cleanup and > then modify the elf loader to load the elf file without copying the whole > elf file to an intermediate buffer. Only the elf header is copied in > order to parse the elf file into a list of segment and then, the segments > are loaded directly from the file. >=20 > A special handling for the elf file is also added in bootm data to allow > using directly the elf file structure. Finally the mips bootm handler is > modified to use bootm_load_os directly instead of manual elf loading. >=20 > Compilation for both mips and arm has been tested but run on qemu-malta w= as not > possible. Changes have been tested on kvx architecture for which bootm su= pport > has been added and will be submitted. >=20 > Changes v4 -> v5 > - Rework elf loading to load from file rather than a buffer > - Use calloc instead of xzalloc in elf file loading > - Add check of program headers in elf check >=20 > Changes v3 -> v4 > - Fix init of elf entry address to be used by bootm_load_elf >=20 > Changes v2 -> v3 > - Integrate elf loading in bootm_load_os > - Add patch to remove now unused elf_load_image/elf_release_image > - Use malloc instead of xmalloc and check return value >=20 > Changes v1 -> v2 > - Add BOOTM_ELF config to select elf support and add checks in code > - Add an elf_get_mem_size function to avoid computing elf size in bootm.c > - Use xmalloc and read_full in elf_open instead of xzalloc/read > - Fix data->elf NULL reset > - Remove elf struct entirely from mips bootm code >=20 > Clement Leger (7): > common: elf: fix warning on 32 bits architectures > common: elf: use calloc instead of xzalloc > common: elf: check number of elf program headers > common: elf: load elf directly from file > common: elf: add elf_open, elf_close and elf_load > common: bootm: add support for elf file loading > mips: lib: bootm: use bootm elf loading capabilities >=20 > arch/mips/lib/bootm.c | 25 ++--- > common/Kconfig | 8 ++ > common/bootm.c | 33 ++++++ > common/elf.c | 226 +++++++++++++++++++++++++++++++++++------- > include/bootm.h | 3 + > include/elf.h | 9 +- > 6 files changed, 248 insertions(+), 56 deletions(-) >=20 > --=20 > 2.17.1 >=20 >=20 > _______________________________________________ > barebox mailing list > barebox@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/barebox >=20 --=20 Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --g5qz4xm4vv4hn4xh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEERBNZvwSgvmcMY/T74omh9DUaUbMFAl7jERUACgkQ4omh9DUa UbNk2g/+NRv8zORRjMv+XyWBxxT36j6V5N2xcn9hvh+cOp9UWdUrtYLU1VU22REV HOVAenqdx/6ygClQVZpLe1gJ24JBHiJEcWPm0Yrw4jvACYBDZUHY8AriBCDZSofn slqlWlHbWTgf0yFFOnZqpn6nimit9dWiMToJ3B08yBpeDOV+Veh1pkweHqi7hOGq /CPyw6v64MOCBH6MHWGjGQU9ozM8foIv7+dz4nWp179D55Xz9es9EjCCgzbAq2Gj Vk9vdGfKnriWMvxGXCKOSum+c+kKe235iUZZvYx6ocLu2JMFcNDohWCTwwgVbM0+ URh4L4XMvNpRWHCv+AdgLTcwl5rmpORPza9qvTuskNMWDc6zCtg4w5otNR9VuoFl uil7jIvGhHK5VraURYdtKy4gZzmNh/JgjS1KVVC1nIHwBEwxh0dtEfGmvyjAyoPx 0wQV39R4dcAg9rMiRzGkX/6b+zFcgNY+DxFK0Cr06I3uhUCGQHV+zSUGLrlIH0oo iKw9yeTU3amqGMAQpg4oecmDAWAVuybK0Px0EJEUpwRWBZw1pA0yDrZjFKLK1xXN 78ylHrGGVnsXNP54rdaDBQQfWJBfQuXtbI1glRQBBU9EcACj8GZO53FFwrNy95tC lZDDDq8vWXZx9NPUSuQwpUrHRnRLmXtGk+rf42QsSF7NXA1DyX0= =FCSJ -----END PGP SIGNATURE----- --g5qz4xm4vv4hn4xh-- --===============6836464562630220856== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============6836464562630220856==--