Re: [RFC PATCH 2/5] cma-heap: Allow registration of custom cma heaps

Maxime Ripard
2025-01-30T13:36:07Z

[-- Attachment #1: Type: text/plain, Size: 1020 bytes --]

Hi,

On Thu, Jan 30, 2025 at 01:08:58PM +0000, Florent Tomasin wrote:
> This patch introduces a cma-heap probe function, allowing
> users to register custom cma heaps in the device tree.
>
> A "memory-region" is bound to the cma heap at probe time
> allowing allocation of DMA buffers from that heap.
>
> Use cases:
> - registration of carved out secure heaps. Some devices
> are implementing secure memory by reserving a specific
> memory regions for that purpose. For example, this is the
> case of platforms making use of early version of
> ARM TrustZone.

In such a case, the CMA heap would de-facto become un-mappable for
userspace, right?

> - registration of multiple memory regions at different
> locations for efficiency or HW integration reasons.
> For example, a peripheral may expect to share data at a
> specific location in RAM. This information could have been
> programmed by a FW prior to the kernel boot.

How would you differentiate between them?

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]