> > What advantage > > does userspace get from having to have a different codepath to get a > > different handle to memory? What about x86? > > > > I think this proposal is looking at it from the wrong direction. > > Instead of working upwards from the implementation to userspace, start > > with userspace and work downwards. The interesting property to focus > > on is allocating memory, not that EL1 is involved behind the scenes. > > From what I've gathered from earlier discussions, it wasn't much of a > problem for userspace to handle this. If the kernel were to provide it > via a different ABI, how would it be easier to implement in the > kernel? I think we need an example to understand your suggestion. It is a problem for userspace, because we need to expose acceptable parameters for allocation through the entire stack. If you look at the dmabuf documentation in the kernel for how buffers should be allocated and exchanged, you can see the negotiation flow for modifiers. This permeates through KMS, EGL, Vulkan, Wayland, GStreamer, and more. Standardising on heaps allows us to add those in a similar way. If we have to add different allocation mechanisms, then the complexity increases, permeating not only into all the different userspace APIs, but also into the drivers which need to support every different allocation mechanism even if they have no opinion on it - e.g. Mali doesn't care in any way whether the allocation comes from a heap or TEE or ACPI or whatever, it cares only that the memory is protected. Does that help? Cheers, Daniel