--- Log opened Sat Sep 21 00:00:05 2013 | ||
poke53281 | http://simulationcorner.net/glxgears.png | 01:32 |
---|---|---|
poke53281 | Still unstable | 01:32 |
poke53281 | I think I need the help of stekern and jonibo to solve the issue | 01:36 |
poke53281 | _sys_rt_sigreturn is a non-standard syscall and we have to return all registers. | 01:38 |
poke53281 | http://pastie.org/8343181 | 02:14 |
stekern | poke53281: that makes sense | 02:14 |
poke53281 | Don't laugh. It is the best solution so far | 02:14 |
stekern | not the pastie (that I haven't looked at yet), but what you wrote up until then | 02:14 |
poke53281 | It works | 02:14 |
poke53281 | stekern: It is weekend for you. And you slept at most 6 hours. | 02:19 |
stekern | do you need more? | 02:19 |
stekern | ;) | 02:19 |
poke53281 | YES. Exchanging coffee with sleep works only up to a certain level. | 02:23 |
stekern | true, but different people have different sleep needs, 6 hours seems to be enough for me | 02:24 |
stekern | but I usually have 1-2 days in the month where I sleep 8-10 hours | 02:24 |
stekern | poke53281: I'm not sure I understand how the patch in the pastie works, the syscall should return with l.jr r9, not l.rfe | 02:32 |
poke53281 | No, the syscall return also with l.rfe. | 02:33 |
poke53281 | or what do you mean. The syscall back to userspace. Or the C-function? | 02:34 |
poke53281 | the original code executed just a C-function. and then jumps back somewhere in the syscall-handler. | 02:35 |
* stekern goes back to read the code | 02:35 | |
poke53281 | ??? | 02:36 |
stekern | to check what you just said | 02:37 |
poke53281 | still ??? | 02:37 |
poke53281 | the 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 |
poke53281 | I could directly modify r9 to do this. | 02:39 |
poke53281 | The entrypoint is called at the position "_syscall_call:" | 02:42 |
poke53281 | in the same file | 02:42 |
stekern | ah, ok | 02:42 |
poke53281 | Instead of using "_syscall_return:" I am jumping directly to restore_all | 02:42 |
stekern | was just looking for that | 02:43 |
poke53281 | So I am omitting in principle "_syscall_resume_userspace" | 02:44 |
poke53281 | and use my own return function | 02:44 |
stekern | yes, so you're right, I was mixing it up with something else | 02:45 |
poke53281 | I am not sure if this is nothing else than a hack or a reasonable solution. My own feeling is the former. | 02:48 |
stekern | yeah, you're skipping over "_syscall_check_trace_leave" and "_syscall_check_work" with that | 02:49 |
poke53281 | But I don't see another solution instead of rewriting the whole exception handler. | 02:49 |
poke53281 | Exactly. I am not sure if they are important or not in this case. | 02:50 |
poke53281 | I am not sure for what they are. | 02:50 |
poke53281 | Especially syscall_check_work | 02:50 |
stekern | you 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 r9 | 02:51 |
stekern | that sounds like the "correct" solution to me | 02:51 |
poke53281 | Doesn't work so easy. _syscall_resume_userspace overwrites some of the registers. | 02:52 |
stekern | right... | 02:53 |
stekern | hmmm... | 02:54 |
poke53281 | So in principle we would need a switch extra for this function at this position. | 02:54 |
poke53281 | And syscall_check_work must not be executed. It would destroy the registers immediately. | 02:54 |
poke53281 | And even syscall_trace_leave executes _syscall_check_work. | 02:56 |
poke53281 | So my solution seems to be correct. | 02:56 |
poke53281 | Or the whole syscall exception handler is broken. | 02:56 |
stekern | hmm, I don't understood your point with "And even syscall_trace_leave executes _syscall_check_work." | 02:58 |
stekern | or more, what does that have to do with our problem? | 02:59 |
poke53281 | Both parts should never be executed when I am doing a sigreturn. | 03:00 |
poke53281 | Otherwise the registers will be tainted | 03:00 |
poke53281 | Ahh, Ok. I understand | 03:00 |
poke53281 | Yes, the sentence was nonsense | 03:00 |
stekern | yes, but I think you *should* be calling _syscall_check_work as well | 03:01 |
stekern | but before you do the restore | 03:01 |
poke53281 | syscall_check_work executes: l.sw PT_GPR14(r1),r14 | 03:01 |
poke53281 | l.sw PT_GPR16(r1),r16 | 03:01 |
poke53281 | l.sw PT_GPR18(r1),r18 | 03:01 |
poke53281 | l.sw PT_GPR20(r1),r20 | 03:01 |
poke53281 | l.sw PT_GPR22(r1),r22 | 03:01 |
poke53281 | l.sw PT_GPR24(r1),r24 | 03:01 |
poke53281 | l.sw PT_GPR26(r1),r26 | 03:01 |
poke53281 | l.sw PT_GPR28(r1),r28 | 03:01 |
poke53281 | If I do this before the restore I am lost. | 03:02 |
poke53281 | Because it overwrites my saved registers | 03:02 |
stekern | ah, I see... | 03:03 |
poke53281 | Maybe I should restore and then turn back. Then I would have no problems. | 03:03 |
poke53281 | But I would restore r30 too. | 03:03 |
poke53281 | So this will not work either. | 03:03 |
poke53281 | The whole syscall routine should work like an normal exception. Then we would never have this problem. | 03:04 |
poke53281 | We would lose a few cycles. | 03:04 |
poke53281 | I hope you understand my dilemma. | 03:07 |
poke53281 | I could restore the registers which syscall_check_work overwrites. | 03:11 |
poke53281 | But I would need a switch for this syscall. | 03:13 |
poke53281 | I can't think of a good solution instead of rewriting the whole exception handler. | 03:13 |
stekern | but doesn't the register save in syscall_check_work save the right register values? | 03:14 |
poke53281 | No, because I have not executes restore_all yet. And the sigreturn is almost something like a task switch. | 03:15 |
stekern | hmmm | 03:18 |
stekern | a call graph would indeed be helpful here ;) | 03:18 |
poke53281 | :) | 03:18 |
poke53281 | I have spended already 3-4 hours reading this file. | 03:19 |
poke53281 | I have spent already 3-4 hours reading this file. | 03:19 |
stekern | would it be possible to restore the registers *before* you call _sys_rt_sigreturn then? | 03:19 |
poke53281 | No, this function copy from the user stack the registers. They are saved there. | 03:20 |
poke53281 | sys_rt_sigreturn stores the registers in the structure you use in entry.S | 03:21 |
stekern | yeah, that won't work | 03:25 |
stekern | you're missing a delay slot instruction in your patch btw ;) | 03:26 |
poke53281 | http://pastie.org/8343262 | 03:28 |
poke53281 | where? | 03:28 |
stekern | not anymore | 03:28 |
stekern | so... maybe that's the best way to solve it after all then | 03:28 |
poke53281 | Does the gcc testsuite check signals? | 03:29 |
stekern | I'm neither sure what the implications are that you'll leave out check_work and check_trace... | 03:29 |
poke53281 | At the moment it is by far the best. But I would ask Jonas Bonn. He wrote this stuff. | 03:29 |
poke53281 | Me too | 03:30 |
stekern | I agree we would really need some input from jonibo on this | 03:30 |
stekern | at least I have learned a lot today/yesterday ;) | 03:31 |
poke53281 | Me too | 03:31 |
stekern | and we seem to have pinpointed the X bug! | 03:31 |
stekern | or are there more problems? | 03:31 |
poke53281 | The solution took me all together approximately 30-40 hours and a lot of hair. | 03:32 |
poke53281 | A small one. After I kill xeyes with Ctrl+C the whole X server fails with an asserts at one point. | 03:33 |
stekern | yeah, really shows how counting klocs as a measurement of how much work has been done is so wrong... | 03:33 |
poke53281 | But the codeline is written in the assert output. So maybe not a big problem. | 03:33 |
poke53281 | So true | 03:35 |
poke53281 | www.simulationcorner.net/opencore5/ | 05:35 |
poke53281 | startx | 05:36 |
poke53281 | twm & | 05:36 |
poke53281 | xeyes & | 05:36 |
poke53281 | glxgears & | 05:36 |
poke53281 | The 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 |
olofk | Wow! I'm the second person to see a fully functioning X server emulated in the web browser running glxgears | 07:00 |
olofk | This is really cool | 07:00 |
stekern | indeed | 07:19 |
hansfbaier | olofk: glxgears? impressive | 07:26 |
hansfbaier | olofk: it already works? | 07:26 |
hansfbaier | awesome | 07:26 |
hansfbaier | stekern: Here is a nice daughter board for the sockit: http://www.slscorp.com/products/hsmc-snap-on-boards/hsmc-e-gasket.html | 07:27 |
hansfbaier | but it's kinda hard to get | 07:27 |
stekern | hmm, what does that have that the pinheader breakout card from terasic don't? | 07:29 |
stekern | apart from a higher price tag? | 07:29 |
poke53281 | hansfbaier: http://www.simulationcorner.net/opencore5/ | 07:31 |
poke53281 | startx | 07:31 |
poke53281 | twm & | 07:31 |
poke53281 | xeyes & | 07:31 |
poke53281 | glxgears & | 07:31 |
poke53281 | Yes, it works. Finally | 07:32 |
hansfbaier | stekern: it has the nice SMA connectors | 07:33 |
hansfbaier | stekern: but is almost as much as your sockit :] | 07:34 |
hansfbaier | stekern: crazy pricing | 07:34 |
olofk | Those fancy connectors are damn expensive | 07:34 |
olofk | Same thing with FMC cards | 07:34 |
hansfbaier | stekern: I was tempted to build my own, but PCB prototype service is expensive too | 07:34 |
hansfbaier | olofk: the connectors aren't that expensive though it's only $10 | 07:34 |
hansfbaier | olofk: But it's custom pcb in low quantities that makes it expensive | 07:35 |
hansfbaier | olofk: crazy world: that GPIO expander is more expensive than the de0_nano | 07:35 |
hansfbaier | olofk: and that just for a breakout board | 07:35 |
hansfbaier | I'd be almost tempted to make my own set of breakouts for parallela + altera | 07:36 |
hansfbaier | and sell them on the net | 07:36 |
hansfbaier | But I doubt I'd get rich with it. | 07:36 |
olofk | I think the most annyoing part here is that Altera chose to use HSMC instead of FMC | 07:36 |
olofk | From what I have seen, there is at least some competition in the FMC market that brings down prices a bit | 07:37 |
hansfbaier | FMC is by Xilinx. Probably impossible for altera. They had to do their own thing | 07:39 |
olofk | I thought that FMC was a open standard (VITA-57), but that Xilinx choose to use it | 07:40 |
hansfbaier | but thanks goodness altera has free signaltap and quartus for cyclone V 110k LUT | 07:40 |
hansfbaier | olofk: Ah didn't know that | 07:40 |
hansfbaier | olofk: what is the javascript or1k simulator good for particulalrly (use cases) | 07:41 |
olofk | I think the open hardware guys at CERN (ohwr.org) was part of developing that standard. Not sure about this tohugh | 07:41 |
hansfbaier | FPGA Mezzanine Card is an ANSI standard | 07:42 |
hansfbaier | got it | 07:42 |
olofk | hansfbaier: 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 it | 07:43 |
hansfbaier | olofk: Hey look: http://www.kayainstruments.com/hsmc2fmc/ | 07:43 |
hansfbaier | I mean it's really cool, no doubt. | 07:44 |
hansfbaier | maybe linux driver devel for openrisc | 07:44 |
hansfbaier | but without HW? | 07:44 |
hansfbaier | oops wrong connector | 07:44 |
olofk | Yeah, something like that would be great | 07:45 |
olofk | That would allow Altera boards to use a lot of FMC peripherals | 07:45 |
olofk | It doesn't cover the whole pinout of the FMC standard, but probably enough for most cases | 07:46 |
hansfbaier | poke53281: that X demo w/ glxgears is really cool | 07:48 |
hansfbaier | 0.4 FPS though :) | 07:49 |
hansfbaier | olofk: nice business idea | 07:49 |
olofk | stekern, _franck_ : Thanks for the patches. They are all applied | 10:13 |
olofk | I 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 days | 10:15 |
olofk | But that only affects orpsoc, so if you have any patches for orpsoc-cores, just bring them on | 10:16 |
knz | hi all | 10:38 |
knz | I'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 |
poke53281 | hansfbaier. The FPS written in the terminal is wrong. You have to count yourself. And I get approximately 1FPS in Chrome | 17:41 |
ams | b | 18:09 |
stekern | knz: I've booked a room here: http://www.travelodge.co.uk/hotels/577/Cambridge-Newmarket-Road-hotel | 18:29 |
stekern | I gave up on the yocto stuff and just wiped the rootfs sdcard and installed linaro ubuntu instead... | 20:04 |
stekern | let's see if we can build some or1k toolchains on that now then | 20:05 |
stekern | I at least need binutils to hack up some elf-loading straight into FPGA DDR3 | 20: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!