x86: MMU: Configure page tables entries for memory domain in swap.
During swap the required page tables are configured. The outgoing thread's memory domain pages are reset and the incoming thread's memory domain is loaded. The pages are configured if userspace is enabled and if memory domain has been initialized before calling swap. GH-3852 Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
This commit is contained in:
parent
f7b0731ce4
commit
538fa7b37c
|
@ -164,9 +164,18 @@ void _x86_swap_update_page_tables(struct k_thread *incoming,
|
|||
*/
|
||||
_main_tss.esp0 = incoming->stack_info.start;
|
||||
|
||||
/* TODO: if either thread defines different memory domains, efficiently
|
||||
/* If either thread defines different memory domains, efficiently
|
||||
* switch between them
|
||||
*/
|
||||
if (incoming->mem_domain_info.mem_domain !=
|
||||
outgoing->mem_domain_info.mem_domain){
|
||||
|
||||
/* Ensure that the outgoing mem domain configuration
|
||||
* is set back to default state.
|
||||
*/
|
||||
_arch_mem_domain_destroy(outgoing->mem_domain_info.mem_domain);
|
||||
_x86_mmu_mem_domain_load(incoming);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue