Tuesday, 2021-11-16

openpowerbot[slack] <joel> @Matt Johnston https://github.com/litex-hub/linux-on-litex-vexriscv/issues/17403:59
openpowerbot[slack] <Matt Johnston> progress! `[    2.017112] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)`08:19
openpowerbot[slack] <Matt Johnston> just had to revert https://github.com/enjoy-digital/litedram/commit/af9abd6ec9bef7182ec00fa9d21c32c9faba9f87 (and patch it into gen.py)08:20
openpowerbot[slack] <Matt Johnston> thanks @Anton Blanchard and @joel for the pointer to DM. makes sense that masking would cause problems...08:20
openpowerbot[slack] <Anton Blanchard> @Matt Johnston nice work!09:19
lkcldef __init__(....         dm_remapping = {})13:15
lkclthat's an extremely common and also extremely obscure fatal error in the use of python, there13:15
lkclit's a "singleton" pattern.13:16
lkclthe default argument there for dm_remapping is a mutable object.13:16
lkclit is also the *only* instance of that argument (unlike the class itself, or any instantiations *of* that class)13:16
lkcland is therefore, in computer science terminology, a "singleton".13:17
lkclif it had been a tuple (which is immutable) - dm_remapping=() then there would not be a problem13:17
lkclwhat will happen here is that any modifications to dm_remapping (the singleton) inside the constructor will result in all and any subsequent calls returning that *exact same now-modified default argument*13:18
lkcla subsequent instance, if dm_remapping is given as None, will no longer return an empty dictionary but the one modified by *previous instantiation*13:19
lkclthis is unfortunately not very well-known and not very well understood, and is a surprisingly common mistake, i encounter in other peoples' code about once every six months13:21
lkclthe correct action is:13:21
lkcldef __init__(.... dm_remapping=None, ...)13:22
lkclif dm_remapping is None: dm_remapping = {}13:22
lkcland then it's fine because the constructor uses a *local* instance of an (empty) dictionary, not a singleton one.13:23
lkcli would report this on the litex channels but have been prevented and prohibited from doing so: the censorship enacted by florent is still enforced.13:23
lkcltherefore, someone else will have to provide a report to the litex team13:24
openpowerbot[slack] <Paul Mackerras> haha, that sounds like old Fortran where arguments were passed by reference, so a subroutine could modify the value of the constant 2.0 🙂20:41
lkcl:)20:43
*** lkcl <lkcl!lkcl@we.will.rock.you.bnc4you.xyz> has quit IRC23:00

Generated by irclog2html.py 2.17.1 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!