08:32 Sre, 29.01.2020. Philippe Mathieu-Daudé <[email protected]> је написао/ла: > > Hi Aleksandar, > > On 1/28/20 8:25 PM, Aleksandar Markovic wrote: > > On Tue, Jan 28, 2020 at 2:27 PM Aleksandar Markovic > > <[email protected] <mailto:[email protected]>> wrote: > > > > > > > > On Tuesday, January 28, 2020, BALATON Zoltan <[email protected] > > <mailto:[email protected]>> wrote: > > > > On Tue, 28 Jan 2020, Aleksandar Markovic wrote: > > > > On Sunday, January 26, 2020, Aleksandar Markovic < > > [email protected] > > <mailto:[email protected]>> wrote: > > > > From: Philippe Mathieu-Daudé <[email protected] > > <mailto:[email protected]>> > > > > Some platforms (like AVR) need to determine cpu type by > > reading > > the ELF flags (field e_flags oin ELF header). > > > > This patch enables discovery of the content of that flag > > while > > using following functions: > > > > - load_elf() > > - load_elf_as() > > - load_elf_ram() > > - load_elf_ram_sym() > > > > The added argument of these functions is of type > > uint32_t*. It is > > allowed to pass NULL as that argument, and in such case > > no lookup > > to the field e_flags will happen, and of course, no > > information > > will be returned to the caller. > > > > > > Applied to MIPS queue, with some commit message corrections and fixes. > > Sorry I didn't respond earlier, this was a very short delay (patch > posted yesterday, pull request sent today). > > My original patch was much less intrusive: > https://www.mail-archive.com/[email protected]/msg673762.html > I don't find comfortable being listed as the author of the current > patch. Do you mind changing the authorship? >
No problem. I will then list myself as the author, as that can be said is the case in reality. Yours, Aleksandar > Thank you, > > Phil. > > > > > We plan to use this new functionality for MIPS Malta board, > > for detection > > of incompatible cpu/kernel combinations, and graceful exit > > (right now these > > combinations result in hang or crash). I would say other > > boards could make > > use of it too. > > > > For that reason, if there is no objection, I plan to select > > this patch for > > next MIPS queue. > > > > > > No objection but kind of déjà vu: > > > > https://lists.nongnu.org/archive/html/qemu-devel/2019-01/msg03427.html > > > > I still think the interface of load_elf may need to be rethinked > > but I don't know a good way. > > > > > > > > Perhaps having only two, "in" and "out", arguments that are pointers > > to structures? > > > > Another thing that I noticed is "endian argument" that it seems > > everyone uses in a different way: 0, 1, true, false, bigendian, etc. > > Would c enumeration help? This looks to me like a time ticking bomb. > > > > Just to add that some platforms like MIPS and SPARC must load elfs > > of more than one value of EM_MACHINE (in MIPS case, EM_MIPS and > > EM_NANOMIPS) and current load_elf() interface offers only clumsy > > solutions/workarounds in these cases. > > > > Let's think about everything later on. > > > > > > This could be fixed in a later patch causing more code churn > > again though, so if there's a way to fix this it might be a good > > opportunity now. But I don't want to hold your patch series back > > so unless someone has a good idea to avoid this situation then > > we have to live with it. > > > > > > Thank you. I will do some minor corrections for obvious unclarities > > and typos in the commit message while applying to my qieue. > > > > Regards, > > BALATON Zoltan > > > > > > Regards, > > Aleksandar > > > > > > > > > > CC: Richard Henderson <[email protected] > > <mailto:[email protected]>> > > CC: Peter Maydell <[email protected] > > <mailto:[email protected]>> > > CC: Edgar E. Iglesias <[email protected] > > <mailto:[email protected]>> > > CC: Michael Walle <[email protected]> > > CC: Thomas Huth <[email protected] > > <mailto:[email protected]>> > > CC: Laurent Vivier <[email protected] > > <mailto:[email protected]>> > > CC: Philippe Mathieu-Daudé <[email protected] > > <mailto:[email protected]>> > > CC: Aleksandar Rikalo <[email protected] > > <mailto:[email protected]>> > > CC: Aurelien Jarno <[email protected] > > <mailto:[email protected]>> > > CC: Jia Liu <[email protected] <mailto:[email protected]>> > > CC: David Gibson <[email protected] > > <mailto:[email protected]>> > > CC: Mark Cave-Ayland <[email protected] > > <mailto:[email protected]>> > > CC: BALATON Zoltan <[email protected] > > <mailto:[email protected]>> > > CC: Christian Borntraeger <[email protected] > > <mailto:[email protected]>> > > CC: Thomas Huth <[email protected] <mailto: [email protected]>> > > CC: Artyom Tarasenko <[email protected] > > <mailto:[email protected]>> > > CC: Fabien Chouteau <[email protected] > > <mailto:[email protected]>> > > CC: KONRAD Frederic <[email protected] > > <mailto:[email protected]>> > > CC: Max Filippov <[email protected] > > <mailto:[email protected]>> > > > > Signed-off-by: Michael Rolnik <[email protected] > > <mailto:[email protected]>> > > Reviewed-by: Aleksandar Markovic <[email protected] > > <mailto:[email protected]>> > > [PMD: Extracted from bigger patch, > > Replaced 'uint32_t *pe_flags' by 'int proc_flags'] > > [AM: Replaced 'int proc_flags' with 'uint32_t *pflags', > > replaced one instance of 'elf_sword' to 'elf_word', > > extended functionality to load_elf()] > > Signed-off-by: Philippe Mathieu-Daudé <[email protected] > > <mailto:[email protected]>> > > Signed-off-by: Aleksandar Markovic > > <[email protected] > > <mailto:[email protected]>> > > --- > > hw/alpha/dp264.c | 4 ++-- > > hw/arm/armv7m.c | 2 +- > > hw/arm/boot.c | 2 +- > > hw/core/generic-loader.c | 2 +- > > hw/core/loader.c | 37 > > +++++++++++++++++++------------------ > > hw/cris/boot.c | 2 +- > > hw/hppa/machine.c | 4 ++-- > > hw/i386/multiboot.c | 2 +- > > hw/i386/x86.c | 2 +- > > hw/lm32/lm32_boards.c | 4 ++-- > > hw/lm32/milkymist.c | 2 +- > > hw/m68k/an5206.c | 2 +- > > hw/m68k/mcf5208.c | 2 +- > > hw/m68k/q800.c | 2 +- > > hw/microblaze/boot.c | 4 ++-- > > hw/mips/mips_fulong2e.c | 2 +- > > hw/mips/mips_malta.c | 3 ++- > > hw/mips/mips_mipssim.c | 2 +- > > hw/mips/mips_r4k.c | 2 +- > > hw/moxie/moxiesim.c | 2 +- > > hw/nios2/boot.c | 4 ++-- > > hw/openrisc/openrisc_sim.c | 2 +- > > hw/pci-host/prep.c | 3 ++- > > hw/ppc/e500.c | 2 +- > > hw/ppc/mac_newworld.c | 4 ++-- > > hw/ppc/mac_oldworld.c | 4 ++-- > > hw/ppc/ppc440_bamboo.c | 2 +- > > hw/ppc/sam460ex.c | 3 ++- > > hw/ppc/spapr.c | 6 +++--- > > hw/ppc/virtex_ml507.c | 2 +- > > hw/riscv/boot.c | 4 ++-- > > hw/s390x/ipl.c | 7 ++++--- > > hw/sparc/leon3.c | 2 +- > > hw/sparc/sun4m.c | 4 ++-- > > hw/sparc64/sun4u.c | 5 +++-- > > hw/tricore/tricore_testboard.c | 2 +- > > hw/xtensa/sim.c | 2 +- > > hw/xtensa/xtfpga.c | 2 +- > > include/hw/elf_ops.h | 6 +++++- > > include/hw/loader.h | 21 ++++++++++++--------- > > 40 files changed, 92 insertions(+), 79 deletions(-) >
