mirror of
https://github.com/AmbiML/sparrow-kata-full.git
synced 2025-07-14 14:34:19 +00:00
kata-security-coordinator: fix fakeimpl memory stats
Request the MemoryManager to free the package contents' CNode on uninstall. We were reclaiming this locally without informing MmemoryManager so it's bookkeeping was off. Change-Id: I925178ad50cf84a85dd401aafd9fdbea71e050a3 GitOrigin-RevId: 3e369dd558542d6f85f70f0ea9894ea370fd51d6
This commit is contained in:
parent
ddacc3762e
commit
8255aeb604
@ -3,23 +3,10 @@
|
|||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
use alloc::string::{String, ToString};
|
use alloc::string::{String, ToString};
|
||||||
use hashbrown::HashMap;
|
use hashbrown::HashMap;
|
||||||
use kata_os_common::sel4_sys;
|
|
||||||
use kata_os_common::slot_allocator;
|
|
||||||
use kata_memory_interface::ObjDescBundle;
|
use kata_memory_interface::ObjDescBundle;
|
||||||
use kata_memory_interface::kata_object_free;
|
use kata_memory_interface::kata_object_free_in_cnode;
|
||||||
use kata_security_interface::*;
|
use kata_security_interface::*;
|
||||||
use kata_storage_interface::KeyValueData;
|
use kata_storage_interface::KeyValueData;
|
||||||
use log::error;
|
|
||||||
|
|
||||||
use sel4_sys::seL4_CNode_Delete;
|
|
||||||
use sel4_sys::seL4_CPtr;
|
|
||||||
use sel4_sys::seL4_WordBits;
|
|
||||||
|
|
||||||
use slot_allocator::KATA_CSPACE_SLOTS;
|
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
static SELF_CNODE: seL4_CPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct BundleData {
|
struct BundleData {
|
||||||
pkg_contents: ObjDescBundle,
|
pkg_contents: ObjDescBundle,
|
||||||
@ -52,14 +39,7 @@ impl BundleData {
|
|||||||
}
|
}
|
||||||
impl Drop for BundleData {
|
impl Drop for BundleData {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
let _ = kata_object_free(&self.pkg_contents);
|
let _ = kata_object_free_in_cnode(&self.pkg_contents);
|
||||||
unsafe {
|
|
||||||
KATA_CSPACE_SLOTS.free(self.pkg_contents.cnode, 1);
|
|
||||||
if let Err(e) = seL4_CNode_Delete(SELF_CNODE, self.pkg_contents.cnode, seL4_WordBits as u8) {
|
|
||||||
// XXX no bundle_id
|
|
||||||
error!("Error deleting CNode {}, error {:?}", self.pkg_contents.cnode, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user