Re:puzzle about about page fault in sigma0 space
Philipp Kupferschmied <[email protected]> Fri, 12 Sep 2008 17:28:42 +0200
| Newsgroups | gmane.comp.micro-kernel.l4.l4ka.general |
|---|---|
| Message-ID | <[email protected]> |
> Then , what about the first problem? > When accessing a virt address below 256M in sigma0 space, and a page fault > occured.Then the page fault process will make phys : virt (1 : 1) mapping > through map_sigma0() funtion. > Then it can access the phys address which is below 256M ? But these low 256M > addresses is kernel used. And shouldn't be accessed by user thread directly. > Or else the kernel data will be distroyed . If I'm not mistaken, the kernel will indeed map the corresponding physical page 1:1 to sigma0 in case of a page fault in sigma0's address space (apart from page faults within the kernel area, i.e. above 3 GB). However, sigma0 will not give out memory marked as reserved (for kernel use) to user-level threads. Consequently, user-level threads cannot harm kernel integrity, but sigma0 theoretically could. However, sigma0 is an essential part of the system and closely related to the kernel, so it must be trusted anyway. By the way: The kernel doesn't use the first 256 MB completely, but only a subset of configurable size (the default for IA32 is 16 MB, afaik). This default can be changed by passing the kmem=SIZE argument to kickstart (e.g. in grub's menu.lst). Only the configured amount of kernel memory is marked as reserved, the remaining memory (even below 256MB) can be handed out to user-level threads by sigma0. Someone may correct me if I'm wrong with this ;-) Cheers, Philipp