IRC logs for #openrisc Sunday, 2014-07-20

--- Log opened Sun Jul 20 00:00:27 2014
stekerndalias: yeah, that's fine I think04:52
stekernlooks like there's more to it than just adding support for msync to the implementations, the assembler doesn't even grok it.07:07
olofkstekern: Ah. One of the famous missing instructions. I think it's kind of funny that after 15 years, we can still find instructions that haven't been implemented :)08:32
olofkOf course, it's not as critical as the one's that were found to be missing a few years ago08:33
olofkblueCmd: I'm about to merge your fusesoc patch now08:38
olofkThere are some minor things like unneeded imports that I want to fix. Mind if I alter the patch before I apply it?08:38
blueCmdolofk: oh, like what?09:15
blueCmdoh yes, i see it09:17
blueCmdi'll fix that, spares me a merge conflict09:17
blueCmdolofk: there you go09:19
blueCmdstekern: that patch you sent me for the kernel related to llsc, what does it fix?09:55
stekernit fixes the situation when a l.swa causes a data pagefault10:32
stekernwithout the patch, the kernel will think that it was a load causing the data pagefault (since it don't match what it thinks is stores)10:33
stekernthis typically happen when the kernel has mapped a zero page which is being written for the first time and the write should map the real page and remove the write-protection10:36
blueCmdstekern: ah hm10:53
stekernI get a feeling I wasn't clear enough ;)10:57
blueCmdstekern: nah, it think I got it - but I'm trying to think of if that could break my atomics the way they are broken11:01
stekernah, ok. if you'd experience the bug, it would just go into a data pagefault loop around the l.swa11:03
blueCmdstekern: hm, it would lock the system I guess?11:06
stekernwell, 'lock' in that sense that it will not be doing anything else than constantly serving that data pagefault over and over again11:30
blueCmdstekern: my programs lock, but they are running (as in, I can Ctrl-C them)11:36
blueCmdif I understand you correctly, this bug would lock up the whole system and that would not be possible11:36
stekernhmm, a signal can probably intercept that loop12:07
stekernso maybe my description of the 'lockup' wasn't right/clear12:08
blueCmd    25f8:       e4 27 38 00     l.sfne r7,r712:29
blueCmd    25fc:       13 ff ff eb 25a8 <main+0x44>12:29
blueCmdthat seems wasteful12:29
stekernheh, where does that come from?12:30
blueCmdstekern: the Wonderful and Almost Perfect Atomic Generation (TM)12:31
blueCmdor WAPAG as I usually call it12:31
blueCmdtrying to figure out why that loops seemingly forever12:34
blueCmdhm, it loads a value to r7 before the compxchg which compxchg overwrites which it later tries to compare against12:40
blueCmdright, it sets r7 to 0, so the thing it wants to compare is if it succeded or not12:40
blueCmdI might have found the error and we shall never ever speak of it again....12:57
blueCmdalso, I'm deeply disappointed in you stekern. It's your role as code reviewer to find bugs in my code, clearly the biggest blame here is on you ;)12:58
blueCmd(patch that I hope will fix stuff
poke53281blueCmd: Did you also succeed implementing the ata device. We discussed this a month ago.13:00
blueCmdpoke53281: yes, no I didn't figure it out - I resorted to use virtio instead13:01
poke53281Yes I read your email.13:01
blueCmdpoke53281: actually I totoally forgot about that I tried to use ATA and was a bit confused when I was about to commit the virtio stuff (What? Did _I_ write this?)13:01
poke53281You could also mount the 9p filesystem.13:02
blueCmdYes, that's what I do, but I didn't show it in the screencast13:02
blueCmdit's super convienient and fast13:03
poke53281Ok, so one important question for me. You can compile a linux kernel that boots Debian? I have still problems with chrooting to Debian when I try a kernel.13:04
poke53281I still think, that qemu-user is much faster, than a full emulation.13:04
blueCmdpoke53281: Hm, I think I can - I get weird lockups though, possibly related to the atomic thing I'm fixing now13:04
blueCmdpoke53281: it is, but I require pthreads13:04
poke53281I get a segmentation fault, when I try to chroot to Debian.13:05
blueCmdhah, that's no good! :)13:05
poke53281I use your linux kernel in your github repository.13:05
blueCmdpoke53281: yes, it was broken :(13:06
blueCmdpoke53281: sorry about that13:06
blueCmdI just updated it the nice rebase stekern did13:07
poke53281It was updated last time on May 19th13:07
blueCmdthat should work, but you might need one additional patch (use branch 'mexiko' or apply
blueCmdpoke53281: well, not really - I replaced the old repository with stekerns rebase13:08
blueCmdit's a forced push so you might want to re-download it if you have changes on top of it13:08
poke53281Ok, trying13:08
blueCmdmy repository was getting out of hand with weirdness13:08
blueCmdnp, thanks for poking me about it13:08
poke53281By the way. Yesterday I saw jor1k running on a relatively new Intel CPU. 200 MIPS!13:09
poke53281That is more the speed of an AMD K6 CPU or a Pentium 2.13:10
blueCmdwoo! :D13:11
poke53281Ahh, by the way. We should implement the idle state in the Linux kernel.13:11
poke53281Also for QEMU.13:11
blueCmdyes yes yes x 100013:11
poke53281It is relatively easy. A few lines in Linux13:11
poke53281I use my special "halt opcode"13:13
poke53281But according to the spec I should use l.mtspr ...13:14
poke53281Well, no problem. I read the spec after the implementation :)13:14
poke53281There must be also a check, whether the cpu supports the sleep mode.13:15
poke53281I should add this check to the patch and send it to the mailing list13:37
poke53281stekern , blueCmd : If there is no objection I will send this patch to the mailing list.14:14
poke53281Suggestions welcome14:14
stekernis the SPR_UPR_PMP define correct in the kernel?14:14
stekernit has been wrong somewhere, can't remember where though14:15
poke53281#define SPR_PMR_SDF     0x0000000f  /* Slow down factor */14:15
poke53281#define SPR_PMR_DME     0x00000010  /* Doze mode enable */14:15
poke53281#define SPR_PMR_SME     0x00000020  /* Sleep mode enable */14:15
poke53281#define SPR_PMR_DCGE    0x00000040  /* Dynamic clock gating enable */14:15
poke53281#define SPR_PMR_SUME    0x00000080  /* Suspend mode enable */14:15
poke53281ups, wrong table14:15
poke53281#define SPR_UPR_PMP        0x00000100  /* Power management present */14:16
stekernminor nit, the kernel coding style claims that there should be an empty line after the '/*' in block comments14:16
stekernyeah, that's wrong. it should be 0x00000200 (1<<9)14:18
poke53281Yes, I see. Thanks for mentioning it.14:18
stekernnot your fault, but that needs fixing before you can use it in your code14:19
poke53281No problem. Then two patches.14:20
poke53281PIC and PMP must be exachanged in the table.14:21
stekernok, I've got binutils emitting l.msync, l.psync and l.csync now14:33
stekernblueCmd: don't worry, I take full responsibility for that bug!14:37
stekernor1ksim threats them all as no-op instructions14:41
blueCmd*sigh* rebasing glibc to the latest version is forcing me to implement nocancel read/write14:50
blueCmdoh well, I didn't know those existed so it will probably solve bugs if I implement it14:50
stekernthat's related to how glibc implements cancellation points, right?14:55
blueCmdstekern: I have no idea yet14:59
stekernI'm pretty sure it is15:08
blueCmdstekern: hm, i was a bit quick on calling that the bug, re-reading it the first way was correct17:03
blueCmdI think I'm just missing a "early clobber" on retval or something17:06
daliasthe nocancel ones are just noncancellable versions of the functions that would otherwise be cancellation points17:09
blueCmdstekern: if you continue pushing stuff at the same pace as you have now, you will soon lose respect and push something bad :-)17:34
blueCmdyou're supposed to sweat and not be able to sleep for 3 nights when you push to upstream17:34
stekernyeah, I know...17:36
stekernactually, the commit message had a typo in it17:38
stekernit's already happening17:38
stekern"This webpage is not available"17:39
blueCmddalias: what would the effect be if I make all syscall non-cancellable?17:40
blueCmdstekern: this gif is everywhere, so don't fret - I have an unlimited supply of links to the same gif17:40
daliasbluecmd, it would be non-conforming17:42
daliasread and write are both required to be cancellation points17:42
blueCmddalias: right, but for debugging17:42
blueCmddalias: I've done so now, and I'm having trouble Ctrl-C'ing ping for example17:43
blueCmdbut I'm not sure if that's relevant17:43
daliasunless the bug you're encountering is happening in a program that's performing cancellation, i don't think it will make any difference17:43
daliasi really doubt ping is multithreaded or using pthread_cancel17:43
blueCmdright. this is busybox's ping so it might do some weird stuff but that was what I was thinking17:44
blueCmdoh jikes. I have a 19 days streak on github apparently18:03
poke53281blueCmd: Interesting. With the new kernel neither ethoc nor fboc seems to work. For example I get a "Framebuffer registration failed" error18:32
blueCmdpoke53281: hm, weird18:32
poke53281ATA seems to work. And all other drivers too.18:33
blueCmdpoke53281: ethoc has an endian patch, if you open ethoc.c in the kernel you should be able to see #ifdef CONFIG_WISHBONE_BIG_ENDIAN or something18:34
poke53281Hmm, Ok. I will take a look.18:38
poke53281Does someone know how to get a log of the changes of the file sorted by date?18:39
mor1kx[mor1kx] skristiansson pushed 1 new commit to master:
mor1kxmor1kx/master 2e695ee Stefan Kristiansson: decode: do not generate illegal insn exception on l.msync...18:39
poke53281git log -p filename18:39
poke53281does not sort18:39
blueCmdreally? i just do 'git log filename'18:39
blueCmdah sorry, no it won't be by date18:40
blueCmdit will be in order, but not by date18:40
poke53281this is exactly, what screwed me. Because I checked for changes before I asked you.18:40
poke53281But I missed them, because I expected a sorted list.18:40
daliasi think git log has multiple options for how it orders the results18:41
daliasbut i'm not sure if "by date" is one18:41
stekernpoke53281: you didn't fully emulate to ocfb, right?18:41
daliasmost of them looked topological last i checked18:41
poke53281But the registration is the last step. And I checked for changes in the probing function.18:42
poke53281But maybe, I should check again18:42
stekernthat's probably it then, the upstreamed driver detects endianness by writing a value to the base address register and reading it back18:43
* blueCmd giggles18:45
blueCmd" I have used many different kernels and all sorts of optimization combinations-yesterday I finally used -noatime and -notail for my reiserfs file system: The single biggest performance boost I have yet to see-"18:48
blueCmdyeah, why would have thought that tuning your IO would be the low-hanging fruit18:48
blueCmdolofk: <318:50
olofkpoke53281: If PICP and PMP are swapped in the kernel, and you're fixing that, please put a note here as well
blueCmdoh I hate bugzilla18:59
blueCmd"List all open bugs". would that be so hard?19:00
poke53281olofk: done19:13
poke53281@stekern: This endianess is just weird.19:15
poke53281This check is especially weird.19:17
poke53281But finally it works19:27
poke53281Now, the ethoc19:27
stekernumm, what's weird about it?19:35
poke53281what was the original write command to the registers?19:39
poke53281I tried every combination. And only one is working.19:39
poke53281And the working combination is not compatible with the old implementation.19:40
poke53281Mhh, there is a new .config option which I might have to activate.19:42
poke53281Framebuffer foreign endianness support19:42
poke53281The detection method is especially weird.19:44
stekernwell, I couldn't use the wishbone endianness config option, since it's not upstream19:45
stekernand it's not even certain that the core would sit on a wishbone bus19:46
stekernthe detection method is just writing a value to the register and see if it comes back the same way.19:47
stekernI don't understand what's so strange about it19:48
poke53281Well, why do you think, that this works. The framebuffer device must support this.19:48
stekernthe foreign framebuffer option is for the framebuffer, the detection is for the registers19:49
poke53281Why should the reading part be different wired than the writing part?19:49
stekernit wouldn't, but the ioread/write functions are not endian agnostic19:51
poke53281Now it works in both directions. The foreign framebuffer option must be compiled in in order to work.19:52
stekernso a ioread on a be machine will be converted to le19:52
poke53281Therefore I got the registration failure.19:52
stekernso, is your framebuffer wired like that?19:53
poke53281Ahh, Ok.19:53
poke53281this.addr = Swap32(value);19:53
poke53281Always I had to swap the value which was send over the bus.19:54
poke53281So, yes19:54
poke53281With the new framebuffer, it is no longer necessary.19:54
poke53281new framebuffer driver ....19:55
blueCmdbah, remind me. r3 is return value?19:56
blueCmdor is it r11 or something?19:56
blueCmdyes r1119:57
stekern...and r1220:01
stekernnot sure why we have a separate register for return value.20:02
blueCmdI wonder if 64 bit return value are going to work for syscalls :P20:02
stekerniirc Joern explained some corner case where that might be beneficial20:02
blueCmdtail-recursion maybe?20:03
blueCmdolofk: are you a wizard?20:07
blueCmdolofk: If I told you that in my life I've probably spent hours trying to do that20:07
blueCmdI would only slightly exagerate20:07
olofkI am the god of bugzilla. You can call me godzilla20:09
blueCmdolofk, keeper of the 61 bugs20:10
olofkblueCmd: Yeah, I got a bit power crazy for a while there20:10
blueCmdolofk: I'd imagine20:10
stekernpoke53281: note that if you are using the foreign framebuffer option, you have to either use 32-bit or make sure the programs honor that flag20:11
olofkHmm.. I wonder where that patch is that I'm talking about in a comment in bug 7720:12
stekernxorg doesn't for instance20:12
stekernI had completely forgot about bug 7720:13
stekernI just remembered that the define was wrong somewhere ;)20:15
poke53281Before my patch get applied to the kernel we should be sure if we want to follow the specification or not.20:15
olofkMy plan was to release a version 3 of or1200, so that we could do invasive changes after that20:15
olofkBut I almost killed myself trying to write a changelog20:16
olofkIt's a fucking mess20:16
stekernpoke53281: does jor1k follow the spec or the kernel definition?20:18
stekernmor1kx follow the spec at least20:18
poke53281the spec.20:19
poke53281But so far it didn't matter.20:19
stekernthen we are two against one ;)20:20
poke53281I implemented today the check if the pmu is installed or not,20:20
poke53281spec, verilog, linux, or1ksim, qemu, jor1k.20:21
poke53281All have to be checked.20:22
poke53281For consistency.20:22
poke53281so far the kernel didn't care about it.20:22
stekernyeah, it just printed some info about it20:22
poke53281The worst thing, that can happen with my patch is, that the kernel writes to an unknown register via l.mtspr.20:22
poke53281to the pmu register. Nothing really serious.20:23
blueCmdpoke53281: which can be pretty bad :P20:23
stekernno, to the pic register...20:23
stekernah, no... right PMU20:23
stekernbut anyway, the spec should be the reference. if there is some need for special handling for buggy implementations, so be it. But at least spec compliant implementations should be handled correctly first hand.20:25
poke53281if the pmu is not installed, nothing will happen. In the worst case we get an exception or so.20:25
poke53281At the moment I can't see a good workaround.20:28
stekernyeah, except something like a static config for broken implementations20:29
blueCmdstekern: does "ping" work for you with musl and your latest kernel?20:30
blueCmdit sends one ping and then just hangs for me20:30
blueCmdseems to be related to SIGALRM, but I'm not sure20:30
stekernI don't think I've tried, wait20:31
stekernworks here20:32
stekernbut I'm not using the master branch, I'm using my smp branch20:32
blueCmdhas IPC64, what gives?20:33
blueCmdah right, you defined it to 020:33
blueCmdopenat(AT_FDCWD, "/dev/sem.PBpq8p", O_RDWR|O_CREAT|O_EXCL, 0700) = 320:40
blueCmdhah, not sure but that doesn't seem the correct way to test semctl20:40
stekernwhat are you looking at?20:42
blueCmdstrace of a libc testuite20:43
blueCmdshould be what "sem_open" does20:43
blueCmdoh, it might be correct looking at the code20:45
blueCmdstekern: which branch is that you're running of the körnöl?21:07
blueCmd ?21:07
stekernthat enables the SPR scratch reg hack by default though21:09
stekernI'm working on implementing a proper solution in mor1kx now21:10
stekernthat hack works in or1ksim though, since those SPR are read/writeable there21:11
stekernnot sure if it works in qemu21:11
stekernit's not working in a vanilla mor1kx21:11
blueCmdI wonder if it will work in qemu21:12
stekernyou can just turn those #if 1 into #if 0 and it will revert to the old behaviour21:13
blueCmdnothing on my screeeeeen21:14
blueCmddo I need to use something from simple_smp.dts ?21:15
poke53281I didn't follow the discussion. What is the status for the multi-core environment?21:16
blueCmdpoke53281: it's fine if you hate console output21:16
stekernblueCmd: ?21:16
blueCmdit's very very quiet, we could call it Zen Linux - too bad it's already a thing21:17
poke53281Usually I like console output.21:17
stekernI have console output on a dual-core here ;)21:17
stekernblueCmd: you can use the old or1ksim_definconfig and the accompanying .dts21:17
poke53281Better than a gui with a tabulated output but no "copy" support21:17
blueCmdstekern: I'm a simple man, I want output on my unicore :P21:17
olofkI have console output on a quadcore here. It's an intel though21:17
blueCmdstekern: I have a bit of changes to or1ksim.dts that I would rather keep21:18
stekernyeah, that shouldn't be an issue21:18
blueCmdthat's why I asked about if there there was any specific things I need to move over, like ompic21:18
stekernompic is only needed for CONFIG_SMP21:18
blueCmdoh, maybe I should =n that21:19
blueCmdif I'm not using it21:19
stekernyeah, but it's not enabled by default21:19
stekernI can build you a kernel that boots in or1ksim without the spr hack21:20
stekernjust to check21:20
blueCmdstekern: no, but I enabled it!21:20
blueCmd"why should I not run the latest code?" I thought21:20
olofkhmm... can I change temporarily change the DNS server easily?21:21
blueCmdolofk: you can just overwrite /etc/resolv.conf I guess21:21
olofkah yes. That's where it is21:22
stekernok ;) in the long run, we should of course support running a SMP enabled kernel on a unicore soc, but I doubt that will work as things currently stands21:23
olofkThings just tend to work nowadays so I had forgotten that. Works fine. Thanks21:23
blueCmdstekern: it freezes at "Mountpoint-cache hash table entries: 2048 (order: 0, 8192 bytes)21:23
blueCmdstekern: I want to learn OpenRISC, I have error, please help me:
stekerntry this first:
stekernthat at least boots in or1ksim from git21:27
stekernoh... wait, I have the atomic insns enabled in that though21:28
blueCmdyes, that works21:28
stekernit does? in what are you running it?21:28
blueCmdwonderful and honorable qemu21:29
stekernok, so you have the always succeeding atomics enabled?21:29
blueCmdalways succeeding atomics is best atomics21:30
stekernthat's not going to bite you at some point ;)21:30
stekerndoes your built kernel work if you enable the atomic insns?21:31
blueCmdstekern: I think I have enabled atomics21:31
stekernyes you do21:31
stekernso why isn't your kernel working then?21:33
blueCmdstekern: beats me! :)21:35
stekernlet me try your config then...21:37
daliasbluecmd, sorry, gentoo is actually pretty cool but that site is still fun :) it was especially fun when i had an office-mate whose computer was _constantly_ busy compiling :)21:42
stekernblueCmd: in or1ksim, your config boots up to this: Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)21:42
stekernwhich is way after where it freezes for you21:43
blueCmdstekern: hmpf21:44
stekernwhat happens if you try to boot your kernel in or1ksim?21:45
blueCmdstekern: it crashes with a buserror21:45
mor1kx[mor1kx] skristiansson pushed 1 new commit to master:
mor1kxmor1kx/master bca908d Stefan Kristiansson: propagate OPTION_PIC_NMI_WIDTH all the way up to top level...21:46
blueCmdbut that's later than qemu21:46
stekernok, but that's probably because you have some fancy peripherals in your .dts that aren't supported by or1ksim21:46
blueCmdstekern: nope, not as far as I can see21:47
stekerntry that21:49
stekernit's the kernel I built with your config21:50
olofkGod, how I miss visio. Libreoffice draw is not what I'm looking for21:50
olofkAnd dia has it's own share of problems as well21:50
blueCmdstekern: works21:51
stekernthe only difference is the gcc then I guess...21:51
blueCmdstekern: well, I have mods21:52
stekernblueCmd: right, but that should just make it better, right? =P21:52
blueCmdyes, ofc21:53
blueCmdqemu: fatal: Trying to execute code outside RAM or ROM at 0xffc076dc21:56
daliasstekern, btw does the code in or1k a_store look ok now?21:56
daliasit's a bit heavier than it i'd like but i'd rather just have it be safe/correct/ready-for-use now and worry about improving it later21:57
stekernyeah, that looks ok. and as you say, we can improve it later.21:58
stekernat least our assembler recognizes the l.msync instruction now ;)21:59
stekernand mor1kx will not cause an illegal exception upon them anymore22:00
stekernor1ksim always treated it as a no-op22:00
blueCmdhm, this is weird22:05
blueCmdbuilding the smp version makes it try to read weird addresses22:06
stekernbut did you change the two #if 1 to #if 0?22:07
blueCmdI tried both, but that might be why it's crashing weirdly now22:07
blueCmd(oh, there are two!?)22:08
blueCmdstekern: works! :P22:09
blueCmdstekern: also, this kernel fixes my ping22:11
stekernsorry, I should have said that there are two from the beginning...22:12
stekernmaybe the busybox in the master branch is borken22:13
blueCmdlatest kernel + recompile works, downgrading the kernel makes weird stuff happen22:19
blueCmdstekern: did you change the ABI in any way?22:19
blueCmdFUTEX maybe?22:20
stekern'downgrading' to what?22:20
blueCmdto non-SMP22:20
stekernwhich non-SMP?22:21
blueCmdmy non-SMP which is 3 patches or so on your master22:21
stekernhmm, odd22:22
stekerneverything ontop master should basically just be SMP related stuff22:23
blueCmdyou didn't change any futex stuff?22:23
blueCmdbecause now I get segfault in the testsuite for pthreads, last syscall is "futex"22:24
stekernaha.. is that the "weird" stuff?22:24
blueCmdgit diff mexiko stefan/smp shows futex stuff, but I'm not sure if that's exposed22:24
blueCmdstekern: no, the weird stuff was lockups22:24
blueCmdstekern: now I straced an app and it segfaults when doing futex22:24
stekernthe futex changes are necessary for robust_list to work22:25
blueCmdi'm sure they are, would the be exposed to userspace or is it only internal?22:25
blueCmdtrying with CONFIG_OPENRISC_HAVE_INST_LWA_SWA=n to see if that brings forth cthulhu22:27
stekernthe operations are used internally by the kernel22:28
stekernbut the futex stuff that uses them are of course initiated from userspace22:28
blueCmdhm, with CONFIG_OPENRISC_HAVE_INST_LWA_SWA=n it still crashes, but not on futex22:29
blueCmdstekern: they = futex changes22:30
stekernhmm, I should get up in 1.5h and drive people to the airport... maybe I should at least try to sleep some before that...22:32
blueCmdstekern: :) sounds like a not-too-bad idea22:33
stekernbut the futex_atomic_* operations was necessary for the pthread_robust test.22:33
stekernblueCmd: if you want to have a reference setup:
blueCmdstekern: ok, thanks22:40
blueCmdjeremy_bennett: I'm trying to hunt down what specific changes Jungsook did for floating point support23:57
blueCmdyou applied her patch in,revision?repname=openrisc&path=%2Fopenrisc%2Ftrunk%2Fgnu-old%2Fgcc-4.2.2%2Fgcc%2Fconfig%2For32%2F&rev=133 but opencores's SVN doesn't like to play ball, so I cannot get any diffs or anything23:57
blueCmddo you happen to have some mail or something left that might contain the changes?23:58
blueCmdi'm trying to do some SVN trickery to find out what was changed, but failing that it would helpful23:58
--- Log closed Mon Jul 21 00:00:28 2014

Generated by 2.15.2 by Marius Gedminas - find it at!