mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-15 08:30:02 +00:00
kernel: unmap child process pages after setup
Unmap the pages from the child process after we're done setting them up. This ensures they're not still aliased by our process, despite being marked as "owned" by the other process. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
9c433a6529
commit
61d862b5c3
1 changed files with 7 additions and 0 deletions
|
|
@ -226,11 +226,18 @@ impl MemoryMapping {
|
|||
.add(pages_l0_vpn0)
|
||||
.write_volatile(pages_l0_ppn);
|
||||
|
||||
// Mark the four pages as being owned by the new process
|
||||
memory_manager.move_page_raw(root_phys as *mut usize, pid)?;
|
||||
memory_manager.move_page_raw(pages_l0_phys as *mut usize, pid)?;
|
||||
memory_manager.move_page_raw(process_l0_phys as *mut usize, pid)?;
|
||||
memory_manager.move_page_raw(context_phys as *mut usize, pid)?;
|
||||
|
||||
// Unmap our copies of the four pages
|
||||
unmap_page_inner(memory_manager, root_temp_virt as usize)?;
|
||||
unmap_page_inner(memory_manager, pages_l0_temp_virt as usize)?;
|
||||
unmap_page_inner(memory_manager, process_l0_temp_virt as usize)?;
|
||||
unmap_page_inner(memory_manager, context_temp_virt as usize)?;
|
||||
|
||||
// Construct a dummy SATP that we will use to hand memory to the new process.
|
||||
self.satp = 0x8000_0000 | ((pid.get() as usize) << 22) | (root_phys as usize >> 12);
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Reference in a new issue