[PATCH for-7.0 v5] qemu-binfmt-conf.sh: mips: allow nonzero EI_ABIVERSION, distinguish o32 and n32

2022-03-28 Thread Andreas K . Hüttel
at offset 0x24 for the here applicable ELFCLASS32). See-also: ace3d65459 Signed-off-by: Andreas K. Hüttel Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: WANG Xuerui Cc: Laurent Vivier Cc: WANG Xuerui Cc: Richard Henderson Cc: Alex Bennee Cc: Philippe Mathieu-Daudé Closes: https://gitlab.com/qemu

[PATCH v4 1/2] qemu-binfmt-conf.sh: allow elf EI_ABIVERSION=1 for mips

2022-03-23 Thread Andreas K . Hüttel
e = 2 , /* (ET_EXEC) */ | .e_machine = 8 , /* (EM_MIPS) */ | .e_version = 1 , /* (EV_CURRENT) */ | (...) Signed-off-by: Andreas K. Hüttel --- scripts/qemu-binfmt-conf.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qemu-binfmt

[PATCH v4 2/2] qemu-binfmt-conf.sh: Extend magic to distinguish mips o32 and n32 ABI

2022-03-23 Thread Andreas K . Hüttel
This information is given by the EF_MIPS_ABI2 (0x20) bit in the e_flags field of the ELF header (a 4-byte value at offset 0x24 for the here applicable ELFCLASS32). See-also: https://www.mail-archive.com/qemu-devel@nongnu.org/msg732572.html Signed-off-by: Andreas K. Hüttel --- scripts/qemu

qemu-binfmt-conf.sh: improvements for mips

2022-03-23 Thread Andreas K . Hüttel
Re-sending v3 unchanged as requested. The first patch has already been submitted earlier and is unchanged from v2. The second patch extends it and resolves issue 843, "duplicate magic mips patterns". Tested with various self-bootstrapped Gentoo chroots and in production on the Gentoo release

[PATCH v3 2/2] qemu-binfmt-conf.sh: Extend magic to distinguish mips o32 and n32 ABI

2022-03-14 Thread Andreas K . Hüttel
This information is given by the EF_MIPS_ABI2 (0x20) bit in the e_flags field of the ELF header (a 4-byte value at offset 0x24 for the here applicable ELFCLASS32). See-also: https://www.mail-archive.com/qemu-devel@nongnu.org/msg732572.html Signed-off-by: Andreas K. Hüttel --- scripts/qemu

[PATCH v3 1/2] qemu-binfmt-conf.sh: allow elf EI_ABIVERSION=1 for mips

2022-03-14 Thread Andreas K . Hüttel
e = 2 , /* (ET_EXEC) */ | .e_machine = 8 , /* (EM_MIPS) */ | .e_version = 1 , /* (EV_CURRENT) */ | (...) Signed-off-by: Andreas K. Hüttel --- scripts/qemu-binfmt-conf.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qemu-binfmt

qemu-binfmt-conf.sh: mips improvements

2022-03-14 Thread Andreas K . Hüttel
Two patches; the first one has been under review before, the second builds on it and extends the binfmt-misc magic to differentiate between o32 and n32 binaries (see also issue 843).

[PATCH v2] qemu-binfmt-conf.sh: allow elf EI_ABIVERSION=1 for mips

2022-03-04 Thread Andreas K . Hüttel
e = 2 , /* (ET_EXEC) */ | .e_machine = 8 , /* (EM_MIPS) */ | .e_version = 1 , /* (EV_CURRENT) */ | (...) Signed-off-by: Andreas K. Hüttel --- v2: Add the same fix for little endian as for big endian scripts/qemu-binfmt-conf.sh | 4 ++-- 1 file changed, 2 insert

[PATCH] qemu-binfmt-conf.sh: allow elf EI_ABIVERSION=1 for mips

2022-03-03 Thread Andreas K . Hüttel
hine = 8 , /* (EM_MIPS) */ | .e_version = 1 , /* (EV_CURRENT) */ | (...) Signed-off-by: Andreas K. Hüttel --- scripts/qemu-binfmt-conf.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh index

Re: [PATCH v2 1/1] linux-user/signal: Decode waitid si_code

2021-01-21 Thread Andreas K . Hüttel
Am Mittwoch, 20. Januar 2021, 22:12:30 EET schrieb Andreas K. Hüttel: > > This patch just passes the waitid status directly back to the guest. > > This works at least as well as the previous versions, so ++ from me. > > Will do more testing over the next days to see if it m

Re: [PATCH v2 1/1] linux-user/signal: Decode waitid si_code

2021-01-20 Thread Andreas K . Hüttel
> > This patch just passes the waitid status directly back to the guest. > This works at least as well as the previous versions, so ++ from me. Will do more testing over the next days to see if it maybe also improves the additional oddities I observed. Tested-by: Andreas

[Bug 1906193] Re: riscv32 user mode emulation: fork return values broken

2021-01-16 Thread Andreas K . Hüttel
Done (took a while to figure out how...) -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1906193 Title: riscv32 user mode emulation: fork return values broken Status in QEMU: Confirmed Bug

Re: [PATCH v1 1/1] linux-user/signal: Decode waitid si_code

