IRC channel logs

2021-09-07.log

back to list of logs

<opal>are there mbox archives for the mailing list
<Hagfish> https://dolphin-emu.org/blog/2021/09/07/dolphin-progress-report-august-2021/ " this method breaks when all inputs are zero — PowerPC's nmsub would give -0, while x86's nmadd and AArch64's msub would give +0. "
<theruran>I got mes-m2 of Mes v0.22 building just fine :)
<theruran>I guess make test fails catastrophically though
<stikonas>oriansj: I've found a workaround for hex being slow on qemu...
<stikonas>Well, it's qemu that's issuing context switches (by calling mprotect)
<stikonas>I probably didn't catch all of them, but it's now signnificantly faster (something like 8s -> 0.3s)
<stikonas>same fix can be backported to hex0/hex1 although that's a bit more work due to coding in hex0
<stikonas> https://github.com/oriansj/stage0-posix/pull/42
<stikonas>ekaitz: do you want to optimize hex0 with that?
<stikonas>using stack pointer sp rather than label (buffer)
<ekaitz>hm! didn't really got it
<ekaitz>let me read
<stikonas>well, somehow our hex riscv binaries are really slow in qemu
<stikonas>so I straced it and noticed that each access of buffer (or similar labels) generates a couple of mprotect syscalls in qemu
<stikonas>so as a workaround I removed that and switched to simply using stack pointer for sys_read and sys_write syscalls
<ekaitz>oh i see
<ekaitz>not bad
<stikonas>hmm, it probably affects other stage0 arches too, but I guess nobody ran than in emulator
<ekaitz>I realized it was surprisingly slow when I wrote it but I didn't think much further
<stikonas>yeah, so that's qemu issuing a few other syscalls
<stikonas>which means more context switches
<stikonas>and this happens a few times per character
<stikonas>and I guess hex0 will actually be a bit smaller
<stikonas>if we use sp instead of la buffer (which is 2 instructions)
<stikonas>anyway, I might do hex0 too at some point if you don't have time
<ekaitz>we can simply use the top of the stack as a buffer, it shouldn't be a problem
<stikonas>yeah
<stikonas>don't even need to allocate more stack
<stikonas>with addi sp, sp, -8
<stikonas>as we only need one byte of buffer
<ekaitz>I'm pretty busy these days, I'm preparing a course on Unix-like OSs... it's getting complex...
<stikonas>ok, I might try to fix hex0 at some point...
<ekaitz>I'll try to be around if you need me or anything, ping me to my email if i'm not here to talk
<stikonas>well, it's more or less clear how to workaround it
<stikonas>anyway, we are almost at M0 in bootstrapping risc-v
<ekaitz>:D
<ekaitz>did you work on the 32 bit versions?
<stikonas>ekaitz: no...
<stikonas>it's mostly getting the right elf header though
<ekaitz>nah don't worry once everything is ready we can migrate pretty easy
<ekaitz>yeah, the elf header and a couple of commands might need to be changed
<stikonas>well, there are some minor differences in instructions, but should be pretty minor
<stikonas>yeah...
<stikonas>but no changes in jumps, etc...