Skip to contentSkip to conversation

Access to add a r300_reg database to rules-ng?

DISCUSSION Phillip Ezolt 3 participants 8 messages Jun 20, 2007 – Jun 28, 2007 7 messages not in the archive

lore
Share & tools
lore
#0 lore raw

Hi,
I'm working with Oliver McFadden to create a rules-ng database for
the Radeon R300 (and beyond..) I've taken some of the work that he had done, and have been slowly adding more Radeon registers. I also created a new 'test-r300' app based on the one included in the static-db to test the decode of radeon registers.

I would like this to be under version control, and the rules-ng cvs tree seems the best place to put it.

If this is cool with the nouveau developers, could I have commit access so that I can submit it, and update it as I add more stuff?

(I can send you my changes as a patch if you would rather I did that..)

Cheers,
--Phil

A message that is not in the archive (sent off-list or not yet received): 62cc563b0706200723k117433d2w9a28e35aa3bc2f16-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#2 lore raw
Quoted 6 lines · On Wed, 20 Jun 2007 10:23:54 -0400 "Phillip Ezolt"…

Hi,
I'm working with Oliver McFadden to create a rules-ng database for
the Radeon R300 (and beyond..) I've taken some of the work that he had done, and have been slowly adding more Radeon registers. I also created a new 'test-r300' app based on the one included in the static-db to test the decode of radeon registers.

Cool :-)

Quoted 2 lines

I would like this to be under version control, and the rules-ng cvs tree seems the best place to put it.

Yeah, I think we can manage that. The directory structure so far has no project specific directories. I have XML databases in one dir, python scripts in another, and staticdb stuff in third dir.

Is it only the test app or would you put also the radeon XML files in Rules-ng CVS?
Do you think they could all live together mixed with Nouveau files? Maybe we could even use partially the same XML files, e.g. the standard VGA registers, that are accessed via indexed registers?
Are those not the same for both radeon and Nouveau?
I also assume that at some point you want (if not already done so) fork some of the tools or python scripts to do the style your project uses.

Quoted 2 lines

If this is cool with the nouveau developers, could I have commit access so that I can submit it, and update it as I add more stuff?

I do not have rights to give that. Marcheu?
It is ok with me.

Quoted 2 lines

(I can send you my changes as a patch if you would rather I did that..)

Whatever you add yourself new files, play as you wish. If you need to modify the common tools or something else, I'd like to know in advance.

Signature · 2 lines
Pekka "PQ" Paalanen
http://www.iki.fi/pq/

A message that is not in the archive (sent off-list or not yet received): 20070621001759.765a79a4-cxYvVS3buNOdIgDiPM52R8c4bpwCjbIv@public.gmane.org

#4 lore raw

Pekka,

Quoted 15 lines · Pekka Paalanen
Quoted 6 lines · On Wed, 20 Jun 2007 10:23:54 -0400 "Phillip Ezolt"…

Hi,
I'm working with Oliver McFadden to create a rules-ng database for
the Radeon R300 (and beyond..) I've taken some of the work that he had done, and have been slowly adding more Radeon registers. I also created a new 'test-r300' app based on the one included in the static-db to test the decode of radeon registers.

Cool :-)

Quoted 2 lines

I would like this to be under version control, and the rules-ng cvs tree seems the best place to put it.

Quoted 6 lines

Yeah, I think we can manage that. The directory structure so far has no project specific directories. I have XML databases in one dir, python scripts in another, and staticdb stuff in third dir.

Is it only the test app or would you put also the radeon XML files in Rules-ng CVS?

I would like to checkin both the r300-regs.xml file, and my test app. I also modified the makefile to generate a shared library (like nvidia has) to hook up with kmmio.

Quoted 1 line

Do you think they could all live together mixed with Nouveau files?

Definitely.

Quoted 3 lines

Maybe we could even use partially the same XML files, e.g. the standard VGA registers, that are accessed via indexed registers?
Are those not the same for both radeon and Nouveau?

I think so, but I really haven't dabbled in the vga portion of the card. For now, I do link in the vga database with the R300 database.

Quoted 2 lines

I also assume that at some point you want (if not already done so) fork some of the tools or python scripts to do the style your project uses.

That may happen in the future. Right now, I am just trying to dump as many of the radeon registers in the r300-regs.xml file as possible.

You guys have this nice mechanism to handle the variants, etc, but right now, I'm just putting all of the stuff in a single file for the RS480. This will probably be restructured later to be more supportive of all of the different radeon variants. However, I just need to start somewhere. There are hundreds (?) of radeon registers, and for the .xml file to be useful, I need to start adding them.

I think that ultimately Oliver wants to use this to generate the header files, but right now, I just want something that I can use for reverse engineering. (and playing with kmmio) For this, it is ok that things are incomplete. In the future, when we're actually building things with the headers generated from this, the r300-regs.xml file will have to be completely filled in.

