For example, if seL4 gives userspace these untypeds:
Normal: [0x0 ... 0x200_000)
Device: [0x200_000 ... 0x201_000)
Normal: [0x201_000 ... 0x400_000)
It is technically valid for a memory region to use both type of untypeds, for example [0x100_000 ... 0x300_000). All Microkit releases < 2.1.0 does not have this problem as they allocate Frame objects for a memory region from a single untyped. But with the capDL integration in >= 2.1.0 this is no longer the case. Which caused weird issues for me such as a VM hanging when guest RAM used both normal and device untypeds.
The first problem is that there is no way for the user to tell the tool whether they want a memory region to be allocated from normal or device untypeds. They get automatically allocated by the capDL initialiser's algorithm.
Secondly we should add a way of detecting this issue and print an error message. This is not too hard on ARM and RISC-V since the tool already emulated the kernel boot process to obtain the list of untypeds that you will get at run time.
But on x86 it is unclear to me what is the best way to solve this problem since you don't know the memory map at compile time. The cleanest way I could think of is that we add a device: bool attribute to the Frame spec object to restrain the capDL initialiser from mixing untypeds.
For example, if seL4 gives userspace these untypeds:
It is technically valid for a memory region to use both type of untypeds, for example
[0x100_000 ... 0x300_000). All Microkit releases < 2.1.0 does not have this problem as they allocate Frame objects for a memory region from a single untyped. But with the capDL integration in >= 2.1.0 this is no longer the case. Which caused weird issues for me such as a VM hanging when guest RAM used both normal and device untypeds.The first problem is that there is no way for the user to tell the tool whether they want a memory region to be allocated from normal or device untypeds. They get automatically allocated by the capDL initialiser's algorithm.
Secondly we should add a way of detecting this issue and print an error message. This is not too hard on ARM and RISC-V since the tool already emulated the kernel boot process to obtain the list of untypeds that you will get at run time.
But on x86 it is unclear to me what is the best way to solve this problem since you don't know the memory map at compile time. The cleanest way I could think of is that we add a
device: boolattribute to the Frame spec object to restrain the capDL initialiser from mixing untypeds.