MTRR problems, some observations and possible info..

[email protected] Mon, 9 Jun 2008 21:09:17 +0200 (CEST)
Newsgroups gmane.os.openbeos.kernel.devel
Message-ID <[email protected]>
Hi there,

Since the nvidia driver seemed to exhibit MTRR related trouble, and since
I am testing my old VGAVideooutputNode under Haiku, I became a bit more
aware and focused on the MTRR stuff.

Here are my findings and opinion:
-It is valid to have (partial) overlapping MTR mapped regions. You can
find that on Wikipedia.
-It is valid to have overlapping MTR regions, and it makes sense to me as
well: for instance, Haiku's kernel (apparantly) maps the framebuffer of
the primary gfx card using MTR. This is done so the VESA drive can profit
from that I assume. Well, guess what: Haiku seems to think it's prudent to
keep that VESA driver (and the mapping) in place, even if for instance a
nVidia gfx driver is loaded and run. Which, in turn, maps the same (or
more) region once again.
(Of course I think the VESA driver should not be loaded if a accelerated
driver is loaded for the same hardware.. One driver per hardware instance
is my opinion!)

>From my observations it seems beyond doubt that if some driver/system
component wants to unmap it's mapped memory, the system's kernel unmaps
_ALL_ regions. Wow, that is a mistake since another driver is using the
second mapped memory... Which is gone now.

This becomes very interesting at the point where I run the VGAdevicevideo
Node: restarting the Media via mediaprefs unloads and reloads the gfx
driver(s) used by the node. Unfortunately, on my setup, I am using a
secondary gfx card for the desktop.
This means that the kernel maps the framebuffer for the primary card which
is also controlled by the node. I get (of course) a very faithfull panic
situation here since the kernel finds it's VESA memory unmapped.

As far as I can see the problem sits in vm.cpp? _user_unmap_memory(*
adress, size) calls in turn unmap_adress_range().

The comment on top of that second routine states all ranges in that area
are unmapped.

Here my knowledge ends.

Can someone fix the MTRR problems with this info? If yes, then I'd love to
see it working correctly... :-)

Thanks in advance!

Rudolf.






-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php