Quoted 6 lines
Quoted 2 lines

If this is cool with the nouveau developers, could I have commit access so that I can submit it, and update it as I add more stuff?

I do not have rights to give that. Marcheu?
It is ok with me.

Thanks!

Quoted 6 lines
Quoted 2 lines

(I can send you my changes as a patch if you would rather I did that..)

Whatever you add yourself new files, play as you wish. If you need to modify the common tools or something else, I'd like to know in advance.

Ok. I just need to add ~4 files, and modify the makefile in staticdb so that they are built.

I shouldn't have to modify anything else. If I do, I'll definitely talk to you.

There will probably be a flurry of checkins as I add new registers to the xml file, but
I don't expect to change any of the core stuff.

Quoted 3 lines

--
Pekka "PQ" Paalanen
http://www.iki.fi/pq/

Cheers & thanks,
--Phil

A message that is not in the archive (sent off-list or not yet received): 62cc563b0706201847l593f86acyde83b1aab74727d2-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#6 lore raw
Quoted 10 lines · On Wed, 20 Jun 2007 21:47:07 -0400 "Phillip Ezolt"…

Pekka,

On 6/20/07, Pekka Paalanen <[email protected]> wrote:

I would like to checkin both the r300-regs.xml file, and my test app. I also modified the makefile to generate a shared library (like nvidia has) to hook up with kmmio.

Quoted 1 line

Do you think they could all live together mixed with Nouveau files?

Quoted 8 lines

Definitely.

You guys have this nice mechanism to handle the variants, etc, but right now, I'm just putting all of the stuff in a single file for the RS480. This will probably be restructured later to be more supportive of all of the different radeon variants. However, I just need to start somewhere. There are hundreds (?) of radeon registers, and for the .xml file to be useful, I need to start adding them.

I tried to design the layout of the XML file to be quite free, creating groups and alike, but of course the file may get big. If it gets too big and it would be beneficial to add an include directive, we should think about it.

Quoted 6 lines

I think that ultimately Oliver wants to use this to generate the header files, but right now, I just want something that I can use for reverse engineering. (and playing with kmmio) For this, it is ok that things are incomplete. In the future, when we're actually building things with the headers generated from this, the r300-regs.xml file will have to be completely filled in.

Yes, the header file generation is a goal for Nouveau, too, but I have been doing other stuff.

Quoted 2 lines

Ok. I just need to add ~4 files, and modify the makefile in staticdb so that they are built.

Fire away! :-)

And a note about kmmio trace: I expect a redesign of the binary log format in the next weeks. The binary dumps are easier to handle automatically and the current format is just broken. Once the new format is in place, we can write new cool tools, and most importantly, share binary dumps without problems ;-)

Signature · 2 lines
Pekka "PQ" Paalanen
http://www.iki.fi/pq/

A message that is not in the archive (sent off-list or not yet received): 20070621155428.67c98e98-cxYvVS3buNOdIgDiPM52R8c4bpwCjbIv@public.gmane.org

#8 lore raw

Pekka,

Quoted 7 lines

And a note about kmmio trace: I expect a redesign of the binary log format in the next weeks. The binary dumps are easier to handle automatically and the current format is just broken. Once the new format is in place, we can write new cool tools, and most importantly, share binary dumps without problems ;-)

In your redesign of the binary dump format, could you add the ability to store multiple PCs per sample? (ie, so that I can do backtraces (4 frames deep?) ) rather than just a single PC?

About 3-4 months ago, I hacked some code for kmmio which would walk the stack and record the pc X frames above the current register access. Since I didn't figure out how to record multiple PCs per sample, I hardcoded how far up the stack I would walk, and did multiple runs (while changing the frame by recompiling) to get 3 frames deep.
(run 1 => current PC )
(run 2 => one frame up)
(run 3 => two frames up)
Etc.

I would then combine the runs by hand, and turn the addresses into frames by using '/proc/kallsyms'. It was very useful info, but tedious..

Since fglrx actually has useful symbols in the kernel module, I was able to determine the meaning of some of the register accesses by looking at the stack trace. (It wasn't enough to just look at the PC, since it was in some generic 'do_mmio' function... I needed the frame
above it.) I would like to do this again for some of the other
registers that I don't know the meaning of yet..

This might be useful for nvidia as well.

BTW. I can send you the patch if you want, but it is very i386 specific & (if I remember) it requires framepointers.

Quoted 4 lines

--
Pekka "PQ" Paalanen
http://www.iki.fi/pq/

Cheers,
--Phil

A message that is not in the archive (sent off-list or not yet received): 62cc563b0706271125j148a30f9mc2eba11cba14f1b3-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#10 lore raw

Re: kmmio dump log format

