summaryrefslogtreecommitdiff
path: root/rust/helpers/rbtree.c
diff options
context:
space:
mode:
authorMoti Haimovski <moti.haimovski@intel.com>2024-09-08 15:01:26 +0300
committerKoby Elbaz <koby.elbaz@intel.com>2025-09-25 09:09:30 +0300
commit513024d5a0e34fd34247043f1876b6138ca52847 (patch)
tree836ffcc97ea983df3a7a2d8656e28b613ad455ef /rust/helpers/rbtree.c
parent0668db41b5d8a834a04be3b281fa9452dcf3dc18 (diff)
accel/habanalabs: support mapping cb with vmalloc-backed coherent memory
When IOMMU is enabled, dma_alloc_coherent() with GFP_USER may return addresses from the vmalloc range. If such an address is mapped without VM_MIXEDMAP, vm_insert_page() will trigger a BUG_ON due to the VM_PFNMAP restriction. Fix this by checking for vmalloc addresses and setting VM_MIXEDMAP in the VMA before mapping. This ensures safe mapping and avoids kernel crashes. The memory is still driver-allocated and cannot be accessed directly by userspace. Signed-off-by: Moti Haimovski <moti.haimovski@intel.com> Reviewed-by: Koby Elbaz <koby.elbaz@intel.com> Signed-off-by: Koby Elbaz <koby.elbaz@intel.com>
Diffstat (limited to 'rust/helpers/rbtree.c')
0 files changed, 0 insertions, 0 deletions