kata: Integrate Image Manager and WMMU changes

This CL handles the integration of the Image Manager, which comes
concurrent with the necessary WMMU changes needed by the Image Manager.

The ML Coordinator now calls into Image Manager to make space, commit
images, and set the WMMU.

The MlCoordinator now first verifies that an image is valid by first making a pass through the section headers. It stores the two sizes that we're interested in per image: how big it is packed on flash, and how big it is unpacked in memory.

Known issues:
b/241799340: Refactor BundleImage to support unit testing
The writes to DMEM via the kata-vec-core crate was meant to be in image_manager.rs, but this interfered with the ability to run unit tests. We can refactor BundleImage to make this work.

b/241799866: Improve heap management
Right now I clear all of the "temporary data section" (bss, stack,
heap), but I suspect only the heap needs to be cleared. This needs more effort to check that that's correct, and track those locations.

Minor changes:
ImageId is used instead of (String, String) in the component.

Change-Id: I1505c6474fc60205323ce3bb13610fdac3702b89
GitOrigin-RevId: 5df9938a6cbd7ca5510ce8fcb500ce471f42b2cb
This commit is contained in:
Adam Jesionowski
2022-07-27 14:12:56 -07:00
committed by Sam Leffler
parent 50cd809320
commit fd7f31bcb2
15 changed files with 494 additions and 365 deletions

View File

@@ -1,5 +1,4 @@
#![no_std]
#![allow(dead_code)]
use cstr_core::CString;
/// Errors that can occur when interacting with the MlCoordinator.
@@ -9,6 +8,7 @@ pub enum MlCoordError {
MlCoordOk,
InvalidModelId,
InvalidBundleId,
InvalidImage,
LoadModelFailed,
NoModelSlotsLeft,
NoSuchModel,