2021-01-16 Thread Andreas K . Hüttel
//bugs.launchpad.net/qemu/+bug/1906193 > Signed-off-by: Alistair Francis Tested-by: Andreas K. Hüttel > --- > linux-user/signal.c | 26 -- > 1 file changed, 24 insertions(+), 2 deletions(-) > > diff --git a/linux-user/signal.c b/linux-user/signal.c >

[Bug 1891748] Re: qemu-arm-static 5.1 can't run gcc

2021-01-16 Thread Andreas K . Hüttel
I'm still seeing this with qemu 5.2.0 armv7a-softfp-linux-gnueabi-gcc -O2 -pipe -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -Wl,-O1 -Wl,--as-needed glibc-test.c -o glibc-test Allocating guest commpage: Operation not permitted -- You received this bug notification because you are a

[Bug 1906193] Re: riscv32 user mode emulation: fork return values broken

2020-12-26 Thread Andreas K . Hüttel
Just as a general remark, while this specific problem seems to be solved, there may still be issues surrounding waitid(). (With this patch applied, in a rather complex environment I see bash processes hanging in an infinite loop, with waitid involved. I am working on isolating the problem and

[Bug 1906193] Re: riscv32 user mode emulation: fork return values broken

2020-12-21 Thread Andreas K . Hüttel
After applying this patch on top of qemu-5.2.0, I can confirm that it fixes the problem. Thank you!! -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1906193 Title: riscv32 user mode emulation: fork

[Bug 1906193] Re: riscv32 user mode emulation: fork return values broken

2020-12-19 Thread Andreas K . Hüttel
Thanks a lot! Will test and post the result on monday when I'm back home. -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1906193 Title: riscv32 user mode emulation: fork return values broken

[Bug 1906193] Re: riscv32 user mode emulation: fork return values broken

2020-12-16 Thread Andreas K . Hüttel
Here's qemu's own strace log: farino ~ # /usr/bin/qemu-riscv32 -strace /chroot/riscv-ilp32/tmp/wait-test-short 10123 brk(NULL) = 0x00073000 10123 brk(0x00073880) = 0x00073880 10123 uname(0x407ffed8) = 0 10123 readlinkat(AT_FDCWD,"/proc/self/exe",0x407feff0,4096) = 39 10123 brk(0x00094880) =

[Bug 1906193] Re: riscv32 user mode emulation: fork return values broken

2020-12-16 Thread Andreas K . Hüttel
Here's the (abbreviated) output of strace'ing qemu: farino ~ # strace -f /usr/bin/qemu-riscv32 /chroot/riscv-ilp32/tmp/wait-test-short execve("/usr/bin/qemu-riscv32", ["/usr/bin/qemu-riscv32", "/chroot/riscv-ilp32/tmp/wait-tes"...], 0x7ffd95fb1330 /* 40 vars */) = 0 [...] [pid 16569]

[Bug 1906193] Re: riscv32 user mode emulation: fork return values broken

2020-12-15 Thread Andreas K . Hüttel
I can confirm that the same binary works fine with qemu system emulation: (riscv-ilp32 qemu) (none) /tmp # ./wait-test-short (riscv-ilp32 qemu) (none) /tmp # -- You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU.

[Bug 1906193] Re: riscv32 user mode emulation: fork return values broken

2020-12-04 Thread Andreas K . Hüttel
This is the (statically linked) binary resulting from the source; with it the problem can be demonstrated "standalone", without any other rv32 libraries or a complete chroot, just running the binary with qemu- riscv32. Generated with (riscv-ilp32 chroot) farino /tmp # gcc -static -o

Re: riscv32 wait() problem, qemu or glibc?

2020-09-17 Thread Andreas K . Hüttel
Am Donnerstag, 17. September 2020, 00:05:10 EEST schrieb Alistair Francis: > On Wed, Sep 16, 2020 at 2:09 PM Andreas K. Hüttel wrote: > > > My guess is that somewhere in QEMU the types don't match what RV32 is > > > using. It's probably worth printing out the size

Re: riscv32 wait() problem, qemu or glibc?

2020-09-16 Thread Andreas K . Hüttel
> all sorts of issues with it unfortunately. Would you consider qemu system mode more reliable? I need to prepare some bootable riscv gentoo images eventually anyway. Might as well try a riscv32 one for comparison then if that is more promising. -- Andreas K. Hüttel dilfri...@gentoo.org Gentoo

Re: riscv32 wait() problem, qemu or glibc?

2020-09-15 Thread Andreas K . Hüttel
ot;child wants to return %i (0x%X), parent received %i (0x%X), difference %i\n",z,z,r,r,r-z); } } } } === Am Montag, 14. September 2020, 11:14:16 EEST schrieb Andreas K. Hüttel: > Hi, > > first of all, sorry for crossposting, but I'm dealing with many mov

riscv32 wait() problem, qemu or glibc?

2020-09-14 Thread Andreas K . Hüttel
020-09/msg00033.html -- Andreas K. Hüttel dilfri...@gentoo.org Gentoo Linux developer (council, qa, toolchain, base-system, perl, libreoffice) signature.asc Description: This is a digitally signed message part.