nvidia machdep.c patch still useful ?

Matthew Dillon dillon at apollo.backplane.com
Fri Apr 2 10:22:27 PST 2004


:> It doesn't look too well thought out, does it ;)
:>
:> >     NVidia is that they are using %gs in the kernel and we aren't
:> >     saving/restoring it.
:> >
:> >     I guess we should just start doing that and to hell with the extra
:> >     few nanoseconds of switching overhead.
:>
:> Seems like the price isn't that high :)   Are all the changes localized
:> to machdep.c ?
:
:
:Looks like /usr/src/sys/i386/include/frame.h ...
:
:I suppose I add gs to all of those, then look to see who's doing saves
:and restores and patch those too. Would that mean also mean that I could
:also get rid of the load_gs() bits that exist here and there ?

    I looked at it some more and I think the FBsd signal handler code 
    is what is broken.  And I mispoke.. this is user level %gs use, not
    kernel level.  Our signal handler should not be resetting it.  5.x's
    signal handler doesn't, so neither should we.

    But 5.x's signal handler is resetting %fs, and I think we probably need
    to leave that part of it in.  Can you test with just the load_gs()
    removed (leaving the tf_fs = _udatasel intact) ?  It looks like our
    switch code already handles %gs properly, so I think all that needs
    to be done is to remove that load_gs().

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Kernel mailing list