Improve efficiency of global TLB flushing

This commit is contained in:
Chen Chengjun
2024-08-15 16:53:54 +08:00
committed by Tate, Hongliang Tian
parent 720b952996
commit 99a22ff124
2 changed files with 39 additions and 21 deletions

View File

@ -101,16 +101,6 @@ pub(super) struct Vmar_ {
parent: Weak<Vmar_>,
}
impl Drop for Vmar_ {
fn drop(&mut self) {
let mut cursor = self
.vm_space
.cursor_mut(&(self.base..self.base + self.size))
.unwrap();
cursor.unmap(self.size);
}
}
struct VmarInner {
/// Whether the vmar is destroyed
is_destroyed: bool,
@ -295,12 +285,7 @@ impl Vmar_ {
if !self.is_root_vmar() {
return_errno_with_message!(Errno::EACCES, "The vmar is not root vmar");
}
let mut cursor = self
.vm_space
.cursor_mut(&(self.base..self.base + self.size))
.unwrap();
cursor.unmap(self.size);
drop(cursor);
self.vm_space.clear();
let mut inner = self.inner.lock();
inner.child_vmar_s.clear();
inner.vm_mappings.clear();