IRC logs for #openrisc Saturday, 2013-09-21

--- Log opened Sat Sep 21 00:00:05 2013
poke53281http://simulationcorner.net/glxgears.png01:32
poke53281Still unstable01:32
poke53281I think I need the help of stekern and jonibo to solve the issue01:36
poke53281_sys_rt_sigreturn is a non-standard syscall and we have to return all registers.01:38
poke53281http://pastie.org/834318102:14
stekernpoke53281: that makes sense02:14
poke53281Don't laugh. It is the best solution so far02:14
stekernnot the pastie (that I haven't looked at yet), but what you wrote up until then02:14
poke53281It works02:14
poke53281stekern: It is weekend for you. And you slept at most 6 hours.02:19
stekerndo you need more?02:19
stekern;)02:19
poke53281YES. Exchanging coffee with sleep works only up to a certain level.02:23
stekerntrue, but different people have different sleep needs, 6 hours seems to be enough for me02:24
stekernbut I usually have 1-2 days in the month where I sleep 8-10 hours02:24
stekernpoke53281: I'm not sure I understand how the patch in the pastie works, the syscall should return with l.jr r9, not l.rfe02:32
poke53281No, the syscall return also with l.rfe.02:33
poke53281or what do you mean. The syscall back to userspace. Or the C-function?02:34
poke53281the original code executed just a C-function. and then jumps back somewhere in the syscall-handler.02:35
* stekern goes back to read the code02:35
poke53281???02:36
stekernto check what you just said02:37
poke53281still ???02:37
poke53281the new code jumps back where the function was called and then jumps directly to restore_all, which is usually called by the other exception handlers.02:39
poke53281I could directly modify r9 to do this.02:39
poke53281The entrypoint is called at the position "_syscall_call:"02:42
poke53281in the same file02:42
stekernah, ok02:42
poke53281Instead of using "_syscall_return:" I am jumping directly to restore_all02:42
stekernwas just looking for that02:43
poke53281So I am omitting in principle "_syscall_resume_userspace"02:44
poke53281and use my own return function02:44
stekernyes, so you're right, I was mixing it up with something else02:45
poke53281I am not sure if this is nothing else than a hack or a reasonable solution. My own feeling is the former.02:48
stekernyeah, you're skipping over "_syscall_check_trace_leave" and "_syscall_check_work" with that02:49
poke53281But I don't see another solution instead of rewriting the whole exception handler.02:49
poke53281Exactly. I am not sure if they are important or not in this case.02:50
poke53281I am not sure for what they are.02:50
poke53281Especially syscall_check_work02:50
stekernyou probably should just restore the extra registers that are not restored in "_syscall_resume_userspace" after calling "_sys_rt_sigreturn" and then just l.jr r902:51
stekernthat sounds like the "correct" solution to me02:51
poke53281Doesn't work so easy. _syscall_resume_userspace overwrites some of the registers.02:52
stekernright...02:53
stekernhmmm...02:54
poke53281So in principle we would need a switch extra for this function at this position.02:54
poke53281And syscall_check_work must not be executed. It would destroy the registers immediately.02:54
poke53281And even syscall_trace_leave executes _syscall_check_work.02:56
poke53281So my solution seems to be correct.02:56
poke53281Or the whole syscall exception handler is broken.02:56
stekernhmm, I don't understood your point with "And even syscall_trace_leave executes _syscall_check_work."02:58
stekernor more, what does that have to do with our problem?02:59
poke53281Both parts should never be executed when I am doing a sigreturn.03:00
poke53281Otherwise the registers will be tainted03:00
poke53281Ahh, Ok. I understand03:00
poke53281Yes, the sentence was nonsense03:00
stekernyes, but I think you *should* be calling _syscall_check_work as well03:01
stekernbut before you do the restore03:01
poke53281syscall_check_work executes:  l.sw    PT_GPR14(r1),r1403:01
poke53281        l.sw    PT_GPR16(r1),r1603:01
poke53281        l.sw    PT_GPR18(r1),r1803:01
poke53281        l.sw    PT_GPR20(r1),r2003:01
poke53281        l.sw    PT_GPR22(r1),r2203:01
poke53281        l.sw    PT_GPR24(r1),r2403:01
poke53281        l.sw    PT_GPR26(r1),r2603:01
poke53281        l.sw    PT_GPR28(r1),r2803:01
poke53281If I do this before the restore I am lost.03:02
poke53281Because it overwrites my saved registers03:02
stekernah, I see...03:03
poke53281Maybe I should restore and then turn back. Then I would have no problems.03:03
poke53281But I would restore r30 too.03:03
poke53281So this will not work either.03:03
poke53281The whole syscall routine should work like an normal exception. Then we would never have this problem.03:04
poke53281We would lose a few cycles.03:04
poke53281I hope you understand my dilemma.03:07
poke53281I could restore the registers which syscall_check_work overwrites.03:11
poke53281But I would need a switch for this syscall.03:13
poke53281I can't think of a good solution instead of rewriting the whole exception handler.03:13
stekernbut doesn't the register save in syscall_check_work save the right register values?03:14
poke53281No, because I have not executes restore_all yet. And the sigreturn is almost something like a task switch.03:15
stekernhmmm03:18
stekerna call graph would indeed be helpful here ;)03:18
poke53281:)03:18
poke53281I have spended already 3-4 hours reading this file.03:19
poke53281I have spent already 3-4 hours reading this file.03:19
stekernwould it be possible to restore the registers *before* you call _sys_rt_sigreturn then?03:19
poke53281No, this function copy from the user stack the registers. They are saved there.03:20
poke53281sys_rt_sigreturn stores the registers in the structure you use in entry.S03:21
stekernyeah, that won't work03:25
stekernyou're missing a delay slot instruction in your patch btw ;)03:26
poke53281http://pastie.org/834326203:28
poke53281where?03:28
stekernnot anymore03:28
stekernso... maybe that's the best way to solve it after all then03:28
poke53281Does the gcc testsuite check signals?03:29
stekernI'm neither sure what the implications are that you'll leave out check_work and check_trace...03:29
poke53281At the moment it is by far the best. But I would ask Jonas Bonn. He wrote this stuff.03:29
poke53281Me too03:30
stekernI agree we would really need some input from jonibo on this03:30
stekernat least I have learned a lot today/yesterday ;)03:31
poke53281Me too03:31
stekernand we seem to have pinpointed the X bug!03:31
stekernor are there more problems?03:31
poke53281The solution took me all together approximately 30-40 hours and a lot of hair.03:32
poke53281A small one. After I kill xeyes with Ctrl+C the whole X server fails with an asserts at one point.03:33
stekernyeah, really shows how counting klocs as a measurement of how much work has been done is so wrong...03:33
poke53281But the codeline is written in the assert output. So maybe not a big problem.03:33
poke53281So true03:35
poke53281www.simulationcorner.net/opencore5/05:35
poke53281startx05:36
poke53281twm &05:36
poke53281xeyes &05:36
poke53281glxgears &05:36
poke53281The first who will read this: You are allowed to be the second person to see a fully functioning X server emulated in the web browser running glxgears.05:37
olofkWow! I'm the second person to see a fully functioning X server  emulated in the web browser running glxgears07:00
olofkThis is really cool07:00
stekernindeed07:19
hansfbaierolofk: glxgears? impressive07:26
hansfbaierolofk: it already works?07:26
hansfbaierawesome07:26
hansfbaierstekern: Here is a nice daughter board for the sockit: http://www.slscorp.com/products/hsmc-snap-on-boards/hsmc-e-gasket.html07:27
hansfbaierbut it's kinda hard to get07:27
stekernhmm, what does that have that the pinheader breakout card from terasic don't?07:29
stekernapart from a higher price tag?07:29
poke53281hansfbaier: http://www.simulationcorner.net/opencore5/07:31
poke53281startx07:31
poke53281twm &07:31
poke53281xeyes &07:31
poke53281glxgears &07:31
poke53281Yes, it works. Finally07:32
hansfbaierstekern: it has the nice SMA connectors07:33
hansfbaierstekern: but is almost as much as your sockit :]07:34
hansfbaierstekern: crazy pricing07:34
olofkThose fancy connectors are damn expensive07:34
olofkSame thing with FMC cards07:34
hansfbaierstekern: I was tempted to build my own, but PCB prototype service is expensive too07:34
hansfbaierolofk: the connectors aren't that expensive though it's only $1007:34
hansfbaierolofk: But it's custom pcb in low quantities that makes it expensive07:35
hansfbaierolofk: crazy world: that GPIO expander is more expensive than the de0_nano07:35
hansfbaierolofk: and that just for a breakout board07:35
hansfbaierI'd be almost tempted to make my own set of breakouts for parallela + altera07:36
hansfbaierand sell them on the net07:36
hansfbaierBut I doubt I'd get rich with it.07:36
olofkI think the most annyoing part here is that Altera chose to use HSMC instead of FMC07:36
olofkFrom what I have seen, there is at least some competition in the FMC market that brings down prices a bit07:37
hansfbaierFMC is by Xilinx. Probably impossible for altera. They had to do their own thing07:39
olofkI thought that FMC was a open standard (VITA-57), but that Xilinx choose to use it07:40
hansfbaierbut thanks goodness altera has free signaltap and quartus for cyclone V 110k LUT07:40
hansfbaierolofk: Ah didn't know that07:40
hansfbaierolofk: what is the javascript or1k simulator good for particulalrly (use cases)07:41
olofkI think the open hardware guys at CERN (ohwr.org) was part of developing that standard. Not sure about this tohugh07:41
hansfbaier FPGA Mezzanine Card is an ANSI standard07:42
hansfbaiergot it07:42
olofkhansfbaier: I think it could be useful to get a simulation environment up and running quickly. But you should ask poke53281 if he had any grand ideas when he wrote it07:43
hansfbaierolofk: Hey look: http://www.kayainstruments.com/hsmc2fmc/07:43
hansfbaierI mean it's really cool, no doubt.07:44
hansfbaiermaybe linux driver devel for openrisc07:44
hansfbaierbut without HW?07:44
hansfbaieroops wrong connector07:44
olofkYeah, something like that would be great07:45
olofkThat would allow Altera boards to use a lot of FMC peripherals07:45
olofkIt doesn't cover the whole pinout of the FMC standard, but probably enough for most cases07:46
hansfbaierpoke53281: that X demo w/ glxgears is really cool07:48
hansfbaier0.4 FPS though :)07:49
hansfbaierolofk: nice business idea07:49
olofkstekern, _franck_ : Thanks for the patches. They are all applied10:13
olofkI will prepare a 3.1 release of orpsoc now that we can have before orconf, so I will be a little picky with accepting patches in the coming few days10:15
olofkBut that only affects orpsoc, so if you have any patches for orpsoc-cores, just bring them on10:16
knzhi all10:38
knzI'll be looking for accommodation in cambridge, any suggestions?10:38
_franck_olofk: I have a mistake in patch 0004, MEM_SIZES is upper case, should be lower, icarus did not complained but modelsim did....11:12
olofk_franck_: Ah.. I missed that too.11:16
poke53281hansfbaier. The FPS written in the terminal is wrong. You have to count yourself. And I get approximately 1FPS in Chrome17:41
amsb18:09
stekernknz: I've booked a room here: http://www.travelodge.co.uk/hotels/577/Cambridge-Newmarket-Road-hotel18:29
stekernI gave up on the yocto stuff and just wiped the rootfs sdcard and installed linaro ubuntu instead...20:04
stekernlet's see if we can build some or1k toolchains on that now then20:05
stekernI at least need binutils to hack up some elf-loading straight into FPGA DDR320:07
--- Log closed Sun Sep 22 00:00:07 2013

Generated by irclog2html.py 2.15.2 by Marius Gedminas - find it at mg.pov.lt!