Changeset 635 for trunk/kernel/mm/vmm.h
- Timestamp:
- Jun 26, 2019, 11:42:37 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/vmm.h
r632 r635 52 52 * - The allocator checks that the requested slot has not been already allocated, and set the 53 53 * corresponding bit in the bitmap. 54 * - The de-allocator functionreset the corresponding bit in the bitmap.54 * - The de-allocator reset the corresponding bit in the bitmap. 55 55 ********************************************************************************************/ 56 56 … … 112 112 typedef struct vmm_s 113 113 { 114 remote_rwlock_t vsl_lock; /*! lock protecting the local VSL */ 115 xlist_entry_t vsegs_root; /*! Virtual Segment List (complete in reference) */ 116 uint32_t vsegs_nr; /*! total number of local vsegs */ 117 118 gpt_t gpt; /*! Generic Page Table (complete in reference) */ 119 120 stack_mgr_t stack_mgr; /*! embedded STACK vsegs allocator */ 121 mmap_mgr_t mmap_mgr; /*! embedded MMAP vsegs allocator */ 122 123 uint32_t pgfault_nr; /*! page fault counter (instrumentation) */ 124 125 vpn_t args_vpn_base; /*! args vseg first page */ 126 vpn_t envs_vpn_base; /*! envs vseg first page */ 127 vpn_t code_vpn_base; /*! code vseg first page */ 128 vpn_t data_vpn_base; /*! data vseg first page */ 129 vpn_t heap_vpn_base; /*! heap zone first page */ 130 131 intptr_t entry_point; /*! main thread entry point */ 114 remote_rwlock_t vsl_lock; /*! lock protecting the local VSL */ 115 xlist_entry_t vsegs_root; /*! Virtual Segment List (complete in reference) */ 116 uint32_t vsegs_nr; /*! total number of local vsegs */ 117 118 gpt_t gpt; /*! Generic Page Table (complete in reference) */ 119 120 stack_mgr_t stack_mgr; /*! embedded STACK vsegs allocator */ 121 mmap_mgr_t mmap_mgr; /*! embedded MMAP vsegs allocator */ 122 123 uint32_t false_pgfault_nr; /*! false page fault counter (for all threads) */ 124 uint32_t local_pgfault_nr; /*! false page fault counter (for all threads) */ 125 uint32_t global_pgfault_nr; /*! false page fault counter (for all threads) */ 126 uint32_t false_pgfault_cost; /*! cumulated cost (for all threads) */ 127 uint32_t local_pgfault_cost; /*! cumulated cost (for all threads) */ 128 uint32_t global_pgfault_cost; /*! cumulated cost (for all threads) */ 129 130 vpn_t args_vpn_base; /*! args vseg first page */ 131 vpn_t envs_vpn_base; /*! envs vseg first page */ 132 vpn_t code_vpn_base; /*! code vseg first page */ 133 vpn_t data_vpn_base; /*! data vseg first page */ 134 vpn_t heap_vpn_base; /*! heap zone first page */ 135 136 intptr_t entry_point; /*! main thread entry point */ 132 137 } 133 138 vmm_t; 134 139 135 140 /********************************************************************************************* 136 * This function mkkes a partial initialisation of the VMM attached to an user process. 137 * The GPT must have been previously created, with the hal_gpt_create() function. 138 * - It registers "args", "envs" vsegs in the VSL. 139 * - It initializes the STACK and MMAP allocators. 140 * Note: 141 * This function makes only a partial initialisation of the VMM attached to an user 142 * process: It intializes the STACK and MMAP allocators, and the VSL lock. 143 * - The GPT has been previously created, with the hal_gpt_create() function. 144 * - The "kernel" vsegs are previously registered, by the hal_vmm_kernel_update() function. 141 145 * - The "code" and "data" vsegs are registered by the elf_load_process() function. 142 146 * - The "stack" vsegs are dynamically registered by the thread_user_create() function. … … 165 169 * This function is called by the process_make_fork() function. It partially copies 166 170 * the content of a remote parent process VMM to the local child process VMM: 171 * - The KERNEL vsegs required by the architecture must have been previously 172 * created in the child VMM, using the hal_vmm_kernel_update() function. 167 173 * - The DATA, ANON, REMOTE vsegs registered in the parent VSL are registered in the 168 * child VSL. All valid PTEs in parent GPT are copied to the child GPT, but the 169 * WRITABLE flag is reset and the COW flag is set. 174 * child VSL. All valid PTEs in parent GPT are copied to the child GPT. 175 * The WRITABLE and COW flags are not modified, as it will be done later for those 176 * shared pages by the vmm_set_cow() function. 170 177 * - The CODE vsegs registered in the parent VSL are registered in the child VSL, but the 171 178 * GPT entries are not copied in the child GPT, and will be dynamically updated from … … 173 180 * - The FILE vsegs registered in the parent VSL are registered in the child VSL, and all 174 181 * valid GPT entries in parent GPT are copied to the child GPT. The COW flag is not set. 175 * - No STACK vseg is copied from parent VMM to child VMM, because the child stack vseg 176 * must be copied later from the cluster containing the user thread requesting the fork(). 177 * - The KERNEL vsegs required by the target architecture are re-created in the child 178 * VMM, from the local kernel process VMM, using the hal_vmm_kernel_update() function. 182 * - No STACK vseg is copied from parent VMM to child VMM: the child stack vseg is copied 183 * later from the cluster containing the user thread requesting the fork(). 179 184 ********************************************************************************************* 180 185 * @ child_process : local pointer on local child process descriptor. … … 203 208 * This function modifies one GPT entry identified by the <process> and <vpn> arguments 204 209 * in all clusters containing a process copy. It is used to maintain coherence in GPT 205 * copies, using the list of copies stored in the owner process, andremote_write accesses.210 * copies, using remote_write accesses. 206 211 * It must be called by a thread running in the process owner cluster. 207 212 * Use the RPC_VMM_GLOBAL_UPDATE_PTE if required. … … 248 253 * - For the FILE, ANON, & REMOTE types, it does not use the <base> and <size> arguments, 249 254 * but uses the specific MMAP virtual memory allocator. 250 * - For the STACK type, it does not use the < size> argument, and the <base> argument251 * defines the user thread LTID used bythe specific STACK virtual memory allocator.252 * It checks collision with allpre-existing vsegs.255 * - For the STACK type, it does not use the <base> and <size> arguments, but uses the 256 * and the <base> argument the specific STACK virtual memory allocator. 257 * It checks collision with pre-existing vsegs. 253 258 * To comply with the "on-demand" paging policy, this function does NOT modify the GPT, 254 259 * and does not allocate physical memory for vseg data.
Note: See TracChangeset
for help on using the changeset viewer.