Quoted 5 lines · On Wed, 27 Jun 2007 14:25:58 -0400 "Phillip Ezolt"…

Pekka,

In your redesign of the binary dump format, could you add the ability to store multiple PCs per sample? (ie, so that I can do backtraces (4 frames deep?) ) rather than just a single PC?

The new format will be packet based, so it will be extendable. Yes, we can do this, I and Jeff just have to discuss how to do it exactly. And Jeff seems to be very busy nowadays.

Quoted 11 lines

About 3-4 months ago, I hacked some code for kmmio which would walk the stack and record the pc X frames above the current register access. Since I didn't figure out how to record multiple PCs per sample, I hardcoded how far up the stack I would walk, and did multiple runs (while changing the frame by recompiling) to get 3 frames deep.
(run 1 => current PC )
(run 2 => one frame up)
(run 3 => two frames up)
Etc.

Quoted 3 lines

I would then combine the runs by hand, and turn the addresses into frames by using '/proc/kallsyms'. It was very useful info, but tedious..

Ouch.

Quoted 6 lines

Since fglrx actually has useful symbols in the kernel module, I was able to determine the meaning of some of the register accesses by looking at the stack trace. (It wasn't enough to just look at the PC, since it was in some generic 'do_mmio' function... I needed the frame
above it.) I would like to do this again for some of the other
registers that I don't know the meaning of yet..

We can do it, I just hope you will not get any legal issues because of doing it. I do not think Nouveau would ever use PC/stack recording, it is a bit too deep into the gray area.

Quoted 2 lines

BTW. I can send you the patch if you want, but it is very i386 specific & (if I remember) it requires framepointers.

I would say that let's wait until the log format rework is done, because it will inflict changes also to the kernel side. And to be honest, I'd rather leave kernel stuff to other people. And my system is 64-bit.

Signature · 2 lines
Pekka "PQ" Paalanen
http://www.iki.fi/pq/

A message that is not in the archive (sent off-list or not yet received): 20070628171027.16a619bc-cxYvVS3buNOdIgDiPM52R8c4bpwCjbIv@public.gmane.org

#12 lore raw

Re: kmmio dump log format

Pekka,

Quoted 5 lines · Pekka Paalanen
Quoted 2 lines · On Wed, 27 Jun 2007 14:25:58 -0400 "Phillip Ezolt"…

Pekka,

Quoted 8 lines
Quoted 3 lines

In your redesign of the binary dump format, could you add the ability to store multiple PCs per sample? (ie, so that I can do backtraces (4 frames deep?) ) rather than just a single PC?

The new format will be packet based, so it will be extendable. Yes, we can do this, I and Jeff just have to discuss how to do it exactly. And Jeff seems to be very busy nowadays.

That's great. I know how the "very busy" thing goes. I just wanted to chip in my request if you were going to rework it anyway.

Quoted 8 lines
Quoted 7 lines

Since fglrx actually has useful symbols in the kernel module, I was able to determine the meaning of some of the register accesses by looking at the stack trace. (It wasn't enough to just look at the PC, since it was in some generic 'do_mmio' function... I needed the frame
above it.) I would like to do this again for some of the other
registers that I don't know the meaning of yet..

Quoted 4 lines

We can do it, I just hope you will not get any legal issues because of doing it. I do not think Nouveau would ever use PC/stack recording, it is a bit too deep into the gray area.

Well, this is the same information that would be printed during a kernel oops, so it can't be THAT secretive. Also, they export the symbols+address, and there is no disassembly involved.

Anyway, to each his own. ;-)

Quoted 8 lines
Quoted 2 lines

BTW. I can send you the patch if you want, but it is very i386 specific & (if I remember) it requires framepointers.

I would say that let's wait until the log format rework is done, because it will inflict changes also to the kernel side. And to be honest, I'd rather leave kernel stuff to other people. And my system is 64-bit.

Alright. Cool. I'll just sit tight, then.

Quoted 4 lines

--
Pekka "PQ" Paalanen
http://www.iki.fi/pq/

Cheers,
--Phil

A message that is not in the archive (sent off-list or not yet received): 62cc563b0706281045w474580f6v8f9f8685ee415cab-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#14 lore raw

Re: kmmio dump log format

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

In your redesign of the binary dump format, could you add the ability to store multiple PCs per sample? (ie, so that I can do backtraces (4 frames deep?) ) rather than just a single PC?

In the current proposal for the new packet based format, we have a single PC (which we don't use right now). we could define a read/write packet
as: address + value + r/w mode + (optionally) any number of PC's. the number of PC's is indicated by the packet length in the packet header. This we save a bit when we don't need the PC and support any number of PC's at the same time.

Tools that don't make use of the PC's can simply skip them.

(there are also pending issues, like whether we need to support 64 bit values)

jaap.