IRC logs for #openrisc Wednesday, 2013-10-02

--- Log opened Wed Oct 02 00:00:21 2013
poke53282Strange the pid is definitely 17. It does not even start with a pid of 1.00:03
poke53282It happens definitely in the init routine of eglibc00:16
poke53282blueCmd: I get this error in both static or shared compiled binaries. It does not depend on busybox. A simple "hello world" executable is enough.00:43
poke53282blueCmd: For me it looks like the or1k atomic syscall is executed with an OR1K_ATOMIC_CMPXCHG. But this is not implemented in the kernel. The kernel executes always a XCHG instead.01:29
poke53282And you define the OR1K_ATOMIC_XCHG with a different number.01:54
poke53282uclibc: #define OR1K_ATOMIC_XCHG 101:54
poke53282eglibc: #define OR1K_ATOMIC_XCHG 301:54
poke53282eglibc: #define OR1K_ATOMIC_SWAP 102:06
poke53282Ok, what is the difference between XCHG and SWAP?02:07
poke53282blueCmd: Let me guess. You have used only QEMU to test eglibc? :)02:15
poke53282Because there it works. Looks like QEMU is not correctly analyzing for page faults.02:16
poke53282That explains it.03:12
poke53282And another error in QEMU. Who finds it :)03:17
stekernit should probably be (rw == 0) not (rw & 0) ;)03:20
poke53282!(rw & 1)   is better because rw could be also 2. But in the pastie it was not evident, so your solution is fine.03:47
poke53282So, this evening I found 3.5-4 bugs. A fifth one with which could enable you to get root rights as user. Or to crash the machine.03:50
stekernpoke53282: qemu probably haven't been used as much as it should, and some of the bugs are obviously "reversed". i.e. they don't manifest themselves on qemu, only when you rely on qemu's behaviour04:51
stekernbut nice job finding them nevertheless, will you send patches for them to upstream qemu?04:51
poke53282Yes, almost finished. I am sabotaging blueCmd eglibc project with this patch ;) . eglibc will no longer work for him.04:53
stekernthat's "good" ;)04:55
olofk_franck_: Sorry for the late response. Just run orpsoc sim --simulator=modelsim to override the default simulator05:00
olofkIt doesn't really matter what is in the core files now, but I want to add functionality to the coremanager so that I can see if any core in a system will fail to run with a certain simulator warn the user if that happens05:01
stekernolofk: did you see my privmsg or are you just ignoring it? ;)05:09
olofkstekern: Sorry. Running a webchat client, and firefox rebooted 30 minutes ago05:10
poke53282stekern: Message sent to QEMU mailing list05:13
stekernpoke53282: great05:14
stekernspeaking about bugs, this arm-linux-gnueabihf-4.7 toolchain is behaving oddly...05:53
stekernI'm still trying to get the opencores vga/lcd core to work as a framebuffer device for the ARM on sockit, it works but if I use 16-bit mode the halfwords are swapped (due to endian difference)05:54
stekernif I try to swap them the kernel hangs completely05:55
stekernor rather, if I enable the kernel option that the framebuffer endianess differ, it hangs05:56
stekernso I'm trying to debug what it actually writes to the cores registers05:57
stekernbut it always claims that the data is zero in my debug printk, but I *know* it's not06:00
stekernso I did this:
stekernand it outputs this:06:01
stekernSJK DEBUG: data != 0 (data = 5f17027f)06:01
stekernSJK DEBUG: base = c08c6000, offset = 8, data = 006:01
stekernam I missing some optimisation that the compiler is allowed to do in that case, or is it just a plain bug?06:02
stekernheh, Jia doesn't seem to see the obviousness in that bug...06:04
stekerns/in that/in that qemu/06:04
stekernthe other part was more interesting, I can't remember seeing something like that in the arch spec06:05
stekernbetter go check06:06
stekernit would strike me as odd anyways06:08
stekernah, he probably refers to section 16.3.4, but that doesn't mean what he thinks it means06:11
poke53282Arghh, I wish I could write patches that are immediately accepted  and would not lead always to long discussions. And again one hour lost.06:41
stekernhaha =)06:43
stekernFWIW, I thought it was obvious enough, I would just have applied it06:43
blueCmdpoke53282: i have a kernel patch that adds those atomic operations08:48
blueCmdpoke53282: i submitted it for upstream in the mailinglist a while ago but i never got around to fix the feedback08:49
blueCmdpoke53282: the atomic operations are used for pthreads, so some things will work, other will crash horribly, as you found out08:49
blueCmdpoke53282: also, I would recommend that you look specifically on glibc in the first hand, since that is what's going to be upstreamed08:50
blueCmdbut it's your choice :P08:51
blueCmdpoke53282: you also need to incorporate that08:57
blueCmdI had a patched kernel tree, but I had to wipe that disk08:57
stekernjuliusb: did you get all the de0 nano troubles sorted out?09:15
stekernor only when you disable instruction cache?09:16
stekernand the answer to your first question is: brief09:18
juliusbstekern: I got things working, but had to keep icache disabled13:13
juliusbanything involving timer interrupts didn't work with icache enabled13:14
juliusbso a pre-cooked Linux image would be cool to have13:14
juliusbsomething we can just microwave on the day and dump into the RAM and boot would be great :)13:15
stekernjuliusb: (icache disabled) that's not acceptable13:59
stekernI'll take a look13:59
stekerndo you have a program for me to test where it fails?14:00
stekernI'll try out some linux image at the same time14:00
_franck_blueCmd: what was the status of your work on gdb last time you played with it ?14:06
_franck_did you get gdbserver and a native gdb working ?14:07
blueCmd_franck_: sort of. I got gdbserver working in that it could pause the program but not resume it IIRC14:08
_franck_ok, I want to prepare an up-to-date status of our openrisc gdb work for the conference14:09
juliusbstekern: sw at home, but basically using the simple newlib stuff to set up a timer and make it go off, will cause it to lock up eventually14:20
juliusbi was just flashing LEDs and writing stuff to the UART14:21
stekernbah... xorg doesn't honour the endian flag of the fb14:25
stekernjuliusb: ok, I'll try that, but probably later in the evening, so you'll still have a chance to give me the sw ;)14:26
juliusb:) yep I can certainly do that14:48
stekernjuliusb: I can reproduce here, but the interesting thing is that I can reproduce it in mor1kx-dev-env in verilated simulation as well...15:38
stekernso either I'm doing something wrong or this should be easy to figure out15:39
poke53282stekern: About the endian flag. I am not sure what you really tried but I patched the xorg-server which could prevent the correct endianess16:01
stekernpoke53282: this is on the arm, I'm connecting that to the wishbone bus16:23
poke53282blueCmd: Thanks for the information. So the kernel needs to be patched. The second patch seems one seems to be outdated because process.c changed significantly. The first one could be corrected in a few hours.16:56
poke53282I can also switch to glibc. No problem.16:58
blueCmdpoke53282: yes, as I said, I did port the second patch to the newest kernel (it's simple when you know what it is supposed to do, might not be if you haven't read so much TLS docs that you're mumbling the spec in the sleep)17:17
blueCmdbut the patch was destroyed sadly17:17
stekernpoke53282: (xorg-server patch) that's exactly what I would need to do on the arm as well to make it work correctly17:26
poke53282blueCmd: I don't have an idea about TLS and how it works. Have never read the docs. But it looks like you can redo this patch easily. Only two lines of code.17:34
stekernjuliusb: found the problem18:09
stekernthat should fix it18:11
stekernrunning the step tests to check that it doesn't break those and resynthesizing to check that it works on the board too18:12
stekernit works on the board too18:18
mor1kx[mor1kx] skristiansson pushed 1 new commit to master:
mor1kxmor1kx/master d67f967 Stefan Kristiansson: cappuccino/ctrl: only signal stepped_into_delay_slot when stepping...18:45
mor1kx[mor1kx] skristiansson pushed 1 new commit to mor1kx_v1:
mor1kxmor1kx/mor1kx_v1 ed4baff Stefan Kristiansson: cappuccino/ctrl: only signal stepped_into_delay_slot when stepping...18:46
mor1kx[mor1kx] skristiansson pushed 1 new commit to mor1kx_v1:
mor1kxmor1kx/mor1kx_v1 143d9b8 Stefan Kristiansson: mor1kx v1.218:56
juliusbstekern: oh wow! nice19:33
juliusbstekern: that's odd, how come that fixes it?19:35
stekernbecause that signal otherwise get set whenever there is a delay slot19:36
juliusboh right!19:36
stekernand when stepping npc is set to the branch destination19:37
stekernand in or1k-support npc is used to get the exception vector19:37
juliusbok i'm convinced now :)19:38
stekernI think there is a bugfix missing from or1k-support in svn too19:38
stekernunrelated to this, but I noticed when I started to look around that stuff19:39
stekerninterrupt handlers don't work without that fix19:39
stekernbut the websvn doesn't work properly so I haven't confirmed that it is missing19:39
juliusbbut we've got it on the git branch?19:41
stekernno, the other way around19:41
stekernit is in svn, but I don't think it has made it into git19:41
juliusboh right19:41
juliusbI have an update I want to make to the newlib libs, too. Just putting a weak function in the timer C code so the user can install an arbitrary function which gets executed whenever the timer exception fires19:42
juliusbI can hack around it for the workshop (by installing a custom handler in the C code) but it'd be nice to make it neat and documented19:43
stekernthat sounds reasonable19:43
stekernthe weak board globals have became handy many times for me19:43
juliusbOK, image built, time to test your fix :)19:43
stekernI hardly use the mboard= anymore19:44
juliusbstekern: looking good ;)19:45
stekernin all my baremetal "projects" I've got a board_conf.c file19:45
juliusboverrides the default one of or1ksim?19:47
juliusboverrides the symbols, I mean, in or1ksim.S/a ?19:47
juliusboh handy19:47
stekernit's mostly the clock freq I change19:48
_franck_I ran the gdb testsuite today, not that bad:
stekern_franck_: I'm about to push an newly synced version of or1k-src, so it's good that we have a reference now19:54
juliusbstekern: any updates to newlib/libgloss in that?19:54
stekernI don't think so19:58
stekernI can check19:58
juliusbok, just wasn't sure if you were referring to the fix which is in SVN but not git (potentially)?19:58
stekernah, no, this is "just" a sync with upstream20:09
stekernbut it was good that I checked newlib, I spotted a mismerge now20:09
stekernok, now it's done20:35
stekernjuliusb: the fixes are missing20:48
juliusbhmmm ok21:17
juliusbwill you bring them across?21:19
juliusbstekern: I don't see newlib in the OpenCores SVN repo? expanding gnu-dev/or1k-src gives me nothing in the web interface :(21:38
juliusboh it's under gnu-stable...21:41
stekernjuliusb: this is the change, I intend to pish it.21:45
stekernRight now I'm heading for bed thuogh21:45
juliusbah great, thanks, I was just wrestling with SVN to try and get the diff myself as the web svn diff thing ain't no workin' none21:45
juliusbso, adding exception handlers isn't working until this guy goes on there?21:46
juliusboh interrupt handling21:48
--- Log closed Thu Oct 03 00:00:23 2013

Generated by 2.15.2 by Marius Gedminas - find it at!