TEE protected DMA-bufs for v6.18 - Allocates protected DMA-bufs from a DMA-heap instantiated from the TEE subsystem. - The DMA-heap uses a protected memory pool provided by the backend TEE driver, allowing it to choose how to allocate the protected physical memory. - Three use-cases (Secure Video Playback, Trusted UI, and Secure Video Recording) have been identified so far to serve as examples of what can be expected. - The use-cases have predefined DMA-heap names, "protected,secure-video", "protected,trusted-ui", and "protected,secure-video-record". The backend driver registers protected memory pools for the use-cases it supports. * tag 'tee-prot-dma-buf-for-v6.18' of git://git.kernel.org/pub/scm/linux/kernel/git/jenswi/linux-tee: optee: smc abi: dynamic protected memory allocation optee: FF-A: dynamic protected memory allocation optee: support protected memory allocation tee: add tee_shm_alloc_dma_mem() tee: new ioctl to a register tee_shm from a dmabuf file descriptor tee: refactor params_from_user() tee: implement protected DMA-heap dma-buf: dma-heap: export declared functions optee: sync secure world ABI headers
Showing the changes to include/uapi (1 of 20 files). Show all
Unified · Split
| @@ -378,6 +378,37 @@ struct tee_ioctl_shm_register_data { · 377 unmodified lines | ||
| 378 | 378 | __s32 id; |
| 379 | 379 | }; |
| 380 | 380 | |
| 381 | +/** | |
| 382 | + * struct tee_ioctl_shm_register_fd_data - Shared memory registering argument | |
| 383 | + * @fd: [in] File descriptor identifying dmabuf reference | |
| 384 | + * @size: [out] Size of referenced memory | |
| 385 | + * @flags: [in] Flags to/from allocation. | |
| 386 | + * @id: [out] Identifier of the shared memory | |
| 387 | + * | |
| 388 | + * The flags field should currently be zero as input. Updated by the call | |
| 389 | + * with actual flags as defined by TEE_IOCTL_SHM_* above. | |
| 390 | + * This structure is used as argument for TEE_IOC_SHM_REGISTER_FD below. | |
| 391 | + */ | |
| 392 | +struct tee_ioctl_shm_register_fd_data { | |
| 393 | + __s64 fd; | |
| 394 | + __u64 size; | |
| 395 | + __u32 flags; | |
| 396 | + __s32 id; | |
| 397 | +}; | |
| 398 | + | |
| 399 | +/** | |
| 400 | + * TEE_IOC_SHM_REGISTER_FD - register a shared memory from a file descriptor | |
| 401 | + * | |
| 402 | + * Returns a file descriptor on success or < 0 on failure | |
| 403 | + * | |
| 404 | + * The returned file descriptor refers to the shared memory object in the | |
| 405 | + * kernel. The supplied file deccriptor can be closed if it's not needed | |
| 406 | + * for other purposes. The shared memory is freed when the descriptor is | |
| 407 | + * closed. | |
| 408 | + */ | |
| 409 | +#define TEE_IOC_SHM_REGISTER_FD _IOWR(TEE_IOC_MAGIC, TEE_IOC_BASE + 8, \ | |
| 410 | + struct tee_ioctl_shm_register_fd_data) | |
| 411 | + | |
| 381 | 412 | /** |
| 382 | 413 | * TEE_IOC_SHM_REGISTER - Register shared memory argument |
| 383 | 414 | * |