-----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