mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 18:03:25 +00:00
Allow the page table un-mapper to flush the TLB precisely
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
e597a10088
commit
9a6e1b03e3
@ -103,18 +103,11 @@ pub(super) struct Vmar_ {
|
||||
|
||||
impl Drop for Vmar_ {
|
||||
fn drop(&mut self) {
|
||||
if self.is_root_vmar() {
|
||||
self.vm_space.clear();
|
||||
}
|
||||
// Drop the child VMAR.
|
||||
// FIXME: This branch can be removed once removing child VMAR usage from the code base.
|
||||
else {
|
||||
let mut cursor = self
|
||||
.vm_space
|
||||
.cursor_mut(&(self.base..self.base + self.size))
|
||||
.unwrap();
|
||||
cursor.unmap(self.size);
|
||||
}
|
||||
let mut cursor = self
|
||||
.vm_space
|
||||
.cursor_mut(&(self.base..self.base + self.size))
|
||||
.unwrap();
|
||||
cursor.unmap(self.size);
|
||||
}
|
||||
}
|
||||
|
||||
@ -302,7 +295,12 @@ impl Vmar_ {
|
||||
if !self.is_root_vmar() {
|
||||
return_errno_with_message!(Errno::EACCES, "The vmar is not root vmar");
|
||||
}
|
||||
self.vm_space.clear();
|
||||
let mut cursor = self
|
||||
.vm_space
|
||||
.cursor_mut(&(self.base..self.base + self.size))
|
||||
.unwrap();
|
||||
cursor.unmap(self.size);
|
||||
drop(cursor);
|
||||
let mut inner = self.inner.lock();
|
||||
inner.child_vmar_s.clear();
|
||||
inner.vm_mappings.clear();
|
||||
|
Reference in New Issue
Block a user