Re: PPro/PII MTRR support in Linux 2.1.x

Richard Gooch (Richard.Gooch@atnf.CSIRO.AU)
Sun, 19 Jul 1998 08:42:48 +1000


Kendall Bennett writes:
> Richard Gooch <Richard.Gooch@atnf.CSIRO.AU> writes:
>
> He, a fellow Aussie!! How's life down under these days mate!

Politics follows that old Chinese curse: "may you live in interesting
times"...

> > > Anyway, how does the kernel find out how to program the MTRR
> > > registers for the framebuffer, or does is simply export services that
> > > user land code can call the enable MTRR write combining for the LFB?
> > > If it allows user land app (like our code!) to do this, what is the
> > > system call for this and is there any documentation on it?
> >
> > The kernel exports an interface that may be used by userspace
> > programmes (by frobbing /proc/mtrr) or by kernel modules calling
> > mtrr_*() functions. The MTRR interface doesn't decide what regions
> > should be set: that's someone else's job.
>
> Excellent - that is the way it should be. Now all I need to do is
> figure out how I can call these functions from our user space
> programs to correctly program the MTRR's. You mentioned there is some
> documentation on this; forgive my ignorance but where would I find
> this?

Well, have you tried '?' in the config option? It points the way...

> > FYI: XFree86 4.0 should automatically use this interface.
>
> Cool! I should take a look at the XFree86 sources to figure out how
> they do it.

Oops. Perhaps you misunderstood me. XFree86 4.0 *will have* this
support, *when it comes out*. The MTRR support is work in progress.

> > No problem. The MTRR support allows you to "overlay" an uncachable
> > region over a write-combining region. This was done specifically to
> > suppot the situation you describe. I should get around to updating the
> > documentation to make this clear. It's been on my ToDo list for months
> > now :-(
>
> Interesting. Does this provide a performance benefit over just not
> enabling write combining for the MMIO registers? How specifically do
> you go about doing this (I have written the code we use for MTRR
> support in Win95, but it is rather simple compared to what you have
> done ;-).

You can't have write-combining for the registers or else the order in
which you write registers is changed. This can lead to all kinds of
interesting effects (bus lockup being fairly typical). Remember that
write-combining will change the order of your writes.

Regards,

Richard....

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html