On Mon, 25 Jun 2007 18:43:55 +1300 (MSD), Valery V. Sedletski wrote:
Yes, I see:
L4_INLINE void fiasco_gdt_set(void *desc, unsigned int size, unsigned int entry_number_start, l4_threadid_t tid);
It is privileged architecture-specific syscall, as I understood. And what means "sanity checking" by the kernel? Does the kernel simply check that the descriptor defines a valid segment, or, there are some additional chacks. For example, must segments to be a non-overlapping, or not? (For 32-bit<-->16-bit thunking it is important to have a possibility for the segments to be overlapping -- the code can be at the same time to be in 16-bit segment and 32-bit segment).
In segment.h header, there is an implementation of this function, through using LLDT instruction. (and not through using a special syscall). So, LLDT instruction is allowed for usermode programs, and the kernel intercept lldt instruction. -- Probably when this instruction is used in usermode program, the TRAP occurs, and the kernel handles this trap, modifying the LDT or GDT. Is this right? (I searched an fiasco_gdt_set() function in the source code and I found that L4Linux uses this function. So, it is, probably, was created for demands of L4Linux development?)