This is a naive, simple question -- I looked in the reference manual and the answer did not jump out at me.
When a process is preempted, where are its registers stored? Are the stored in the UTCB, or are they stored in some data structure that is only accessible to the kernel?
Thanks
shap
On Thu Feb 23, 2006 at 17:15:24 -0500, Jonathan S. Shapiro wrote:
This is a naive, simple question -- I looked in the reference manual and the answer did not jump out at me.
When a process is preempted, where are its registers stored? Are the stored in the UTCB, or are they stored in some data structure that is only accessible to the kernel?
They are stored in the thread's TCB, which is kernel private data.
Cheers,
Benno
On Fri, 2006-02-24 at 09:18 +1100, Benno wrote:
When a process is preempted, where are its registers stored? Are the stored in the UTCB, or are they stored in some data structure that is only accessible to the kernel?
They are stored in the thread's TCB, which is kernel private data.
So, in particular, the saved registers are not accessable to normal load and store instructions that might occur on a second processor. Correct?
Thanks!
shap
On Thu Feb 23, 2006 at 17:33:43 -0500, Jonathan S. Shapiro wrote:
On Fri, 2006-02-24 at 09:18 +1100, Benno wrote:
When a process is preempted, where are its registers stored? Are the stored in the UTCB, or are they stored in some data structure that is only accessible to the kernel?
They are stored in the thread's TCB, which is kernel private data.
So, in particular, the saved registers are not accessable to normal load and store instructions that might occur on a second processor. Correct?
Correct. (Of course there could be the potential to do some neat things if they *were* available, but that raises a whole can of worms, and unfortunately I don't have time to go over that design discussion again ;)
Cheers,
Benno
On Fri, 2006-02-24 at 09:35 +1100, Benno wrote:
Correct. (Of course there could be the potential to do some neat things if they *were* available, but that raises a whole can of worms, and unfortunately I don't have time to go over that design discussion again ;)
Thanks. I'm well aware of the challenges. Somehow I had become confused about what L4 was doing. Thanks for the clarification.
ALL: That answers my question. Thanks also to Volkmar.
shap
-----Original Message----- From: Jonathan S. Shapiro Sent: Thursday, February 23, 2006 5:34 PM To: Benno Cc: l4-hackers@os.inf.tu-dresden.de Subject: Re: Question about UTCB
On Fri, 2006-02-24 at 09:18 +1100, Benno wrote:
When a process is preempted, where are its registers stored? Are the stored in the UTCB, or are they stored in some data structure that is only accessible to the kernel?
They are stored in the thread's TCB, which is kernel private data.
So, in particular, the saved registers are not accessable to normal load and store instructions that might occur on a second processor. Correct?
Actually, it depends. At this point most implementations use the kernel stack to store the user-level registers. However, this is up to the implementation and not architecturally defined. Storing it in the UTCBs has some important advantages.
However, for the SMP case registers should not be accessed on a remote processor and typically there is no reason to do so. Threads are pinned to a particular CPU and migrated by application threads. The synchronization model in the kernel heavily depends on that assumption.
- Volkmar
l4-hackers@os.inf.tu-dresden.de