Re: question on sparc64 switch_to macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Chris Torek <chris.torek@xxxxxxxxxxxxx>
Date: Sat, 14 Mar 2009 12:53:52 -0600

> (PS: I have not thought nearly enough about this, but: in the
> ultrasparc code I did in another lifetime, I did not bother fiddling
> %cwp in the task-switch code, because we know the register windows
> are empty both before and after, so %cwp does not really matter:
> we are going to fault in all the "above" windows as usual, and in
> that system, nothing ever let you peek at the %cwp value.  It may
> be possible to do the same in the linux code.  In which case the
> switch code has many more registers available to it, plus this
> saves you one whole "wrpr" instruction. :-) Something for those
> better-versed than I to consider, anyway.)

Oh, CWP _does_ matter.

You have to specifically use the saved CWP in the task switch because
when we later get to the trap return into userspace we'll restore the
%tstate register from the trap stack and that has a very specific CWP
encoded into it.  So it all has to line up properly.

I suppose we could mask out the CWP in the pt_regs we restore in trap
return, but that seems like more work than the CWP writes here :-)

I'll address the rest of your email soon.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux