IRC channel logs
2024-04-05.log
back to list of logs
<almuhs>i suspect that rumpdisk has race conditions <almuhs>in smp with damo22 patch, sometimes freeze during the boot, in ext2fs step <almuhs>or even before, during disk detection <Pellescours>No it’s not race condition, It triggers in non smp mode. It’s relates to the pager <youpi>smp probably makes the issue more probable <almuhs>i'm compiling the default code to be sure that the problem is not from this code <Pellescours>If you run stress program (stressing either disk or memory) with rumpdisk make the VM freeze completely. I started to investigate with solid_black but I don’t know what’s the solution here <almuhs>meanwhile i compile the code, i found some TODO and "function not implemented" <youpi>it should be there in i386/include/mach/i386/machine_types.defs:type rpc_phys_addr_array_t = array[] of rpc_phys_addr_t; <almuhs>there is in the def, but not in the headers <almuhs>pruebas@debian-hurd:~/rumpkernel-0~20211031+repack$ grep -rn rpc_phys_addr_array_t /usr/include/i386-gnu/mach/ <almuhs>/usr/include/i386-gnu/mach/gnumach.defs:209: out pages : rpc_phys_addr_array_t); <almuhs>in gnumach's upstream source code, the type is defined in i386/include/mach/i386/machine_types.defs:105:type rpc_phys_addr_array_t = array[] of rpc_phys_addr_t; <almuhs>and in i386/include/mach/i386/vm_types.h:97:typedef rpc_phys_addr_t *rpc_phys_addr_array_t; <youpi>yes, and you need both installed <youpi>depends how you did it for gnumach.defs, you probably want to do the same <almuhs>currently I have the latest debian version of gnumach <youpi>yes, but you need the newer versions of the other files that gnumach.Defs needs <almuhs>but, if i copy the newer versions, maybe there are compatibily issues <youpi>you can try to copy/paste only the lines you need <almuhs>ok, after copy the definitions of rpc_phys_addr_t , I got compile rumpkernel and compile hurd with it. Now I am sure that the latest rumpkernel debian's sources works correctly <almuhs>other day i will try again with my new patches sources to add the prints <almuhs>notice that I had to "make clean" before "./configure --enable-static (...) && make rumpdisk" to recompile rumpdisk.static <youpi>sneek: tell almuhs later that one can cd rumpdisk ; make rumpdisk.static to build a static version <sneek>almuhs, youpi says: later that one can cd rumpdisk ; make rumpdisk.static to build a static version <youpi>sneek: later tell almuhs one can cd rumpdisk ; make rumpdisk.static to build a static version <solid_black>Pellescours: but we did complete the investigation, didn't we <solid_black>we don't have a good story about paging w/ rumpdisk, at least not one that I'm aware of <solid_black>unless we can guarantee that rumpdisk can write pages being paged out without itself needing dynamic memory, I guess <solid_black>I've been meaning to ask, what are *your* plans concerning aarch64-gnu? <solid_black>are you going to review things? (the glibc port, the gnumach port) <solid_black>should I just dump the gnumach port as one large patch? <youpi>for the asm part I can't really review, I don't know much arm <youpi>for the gnumach part I'm fine with committing it, provided you plan to support it :) <youpi>for the glibc part, I can commit the parts that are very similar to the linux versions <youpi>for more involved parts of glibc it's difficult for me to review <solid_black>the situation is, I'm kind of out my breath with this <solid_black>and I want more people to look at it, build it, play with it, etc <solid_black>and looks like the only way that is going to happen is if it's upstream <youpi>we can commit the gnumach part for a start, since it's already working quite well <youpi>we're missing the gcc part, though, it needs to be pinged <solid_black>the glibc part is actually not that complicated, and you don't need much asm knowlege <solid_black>also Maxim K. of Linaro / glibc told me they (Linaro? glibc?) were going to review it <youpi>ok, so we're "just" missing the gcc part <solid_black>but he evidently knew very little about the Hurd/Mach internals (i.e. didn't know what MIG is) <youpi>that part I can probably review <youpi>it's rather the setcontext/swapcontext and such asm tricky stuff that I'm not at ease with, but he would be <solid_black>by copying the Linux version and adding the Hurdish onstack bits <youpi>sure but we can commit something that works already quite well, before going through more testing <solid_black>for the gnumach port, can you review a GitHub branch, or would you rather I post it as a patch to bug-hurd? <youpi>it'd be simpler to get a series on the list <solid_black>'series' is complicated, I don't really know how to split this <solid_black>well some things like the device tree parser could be split out I guess <youpi>as long as it's just additions <youpi>(or trivial e.g. #if changes) <solid_black>what about Debian, do you have any plans for adding the arch / building packages / etc? <youpi>I actually already had submitted the request for arch addition <youpi>the reply was that it needs to be commited upstream at least a bit :) <youpi>it's just that debian doesn't want to maintain patches <youpi>so it insists on work being upstreamed, before downstreaming the support <solid_black>why do all these projects insist on other bits being upstreamed <youpi>yes, and that's the toolchain <solid_black>good thing at least binutils didn't want us to have a fully functionaning system first <youpi>since they can test some support without needing a system, actually <solid_black>Linaro wants to know how they could test it on their CI <solid_black>I told Maxim that eventually, there'd be Debian, and they could run it in qemu and run the testsuite <solid_black>it sounded like this wasn't a requirement for upstreaming into glibc, but imagine it was <youpi>glibc is fine with not running the testsuite itself <youpi>they just want to be able to cross-build and run the cross-build test <youpi>which thus only depends on the toolchain <youpi>really, it's just toolchain -> glibc -> distrib <solid_black>when reviewing, are you going to bootstrap/build all of this on your end? <youpi>not for just the review before commit <youpi>but as soon as debian adds the arch, I'll try to bootstrap the arch, and that'll bring the buildability question indeed :) <solid_black>so I should 1. ping Thomas again 2. post v3 of glibc port 3. try to post Mach port patches <solid_black>it's really that the way forward is to 1. build/bootstrap more things in userland 2. for people other than myself to review / build / play with aarch64 gnumach, and suggest/do improvements <youpi>sure, but that'safter the initial work is committed <youpi>so gcc then glibc and gnumach <solid_black>the way it's bolted on currently in the aarch64 branch probably breaks i386 <youpi>(though I'm fine with committing gnumach before gcc) <solid_black>somebody just needs to look at it and make it work :| <solid_black>also, unrelated, reminder that v2 of the gnumach arbitrary write exploit is still unfixed <youpi>I don't have details about it <solid_black>the good thing is, we can land public API in Mach (similar to the patch I posted back in January), and that should be enough for glibc/hurd <youpi>indeed, we can already commit that if it's ready and doesn't break x86 <solid_black>it is ready (missing aarch64_debug_state, but that's only going to be needed for GDB), and doesn't break anything <solid_black>well, also any potential SVE / SME state, but we won't support that for now <youpi>solid_black: you mean the january series is unchanged? <solid_black>e.g. I've renamed EXC_AARCH64_FP_ID to EXC_AARCH64_IDF <solid_black>because I mostly started by copying what Apple provided (plus some consulting of the Arm manual) <solid_black>and now I've done *a lot* more reading of the ARM ARM, and got a lot more experience with aarch64 in practice <solid_black>so I decided it makes more sense to call the various bits what ARM docs call them, rather than what would make more sense to someone who's not familiar with ARM <solid_black>here's something that should be possible, and that I will maybe do some time when we have a more complete system: basic Linux syscall emulation, in userland, off-task <solid_black>so a different task would set itself as exception handler, and get syscalls (EXC_AARCH64_SVC) and faults, and decode and translate them to Hurd-native <youpi>you mean porting qemu-system-user ? <youpi>that's in the end less work, too <solid_black>what I'm talking about wouldn't do any recompilation, it would run the binary as-is, just translating syscalls <youpi>that's what you would get with qemu+kvm <youpi>if you run the binary as-is, you need to catch system calls etc. <youpi>doing so without using svm/vmx is probably quite a beast <youpi>when svm/vmx is exactly meant for that <youpi>so you catch illegal instruction faults? <solid_black>I have an exception type, EXC_AARCH64_SVC, that gets raised when you try to perform an SVC instruction that doesn't look like a valid Mach trap <solid_black>the linuxinator task would handle that by emulating the syscall <youpi>anyway, my point is: porting qemu-user makes sense and is useful on the long run. Doing something similar is probably very fun, but not clear it'll have the same impact long-term-wise <youpi>(we could also do the converse, btw: port qemu-user to support the gnumach calls) <solid_black>sure, I'm not saying this is better than a potential qemu port, or will be useful, or anything <solid_black>just that it should be possible, and fun, and that I might do it <solid_black>supporting Mach calls under qemu-user is probably a lot more complicated <sneek>Welcome back almuhs, you have 1 message! <sneek>almuhs, youpi says: one can cd rumpdisk ; make rumpdisk.static to build a static version <solid_black>wrote way too many words in the commit message of the VM entry deadlock commit patch, as requeste <youpi>your future self will thank you so much 10yrs from now when you'll dig back into this question ;) <almuhs>now i will have a few more info when i try rumpdisk in real machines. I only have to copy the deb files and the rumpdisk.static and copy all in the harddisk to test <solid_black>...and of course I made many typos in said commit message <youpi>smp is supposed to be working with rumpdisk, right? <youpi> Enter evaluation : _SB.PCI0.SC0._ADR (Integer) <solid_black>it works for me, but I have 0 idea how to debug any rumpdisk issues <almuhs>in my case, that error appears when i use an IDE disk with noide <almuhs>or when i forget change "wd0 noide" to "hd0" in GRUB when I have a IDE disk in /dev/hd0 <youpi>I might be doing that indeed <solid_black>noide doesn't mean "I hate IDE", it means to disable Mach's Linux drivers, to give rumpdisk a chance to drive the IDE <almuhs>pixide (the IDE driver in rumpdisk) is buggy <youpi>ok, after disabling the ide CD, it does boot <almuhs>i don't know, anyone told me here some time ago <almuhs>some weeks ago, someone sent a patch which solve CD with size 0 <almuhs>so in upstream this problem is solved, i think. But in debian's gnumach, it's necessary to put in a cdrom in the drive to boot <youpi>my boot gets stuck after Starting system message bus: dbus. <solid_black>do you mean full smp, or damo22's mode where everything runs on a single cpu? <youpi>usually next step is Starting internet superserver: inetd. <almuhs>yes, sometimes freeze during the boot <youpi>solid_black: I'm using the current master, iirc that runs on a single cpu <almuhs>with old damo22 patch which modifies the scheduler, it needs "only" 2 or 3 attempts to get boot <solid_black>so there's almost no reason for that to work differently than non-SMP <almuhs>without this patch and enabling all cpus during the boot, it was necesary more than 20 attempts to get boot <almuhs>i don't know if latest patches to fix some race conditions improve it a bit <youpi>ok, I don't think the SC0 issue was about ide: it is still hanging without it <youpi>I just got lucky right after disabling the ide cd <solid_black>with damo22's patch reverted and my patches that I posted, my system booted to dhcp, and then hung <solid_black>and I didn't think to ask kdb about where they're blocked <solid_black>also I don't yet fully understand how kdb works, so aarch64 doesn't really support it yet <almuhs>i simply turn on the VM, fix filesystem and try again <solid_black>I should make snapshots instead, so fs as stored doesn't get corrupted <youpi>note: the SC0 issue seems related to interrupts <youpi> Enter evaluation : _SB.PCI0.SC0._ADR (Integer) <youpi> Exit irq handler [9]: new delivery port f64cf3d0 entry f5639ec0 <youpi>which I'm really not surprised of <youpi>the interrupt delivery path most probably didn't get completely cleaned <youpi>I disabled the hurd console, it went further, almuhs: do you use the hurd console? <youpi>do apic-enabled kernels work fine (without smp), for a start, actually? <almuhs>because i configure keymap in spanish <almuhs>and disable the other patch which set all process to cpu0 <almuhs>sometimes i need a few attempts to get boot <almuhs>with upstream code in smp, with the patch which assign all to cpu0, i usually get boot without problem <youpi>better avoid these patch which only burry the issue, to get the issue all the time and fix it :) <youpi>assigning all to cpu0 is not yet the default in upstream? <youpi>I don't understand why you say "with the patch which assign all to cpu0" then <youpi>what do you mean by upstream smp ? <almuhs>compiling upstream with NCPUS > 1 <solid_black>commit aadb433981b086bfb4e082757fed1154582d5497 fwiw <almuhs>gnumach's upstream source code, compiled with --enable-ncpus > 1 <youpi>(btw it'd have been good to submit a patch that disables the linux group and enables apic, instead of letting me have to figure it out) <almuhs>i put this flags under your instructions <youpi>that doesn't mean that we want to have to do that longtermwise <almuhs>btw, this script also works changing the SRC_PATH to the directory where i git clone the gnumach's savannah directory <youpi>ok, disabled inetutils-inetd too, and now it boots <youpi>ah it seems it's lightdm which poses problem <youpi>I'm not saying it doesn't work, I'm saying it hangs the boot <youpi>while in up it doesn't pose any problem <youpi>(it doesn't work either, but doesn't bother th eboot) <solid_black>from what I've read, it doesn't sound like there's an easy way to get a text-mode console in the aarch64 world (or anywhere but x86) <youpi>solid_black: but there's a serial port, isn't there? <youpi>so gnumach at least has a console <almuhs>youpi: but, which is your kernel configuration? upstream's gnumach? <youpi>and then you "just" need a frame buffer client for the console :) <solid_black>so so far, it sounds like Mach console is going to always be going to a serial port, and the Hurd console would be rendering characters to any graphics displays <solid_black>but this also means that you won't see kernel boot-up logs scroll by <almuhs>i go to make git pull and compile again upstream <youpi>solid_black: not really a problem for non-dev users :) <youpi>ok, ssh does pose problem too in smp boot <youpi>still, I'd really say to fix the rumpdisk booting issue first, since it's a very deterministic one <almuhs>it's very important to get rumpdisk detect real hdd <Pellescours>for the IDE rumpdisk issue, note that it’s not related to apic nor SMP. If you use IDE with PIC and 1 cpu, the problem will occur <almuhs>upstream's gnumach compiled with my script, and in a VM with AHCI and rumpdisk, work successfully <almuhs>this latest test has been done with a real HDD connected to my VM. I go to put this HDD in a Thinkpad T440p, to check the results of my rumpdisk prints (probably it will not detect the hdd) <youpi>Pellescours: I never got this issue, in which condition are you reproducing it? <youpi>almuhs: but with damo22's workaround, right? <youpi>ok, but then try to reproduce it with qemu, and there you'll be in a situation to fix it <almuhs>i connected this harddisk to qemu, installed Debian GNU/Hurd with all the necesary <youpi>ok, so I have to be explicitly clear: how do you plug it? <almuhs>and after this, i disconnected harddisk and put in in a Thhinkpad T440p <youpi>gnumach doesn't care how it's plugged to the computer <almuhs>to get qemu has permission to access <solid_black>so that it's fully accessible even to mast sandboxed code :) <almuhs>yes, i only need it to install the system from qemu <almuhs>after this, i got to run the debian-hurd-2023 installer with noide , and as this way, install the system in the disk from qemu <almuhs>once installed, i boot the system adding noide to GRUB config <almuhs>and once booted, i manage this as a common VM <almuhs>configure debian repositories, apt update, apt upgrade, apt full-upgrade <Pellescours>youpi: if you take the debian VM, you boot it with rumpdisk and your disk in IDE mode, you’ll have the "Enter evaluation : _SB.PCI0.SC0._ADR (Integer)…" errors <almuhs>then i compiled other gnumach (upstream, smp with my patch, upstream-smp) and upload this gnumach to the VM. Make update-grub to add all to the list <youpi>but if you guys see it as a way to reproduce the issue, then use it <youpi>and you'll be able to fix it <almuhs>youpi: don't forget to add -M q35 in qemu <almuhs>qemu-system-i386 -M q35 -m $MEMORY $OPTIONS -smp $NCPUS <youpi>ah, if you hide options, I can't see them <almuhs>if this option is not set, gnumach detects the disk as IDE, even if you are using ahci flags <youpi>that ratther makes it hang earlier <youpi>[ 1.0200050] vendor 8086 product 100e (ethernet network, revision 0x03) at pci0 dev 3 function 0 not configured <youpi>[ 1.0200050] ahcisata0 at pci0 dev 4 function 0: vendor 8086 product 2922 (rev. 0x02) <youpi>kvm -cpu host -smp 2 -m 4G -chardev stdio,signal=off,id=stdio -serial chardev:stdio -machine q35 -device ahci,id=ahci1 -drive id=boot,if=none,format=raw,media=disk,file=/root/boot,cache=writeback -drive id=root,if=none,format=raw,media=disk,file=/home/hurd,cache=writeback -device ide-hd,drive=boot,bus=ahci1.0 -device ide-hd,drive=root,bus=ahci1.1 -vga std -net tap,script=/root/ifup-start-hurd -net nic,model=e1000 -net nic,model=e1000 -gdb <youpi>[ 1.0200050] WARNING: DELAY ESCAPED <almuhs>other thing: i had to use a raw image <youpi>so it *really* looks like an irq routing issue <youpi>the more you use circumventions to hide a bug <youpi>the more difficult it will be to fix the bug <youpi>rather just fix the bug in a situation where it happens all the time <youpi>instead of pushing it away, only for it to bite you later in a situation which will be *way* more difficult to debug with whatnot processes doing all kinds of stuf altogether <almuhs>"just". I don't know how rumpdisk works <almuhs>btw, i use qemu, not kvm directly <youpi>kvm is a lightweight frontend to just run qemu -kvm <almuhs>but i see many options in your line <youpi>not that much more than yours <youpi>(and most of them completely unrelatde) <youpi>ok, now it did pass the driver hang, by luck <youpi>still stuck at starting sshd <almuhs>my network options are only set to be able to disable dhcp, and know a correct address to set <almuhs>because some time ago, i found that the boot usually freeze in dhcp step. Now it seems solved, but i keep this option <almuhs>now i'm using dhcp without problem <almuhs>but in the first smp patches sent by damo22, pfinet freezed at dhcp <youpi>it very quickly hangs whatever I do <almuhs>are you tried to install the system from debian installer instead use the img file? <youpi>there's no point trying to find situations where it works <youpi>to make progress, one has to fix the situations where it doesn't work <youpi>otherwise we'll keep staying in a niche situation where you have to know that you have to align all stars^Woptions to get things work only by sheer luck <youpi>for a start, was it checked whether interrupts get routed to the BSP only or also on the AP? <youpi>and if the latter case, if things happen correctly? <almuhs>which are working in i/o is damo22 <almuhs>in smp, i only worked in cpu startup and configuration, and IPI sending. But the APIC configuration and most of I/O is from damo22, because it's a weakness for me <youpi>just not knowing about it *yet* <youpi>it's just about reading stuff, putting prints to see what happens, and working it out <youpi>seeing what you have already achieved, you can do that, it just takes time <almuhs>i work better in a more deterministic environment <almuhs>and the i/o is not deterministic for me <youpi>I wonder why you started working on smp, which is the most non-deterministic world :) <youpi>i/o is completely deterministic, on the other hand <almuhs>i started in smp as a chance, XD. I notice contradictory that a thread-based system only was using a unique cpu <almuhs>btw, i need to learn how to debug a hurd server meanwhile it's running <youpi>we have been using unique-cpu systems for decades before multicore went usual ;) <almuhs>the patch which i sent some years ago to fill last-processor field in the stat file doesn't works: last-processor keeps to 0 even when debugging the processor table from gnumach it shows other different value <almuhs>debugging gnumach from gdb in my smp environment, i noticed that last_processor many times is different to 0. But, i don't know if proc or procfs, continue reading 0 in last_processor <almuhs>in other words: when last_processor in gnumach is different than 0, in hurd appears as 0 <almuhs>so i need to debug proc and procfs to follow the sequence of this data, to find where is the fail <youpi>simplest is to use mach_print() <almuhs>but it can be useful connect gdb or any similar to the servers <youpi>yes but not all kinds of servers <youpi>for procfs you'd have to be careful since then you cannot access /proc any more <almuhs>i need to check the status of last_processor and related struct <almuhs>mmm... maybe i have to compile this servers with a gnumach-smp ? <almuhs>like we have just done with rumpdisk <youpi>the headers don't change whether smp is enabled or not <Pellescours>I just realized that the ton of "Enter evaluation…" and "Exit evaluation…" messages are debug messages from rumpkernel. That’s surprised me because it did not appear at the begining (when I bringed piixide to rumdisk 2 years ago). But there is still the lost interrupt <Pellescours>and iirc the piixide driver always had this issue, but iirc the issue appeared only when I was shutting down the VM, not at the boot <almuhs>i had seen this same issues in real hardware <almuhs>when I configure my old Thinkpad in compatibility mode <Pellescours>I’m asking if this issue of lost interrup is in gnumach/hurd or in the rumpkernel piixide driver, because ahcisata behave correctly <almuhs>sometimes, in some models, like R61i, when I configure SATA in AHCI mode in the BIOS, the HDD continues being detected as IDE <almuhs>and in T60 i think that there are the same issue <Pellescours>Maybe updating the netbsd source to latest will fix piixide <almuhs>added to this, in real hardware, i think that the problem is that rumpdisk is not detecting the interface correctly. That the detection problem is not from the disk, instead it doesn't detect the interface <Pellescours>if you try to boot a nedbsd on this hardware, you’ll may have some answer. If the disk is not detected, then the driver need to be patched. Otherwise it’s our integration that is buggy <almuhs>Pellescours: what version of netbsd i have to try? the latest? <Pellescours>yes the netbsd version we imported for rumpdisk is from 2021 <gnucode>I've got a qoth for q1 almost done. Anyone want to volunteer to proof read? <gnucode>sneek: later tell solid_black that I am about to submit a qoth for Q1 of 2024. I would like to mention for Alpine Hurd distribution. Do you have a git repo somewhere? <almuhs>hi. After try NetBSD 10.0 i386 in a Thinkpad T440p, it detects the HDD correctly <almuhs>and the T440p is so modern to don't support "compatibility mode" <gnucode>I still haven't gotten the Hurd to run on the T410. Not that I've tried very hard. <almuhs>with the gnumach's IDE driver, setting the SATA interface in compatibility mode, you can install Hurd in the T410 without problem. The problem is with rumpdisk