From afcca7fa917427568d76a8295ff9f1e88824c1fe Mon Sep 17 00:00:00 2001 From: Lukas Zapolskas Date: Sun, 14 Dec 2025 13:00:49 +0000 Subject: sys/linux: add description for Mali Panthor driver Signed-off-by: Justin Leung Signed-off-by: Lukas Zapolskas --- sys/linux/dev_panthor.txt | 285 ++++++++++++++++++++++++++++++++++++++++ sys/linux/dev_panthor.txt.const | 24 ++++ 2 files changed, 309 insertions(+) create mode 100644 sys/linux/dev_panthor.txt create mode 100644 sys/linux/dev_panthor.txt.const (limited to 'sys/linux') diff --git a/sys/linux/dev_panthor.txt b/sys/linux/dev_panthor.txt new file mode 100644 index 000000000..593b498f3 --- /dev/null +++ b/sys/linux/dev_panthor.txt @@ -0,0 +1,285 @@ +# Copyright 2025 syzkaller project authors. All rights reserved. +# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file. + +include +include +include + +resource vm_id[int32] +resource bo_handle[drm_gem_handle] +resource group_handle[int32] +resource heap_handle[int32] + +openat$panthor(dirfd const[AT_FDCWD], path ptr[in, string["/dev/dri/renderD128"]], flags const[2], mode const[0]) fd_dri +mmap$panthor(addr vma, len len[addr], prot flags[mmap_prot], flags flags[mmap_flags], fd fd_dri, offset fileoff) +_ = __NR_mmap2 + +ioctl$DRM_IOCTL_PANTHOR_DEV_QUERY_GPU_INFO(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_DEV_QUERY], arg ptr[inout, drm_panthor_dev_query_gpu_info]) +ioctl$DRM_IOCTL_PANTHOR_DEV_QUERY_CSIF_INFO(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_DEV_QUERY], arg ptr[inout, drm_panthor_dev_query_csif_info]) +ioctl$DRM_IOCTL_PANTHOR_DEV_QUERY_TIMESTAMP_INFO(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_DEV_QUERY], arg ptr[inout, drm_panthor_dev_query_timestamp_info]) +ioctl$DRM_IOCTL_PANTHOR_DEV_QUERY_GROUP_PRIORITIES_INFO(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_DEV_QUERY], arg ptr[inout, drm_panthor_dev_query_group_priorities_info]) +ioctl$DRM_IOCTL_PANTHOR_VM_CREATE(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_VM_CREATE], arg ptr[inout, drm_panthor_vm_create]) +ioctl$DRM_IOCTL_PANTHOR_VM_DESTROY(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_VM_DESTROY], arg ptr[inout, drm_panthor_vm_destroy]) +ioctl$DRM_IOCTL_PANTHOR_VM_BIND(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_VM_BIND], arg ptr[inout, drm_panthor_vm_bind]) +ioctl$DRM_IOCTL_PANTHOR_VM_GET_STATE(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_VM_GET_STATE], arg ptr[inout, drm_panthor_vm_get_state]) +ioctl$DRM_IOCTL_PANTHOR_BO_CREATE(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_BO_CREATE], arg ptr[inout, drm_panthor_bo_create]) +ioctl$DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET], arg ptr[inout, drm_panthor_bo_mmap_offset]) +ioctl$DRM_IOCTL_PANTHOR_GROUP_CREATE(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_GROUP_CREATE], arg ptr[inout, drm_panthor_group_create]) +ioctl$DRM_IOCTL_PANTHOR_GROUP_DESTROY(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_GROUP_DESTROY], arg ptr[inout, drm_panthor_group_destroy]) +ioctl$DRM_IOCTL_PANTHOR_GROUP_SUBMIT(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_GROUP_SUBMIT], arg ptr[inout, drm_panthor_group_submit]) +ioctl$DRM_IOCTL_PANTHOR_GROUP_GET_STATE(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_GROUP_GET_STATE], arg ptr[inout, drm_panthor_group_get_state]) +ioctl$DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE], arg ptr[inout, drm_panthor_tiler_heap_create]) +ioctl$DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY], arg ptr[inout, drm_panthor_tiler_heap_destroy]) +ioctl$DRM_IOCTL_PANTHOR_BO_SET_LABEL(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_BO_SET_LABEL], arg ptr[inout, drm_panthor_bo_set_label]) +ioctl$DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET], arg ptr[inout, drm_panthor_set_user_mmio_offset]) +ioctl$DRM_IOCTL_PANTHOR_BO_SYNC(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_BO_SYNC], arg ptr[inout, drm_panthor_bo_sync]) +ioctl$DRM_IOCTL_PANTHOR_BO_QUERY_INFO(fd fd_dri, cmd const[DRM_IOCTL_PANTHOR_BO_QUERY_INFO], arg ptr[inout, drm_panthor_bo_query_info]) + +drm_panthor_sync_op { + flags flags[drm_panthor_sync_op_flags, int32] + handle drm_syncobj (in) + timeline_value int64 +} + +drm_panthor_gpu_info { + gpu_id int32 + gpu_rev int32 + csf_id int32 + l2_features int32 + tiler_features int32 + mem_features int32 + mmu_features int32 + thread_features int32 + max_threads int32 + thread_max_workgroup_size int32 + thread_max_barrier_size int32 + coherency_features flags[drm_panthor_gpu_coherency, int32] + texture_features array[int32, 4] + as_present int32 + selected_coherency int32 + shader_present int64 + l2_present int64 + tiler_present int64 + core_features int32 + pad const[0, int32] + gpu_features int64 +} + +drm_panthor_csif_info { + csg_slot_count int32 + cs_slot_count int32 + cs_reg_count int32 + scoreboard_slot_count int32 + unpreserved_cs_reg_count int32 + pad const[0, int32] +} + +drm_panthor_timestamp_info { + timestamp_frequency int64 + current_timestamp int64 + timestamp_offset int64 +} + +drm_panthor_group_priorities_info { + allowed_mask int8 + pad const[0, int64:24] +} + +drm_panthor_dev_query_gpu_info { + type const[0, int32] + size int32 + pointer ptr64[out, drm_panthor_gpu_info] +} + +drm_panthor_dev_query_csif_info { + type const[1, int32] + size int32 + pointer ptr64[out, drm_panthor_csif_info] +} + +drm_panthor_dev_query_timestamp_info { + type const[2, int32] + size int32 + pointer ptr64[out, drm_panthor_timestamp_info] +} + +drm_panthor_dev_query_group_priorities_info { + type const[3, int32] + size int32 + pointer ptr64[out, drm_panthor_group_priorities_info] +} + +drm_panthor_vm_create { + flags const[0, int32] + id vm_id (out) + user_va_range int64 +} + +drm_panthor_vm_destroy { + id vm_id (in) + pad const[0, int32] +} + +drm_panthor_vm_bind_op { + flags flags[drm_panthor_vm_bind_op_flags, int32] + bo_handle bo_handle (in) + bo_offset int64 + va int64 + size int64 + syncs drm_panthor_obj_array_drm_panthor_sync_op +} + +drm_panthor_vm_bind { + vm_id vm_id (in) + flags flags[drm_panthor_vm_bind_flags, int32] + ops drm_panthor_obj_array_drm_panthor_vm_bind_op +} + +drm_panthor_vm_get_state { + vm_id vm_id (in) + state int32 (out) +} + +drm_panthor_bo_create { + size int64 + flags flags[drm_panthor_bo_flags, int32] + exclusive_vm_id vm_id (in) + handle bo_handle (out) + pad const[0, int32] +} + +drm_panthor_bo_mmap_offset { + handle bo_handle (in) + pad const[0, int32] + offset fileoff[int64] (out) +} + +drm_panthor_queue_create { + priority int8 + pad const[0, int64:24] + ringbuf_size int32 +} + +drm_panthor_group_create { + queues drm_panthor_obj_array_drm_panthor_queue_create + max_compute_cores int8 + max_fragment_cores int8 + max_tiler_cores int8 + priority flags[drm_panthor_group_priority, int8] + pad const[0, int32] + compute_core_mask int64 + fragment_core_mask int64 + tiler_core_mask int64 + vm_id vm_id (in) + group_handle group_handle (out) +} + +drm_panthor_group_destroy { + group_handle group_handle (in) + pad const[0, int32] +} + +drm_panthor_queue_submit { + queue_index int32 + stream_size int32[0:-1, 8] + stream_addr int64[0:-1, 64] + latest_flush int32 + pad const[0, int32] + syncs drm_panthor_obj_array_drm_panthor_sync_op +} + +drm_panthor_group_submit { + group_handle group_handle (in) + pad const[0, int32] + queue_submits drm_panthor_obj_array_drm_panthor_queue_submit +} + +drm_panthor_group_get_state { + group_handle group_handle (in) + state int32 (out) + fatal_queues int32 (out) + pad const[0, int32] +} + +drm_panthor_tiler_heap_create { + vm_id vm_id (in) + initial_chunk_count int32 + chunk_size int32[131072:8388608, 131072] + max_chunks int32 + target_in_flight int32 + handle heap_handle (out) + tiler_heap_ctx_gpu_va int64 + first_heap_chunk_gpu_va int64 +} + +drm_panthor_tiler_heap_destroy { + handle heap_handle (in) + pad const[0, int32] +} + +drm_panthor_bo_set_label { + handle bo_handle (in) + pad const[0, int32] + label ptr[in, string] +} + +drm_panthor_set_user_mmio_offset { + offset int64 +} + +drm_panthor_bo_sync_op { + handle bo_handle (in) + type flags[drm_panthor_bo_sync_op_type, int32] + offset int64 + size int64 +} + +drm_panthor_bo_sync { + ops drm_panthor_obj_array_drm_panthor_bo_sync_op +} + +drm_panthor_bo_query_info { + handle bo_handle + extra_flags flags[drm_panthor_bo_extra_flags, int32] + create_flags flags[drm_panthor_bo_flags, int32] + pad const[0, int32] +} + +drm_panthor_obj_array_drm_panthor_vm_bind_op { + stride const[48, int32] + count len[array, int32] + array ptr64[inout, array[drm_panthor_vm_bind_op]] +} + +drm_panthor_obj_array_drm_panthor_queue_create { + stride const[8, int32] + count len[array, int32] + array ptr64[inout, array[drm_panthor_queue_create]] +} + +drm_panthor_obj_array_drm_panthor_queue_submit { + stride const[40, int32] + count len[array, int32] + array ptr64[inout, array[drm_panthor_queue_submit]] +} + +drm_panthor_obj_array_drm_panthor_sync_op { + stride const[16, int32] + count len[array, int32] + array ptr64[inout, array[drm_panthor_sync_op]] +} + +drm_panthor_obj_array_drm_panthor_bo_sync_op { + stride const[24, int32] + count len[array, int32] + array ptr64[inout, array[drm_panthor_bo_sync_op]] +} + +drm_panthor_sync_op_flags = 0, 1, 255, 2147483648 +drm_panthor_gpu_coherency = 0, 1, 31 +drm_panthor_vm_bind_op_flags = 0, 1, 2, 4, 268435456, 536870912, 4026531840 +drm_panthor_vm_bind_flags = 1 +drm_panthor_bo_flags = 1, 2 +drm_panthor_group_priority = 0, 1, 2, 3 +drm_panthor_bo_sync_op_type = 0, 1 +drm_panthor_bo_extra_flags = 1 diff --git a/sys/linux/dev_panthor.txt.const b/sys/linux/dev_panthor.txt.const new file mode 100644 index 000000000..b261c2545 --- /dev/null +++ b/sys/linux/dev_panthor.txt.const @@ -0,0 +1,24 @@ +# Code generated by syz-sysgen. DO NOT EDIT. +arches = arm64 +AT_FDCWD = arm64:18446744073709551516 +DRM_IOCTL_PANTHOR_BO_CREATE = arm64:3222824005 +DRM_IOCTL_PANTHOR_BO_MMAP_OFFSET = arm64:3222299718 +DRM_IOCTL_PANTHOR_BO_QUERY_INFO = arm64:3222299728 +DRM_IOCTL_PANTHOR_BO_SET_LABEL = arm64:3222299725 +DRM_IOCTL_PANTHOR_BO_SYNC = arm64:3222299727 +DRM_IOCTL_PANTHOR_DEV_QUERY = arm64:3222299712 +DRM_IOCTL_PANTHOR_GROUP_CREATE = arm64:3224921159 +DRM_IOCTL_PANTHOR_GROUP_DESTROY = arm64:3221775432 +DRM_IOCTL_PANTHOR_GROUP_GET_STATE = arm64:3222299722 +DRM_IOCTL_PANTHOR_GROUP_SUBMIT = arm64:3222824009 +DRM_IOCTL_PANTHOR_SET_USER_MMIO_OFFSET = arm64:3221775438 +DRM_IOCTL_PANTHOR_TILER_HEAP_CREATE = arm64:3223872587 +DRM_IOCTL_PANTHOR_TILER_HEAP_DESTROY = arm64:3221775436 +DRM_IOCTL_PANTHOR_VM_BIND = arm64:3222824003 +DRM_IOCTL_PANTHOR_VM_CREATE = arm64:3222299713 +DRM_IOCTL_PANTHOR_VM_DESTROY = arm64:3221775426 +DRM_IOCTL_PANTHOR_VM_GET_STATE = arm64:3221775428 +__NR_ioctl = arm64:29 +__NR_mmap = arm64:222 +__NR_mmap2 = ??? +__NR_openat = arm64:56 -- cgit mrf-deployment