diff --git a/drivers/soc/qcom/mem_buf/mem-buf-gh.c b/drivers/soc/qcom/mem_buf/mem-buf-gh.c index c803a66be70c..928a8f5636e7 100644 --- a/drivers/soc/qcom/mem_buf/mem-buf-gh.c +++ b/drivers/soc/qcom/mem_buf/mem-buf-gh.c @@ -1171,7 +1171,9 @@ struct dma_buf *mem_buf_retrieve(struct mem_buf_retrieve_kernel_arg *arg) buffer->uncached = false; buffer->free = mem_buf_retrieve_release; buffer->vmperm = mem_buf_vmperm_alloc_accept(&buffer->sg_table, - arg->memparcel_hdl); + arg->memparcel_hdl, + arg->vmids, arg->perms, + arg->nr_acl_entries); exp_info.size = buffer->len; exp_info.flags = arg->fd_flags; diff --git a/drivers/soc/qcom/mem_buf/mem_buf_dma_buf.c b/drivers/soc/qcom/mem_buf/mem_buf_dma_buf.c index 6482e331c7db..ada227a92f66 100644 --- a/drivers/soc/qcom/mem_buf/mem_buf_dma_buf.c +++ b/drivers/soc/qcom/mem_buf/mem_buf_dma_buf.c @@ -140,17 +140,14 @@ err_resize_state: /* Must be freed via mem_buf_vmperm_release. */ struct mem_buf_vmperm *mem_buf_vmperm_alloc_accept(struct sg_table *sgt, - gh_memparcel_handle_t memparcel_hdl) + gh_memparcel_handle_t memparcel_hdl, int *vmids, int *perms, + unsigned int nr_acl_entries) { - int vmids[1]; - int perms[1]; struct mem_buf_vmperm *vmperm; - vmids[0] = current_vmid; - perms[0] = PERM_READ | PERM_WRITE | PERM_EXEC; vmperm = mem_buf_vmperm_alloc_flags(sgt, MEM_BUF_WRAPPER_FLAG_ACCEPT, - vmids, perms, 1); + vmids, perms, nr_acl_entries); if (IS_ERR(vmperm)) return vmperm; diff --git a/include/linux/mem-buf-exporter.h b/include/linux/mem-buf-exporter.h index 9ff6e4491d84..d739ef17d7da 100644 --- a/include/linux/mem-buf-exporter.h +++ b/include/linux/mem-buf-exporter.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef _MEM_BUF_EXPORTER_H @@ -59,8 +60,8 @@ struct mem_buf_vmperm *mem_buf_vmperm_alloc_staticvm(struct sg_table *sgt, int * * A dmabuf in the "MEMACCEPT" state. */ struct mem_buf_vmperm *mem_buf_vmperm_alloc_accept(struct sg_table *sgt, - gh_memparcel_handle_t memparcel_hdl); - + gh_memparcel_handle_t memparcel_hdl, int *vmids, int *perms, + unsigned int nr_acl_entries); /* * Performs the expected close step based on whether the dmabuf