Hi Eduardo,
On 06/23/2017 04:45 PM, Eduardo Habkost wrote:
Do you have a simple way to trigger the error paths addressed by patches 1/3
and 2/3?
For 1/3 "elf-loader: warn about invalid endianess":
$ wget -q
https://people.debian.org/~aurel32/qemu/mips/vmlinux-3.2.0-4-4kc-malta
$ file vmlinux-3.2.0-4-4kc-malta
vmlinux-3.2.0-4-4kc-malta: ELF 32-bit MSB executable, MIPS, MIPS32
version 1 (SYSV), statically linked,
BuildID[sha1]=66b8748075269e8aedb91d363050f74af8a0ebdd, not stripped
$ qemu-system-mipsel -version
QEMU emulator version 2.8.1(Debian 1:2.8+dfsg-6)
Copyright (c) 2003-2016 Fabrice Bellard and the QEMU Project developers
$ qemu-system-mipsel -kernel vmlinux-3.2.0-4-4kc-malta
qemu: could not load kernel 'vmlinux-3.2.0-4-4kc-malta'
Once applied:
$ mipsel-softmmu/qemu-system-mipsel -kernel vmlinux-3.2.0-4-4kc-malta
vmlinux-3.2.0-4-4kc-malta: wrong endianess
qemu: could not load kernel 'vmlinux-3.2.0-4-4kc-malta'
It could be more verbose/nicer.
I'm doing some dual endianness tests and sometimes it happened I only
notice I'm stupid enough to load the wrong elf once stepping in gdb...
For 2/3 "fix missing return value in load_image_targphys_as()" I
extracted it from a WiP branch "unify-arm-mips-loaders" think that if I
never finish it, at least this one can still be useful for others.
No commits in this branch since 4months so I don't really remember how
it happens, but looking at rom_add_file() I see:
fprintf(stderr, "Could not open option rom '%s': %s\n",
rom->path, strerror(errno));
goto err;
...
fprintf(stderr, "rom: file %-20s: get size error: %s\n",
rom->name, strerror(errno));
goto err;
...
fprintf(stderr, "rom: file %-20s: read error: rc=%d (expected
%zd)\n",
rom->name, rc, rom->datasize);
goto err;
So my guess is again I missed something in the command line I used (used
unfinished bash auto-complete which lead to a directory? use zipped
rom?) and QEMU was still booting without using the specified rom.
I do remember single stepping there at least 2 times before realize
again how stupid I was :)
Regards,
Phil.