Fix approach used for making PDs passive#535
Conversation
Previously, the ELF code treats program headers = segments. While this worked originally, it broke for cases that requires >= 2 program headers to refer to the same segment. Now, when the ELF is parsed, the code will create a 1-1 mapping of segments to program headers like before. But the allow for additional program headers to be inserted. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Added `pub fn phdrs_table(&self) -> Vec<(ElfProgramHeader64, usize)>` to ELF code. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Modified `pub fn add_segment()` to allow for an additional program header in the ELF to describe the segment with a user defined type identifier. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Which also required changes to how the spec is packed into the intialiser. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
Previously, when a task wants to be passive, it signals the monitor after its `init()` entrypoint returns. While this is fine for single core, there are 2 problems: 1. It will not scale/work in multi-core setups. Given that it is a non-blocking send, a scenario may occur where the monitor is already dealing with a message from one PD (meaning that it is not waiting on an endpoint) and another PD that wants to make itself passive on another core which means the message will be lost. 2. It affects verification as it leads to assumptions needing to be made about the scheduling of the system. Now, the process happens inside the capDL initialiser itself, which fixes all the problems above. Signed-off-by: Bill Nguyen <bill.nguyen@unsw.edu.au>
| @@ -1043,29 +1028,13 @@ pub fn build_capdl_spec( | |||
|
|
|||
| // Step 3-15 bind this PD's TCB to the monitor, this accomplish two purposes: | |||
| // 1. Allow PDs' TCBs to be named to their proper name in SDF in debug config. | |||
There was a problem hiding this comment.
Not really relevant, but surely the capDL initialiser should also be doing this?
There was a problem hiding this comment.
It actually already does that, but based on the name of the TCB object rather than the PD name. In Microkit the TCB name is prefixed with tcb_ then PD name. If this isn't a big problem then we can strip out the debug name entirely from Microkit.
There was a problem hiding this comment.
I think we should probably strip out the Microkit duplication of this work, yes.
| typedef seL4_MessageInfo_t microkit_msginfo; | ||
|
|
||
| #define MONITOR_EP 5 | ||
| /* Index 5 is unused */ |
There was a problem hiding this comment.
I think this is probably unnecessary given all the other indices that are unused.
There was a problem hiding this comment.
I added that to signal to anyone looking at the code later that the index is free to re-use, since previously it was occupied. But I can remove it
Depends on:
Fixes #91.