The generic STM API doesn't deal with pages - it only knows about channels. The channels allocated to various clients goes through debugFS and the STM policies. If users need to work with pages they will have to know about the architecture in order to specify the right alignment.
I would expect userspace to call mmap() with a null pointer and have the kernel decide where to map it into userspace, rather than userspace specifying alignment. It would be similar to using the mmap() interface to perf sample events, wouldn't it?
If they ask for 16 channels and the minimum page size is 16K then they will get back a page that allows them to access to 64 channels. I don't see any other way to do it, assuming the STM is contiguous in the physical memory map. There might or might not be anything that tells them they have those extra 48 channels (although they could infer it from the page size), but the main thing is the kernel can't use that part of the physical address space, i.e. those channels, for anything else, until the first process has released them. So it needs at least one page per userspace agent simultaneously using STM.
Al
Given that, we would want to recommend an STM channel space (size of physically memory-mapped area) that allowed separate pages for the kernel and for the maximum concurrent number of userspace processes using STM pages.
It doesn't have to work like that - everything could go through the kernel. But direct access from userspace is far more efficient. Are you already looking at timescales for doing that in CoreSight STM?
Keeping the kernel out of the way is always a good thing. Implementation the mmio_addr() callback isn't very difficult, just a little tricky. We don't have a time frame for this activity, though Chunyan may be interested in taking a look when she's done integrating with Ftrace.
Al
Thanks, Mathieu
Al IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
CoreSight mailing list CoreSight@lists.linaro.org https://lists.linaro.org/mailman/listinfo/coresight
IMPORTANT NOTICE: The contents of this email and any attachments are
confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.