[Embeddedxen-devel] Page tables allocation in the guest OS
Brought to you by:
rossierd
|
From: ROSSIER D. <Dan...@he...> - 2009-05-21 08:03:23
|
Hi Folks, There is a major difference between Samsung's port and EmbeddedXEN (close to x86 XEN tree) with respect to the way how page tables are allocated in miniOS (and probably with other guest OS): in Samsung's port, page tables are completely allocated during the domain construction in the hypervisor (taking into account the size of the guest OS). In their case, page tables are not built in bootstrap of miniOS. In the opposite, EmbeddedXEN is more aligned with the "official" method: only the minimal pages are allocated in the guest OS (remember the code in embeddedXEN in already allocated at the very beginning of hypervisor bootstrap) and thus, miniOS will perform the page table allocation during the bootstrap, based on the number of mfn which are passed via the start_info structure. Further explanations about miniOS bootstrap code can be found here: www.cs.uic.edu/~spopuri/minios.html Another comment: in the include files, constants with prefix like L1_* or L2_* usually refer to some constants about the different level of page tables. L1 does NOT refer to the 1st-level page table (PGD or TTB for ARM), but the "last-level" (2nd) page table ("PTE" page table). For example, the constants below are defined in include/minos/arm/arch_mm.h //#define L1_PAGETABLE_SHIFT 12 //#define L2_PAGETABLE_SHIFT 22 #define L1_PAGETABLE_SHIFT 12 #define L2_PAGETABLE_SHIFT 20 //#define L1_PAGETABLE_ENTRIES 1024 //#define L2_PAGETABLE_ENTRIES 1024 #define L1_PAGETABLE_ENTRIES 256 /* Coarse page table */ #define L2_PAGETABLE_ENTRIES 4096 /* TTB */ For ARM, the number of entries in the 1st level page table (L2_PAGETABLE_ENTRIES) is now 4096, since we consider only coarse page table entries for our 4KB pages. Consequently, there are 4 page frames which are dedicated to the 1st-level page table, and ARM enables to have 4 page tables per frame (aligned to 1KB) since there are only 256 entries in 2nd-level page table. Daniel |