Commit Graph

21 Commits

Author SHA1 Message Date
Anmolpreet Kaur
810db21f77 qseecom: add CONFIG_COMPAT condition
Compile compat_qseecom_ioctl only if
CONFIG_COMPAT is enabled.

Change-Id: I334b0bccdaa30815ea17becdc086aa590d517f75
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-12-10 14:26:59 +05:30
Zhen Kong
72729b4dee qseecom: improve operation when app unload returns EBUSY
If unload app was failed due to EBUSY, qseecom will not free
app list entry, but just restore app ref_cnt and return EBUSY
to client.

Change-Id: If7b20b52690a34ba9cf1b3c3e96f84583d221dec
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-10-19 22:08:21 -07:00
Anmolpreet Kaur
ea551156f1 qseecom: Propagate correct return value from TZ
When unload app fails, return the correct return
value that we get from TZ and not translate it to
EFAULT. This will make sure that proper handling is
done at the calling side.

Change-Id: Ie850967e5c44b502b888324291a878d0a467b46b
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-10-08 02:26:01 -07:00
qctecmdr
26a195583d Merge "qseecom : Pass proper device node pointer" 2020-08-13 10:28:13 -07:00
Anmolpreet Kaur
e88247afe7 qseecom : Fixes to enable shmbridge
Fixes in qseecom driver to support shmbridge and
change parameters as hypervisor expects them to
be.

Change-Id: I57dc5d6fe7b74b45da2dee6de32c1251d77275ee
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-08-12 05:55:34 -07:00
Anmolpreet Kaur
3a2a52e392 qseecom : Pass proper device node pointer
Pass proper device node pointer to
of_reserved_mem_device_init_by_idx so that
it contains the of_node data which is needed
by the api.

Change-Id: I327f95657628eaa2e0e4bf98a919e003cdae7a86
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-08-07 21:03:10 +05:30
Liam Mark
236b06ac63 dma-buf: Add support to set a destructor on a dma-buf
dma-buf destructor support is useful as it allows clients an opportunity
to undo any attributes, such as security attributes, they have applied to
the dma-buf's memory.

The destructor is called when the dma-buf is freed, if the destructor
returns an error the dma-buf's exporter release function is not called in
order to ensure that memory which has not been properly cleaned up isn't
returned to the system.

Change-Id: If2173b23b441157b3638110f02e2ff90ab6ad1aa
Signed-off-by: Liam Mark <lmark@codeaurora.org>
Signed-off-by: Swathi Sridhar <swatsrid@codeaurora.org>
[isaacm@codeaurora.org: resolve merge conflicts/qseecom redefinitions]
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2020-08-01 22:57:06 -07:00
AnilKumar Chimata
547cc33976 qseecom: Check error when allocating coherent buffer
Add check to verify whether memory is allocated properly or not
and return error if its failed to allocate coherent buffer.

Change-Id: I234a637d20228d047f6fc11d374b6f13f28fed03
Signed-off-by: Gaurav Kashyap <gaurkash@codeaurora.org>
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
2020-07-29 18:28:29 -07:00
Anmolpreet Kaur
7b0010980f qseecom: Change in buffer sharing mechanism in qseecom
Copy the entire userspace request buffer to local kernel
buffer and use that to send to TZ. Update the response
received in the local buffer to the actual userspace buffer
after the request is complete.

Change-Id: I673d74a32966816c5248778fc967eb91da5b6df5
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-07-17 05:36:13 -07:00
Anmolpreet Kaur
a736169167 Move from dma_buf_kmap to dma_buf_vmap for ION
Support for dma_buf_kmap() in ION on msm-5.4 will
be removed soon. It will support dma_buf_vmap() in
lieu of dma_buf_kmap(). Making changes for the same
in qseecom driver.

Change-Id: I4c2d6aaef58b41975279a01181c99cdeb18fb769
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-07-10 11:29:06 +05:30
qctecmdr
af265a84de Merge "qseecom: Set max size for dma segment" 2020-05-19 08:38:39 -07:00
Zhen Kong
b6215698c0 qseecom: process smcinvoke callback request
add operation to deal with smcinvoke callback request

Change-Id: Ia79b380691dbda4298cdf088fe1a09280767ef17
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-05-13 17:39:08 -07:00
Prerna Kalla
98cfd4573f qseecom: Set max size for dma segment
Set max size of dma segment to support requests of larger sizes.

Change-Id: I131a36bfc828d80c26bd5f463133edec6707c7fd
Signed-off-by: Prerna Kalla <prernak@codeaurora.org>
2020-05-11 01:51:40 -07:00
Neeraj Soni
81feae3952 qseecom: Invalidate the buffer after listener operation
Listener operation switches the context between secure and
non-secure world while user requested qseecom operation is
put to wait. Between lisetner operation start and finish CPU
can do a speculative data fetch before secure world updates
the physical memory of user requested response data buffer which
was waiting in qseecom for listener operation to complete. This
speculative fetch will pull old data from RAM to cache and user
will end up reading stale data. Fix this by invalidating the
response data dma buffer after listener call completes. Also remove the
invalidate call for listener dma after scm call as data will not
be accessed in kernel after scm call is completed.

Change-Id: I68730a17b515f07a71a040a534f97ce97c65026c
Signed-off-by: Neeraj Soni <neersoni@codeaurora.org>
2020-04-16 21:38:10 -07:00
Anmolpreet Kaur
c99a759add qseecom: Proper handling of unmapping dmabuf
After unmapping the dmabuf, the pointers for dmabuf
and sg lists should be explicitly made NULL. This
change takes care of releasing the already unmapped
dma buf pointers and sg pointers.

Change-Id: Ia33231af761eddbdd6f71fda2c16b37289724b2e
Signed-off-by: Anmolpreet Kaur <anmolpre@codeaurora.org>
2020-03-17 16:07:57 +05:30
Zhen Kong
d2ea1d0733 qseecom: change qseecom_process_listener_from_smcinvoke
change qseecom_process_listener_from_smcinvoke parameters to work
with smcinvoke and upstream scm driver.

Change-Id: Ib5c12f731a4b8f3fba44b3bf8818da023080d708
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-02-25 14:52:51 -08:00
Zhen Kong
ee11cdb777 qseecom: add compat_qseecom to support 32bit process
add compat_qseecom to support 32bit process to call ioctl on a
64-bit system.

Change-Id: I7e9b1c3d0cc34e3794265aa21db69e346f40833c
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-02-06 15:46:55 -08:00
Zhen Kong
e0a2c2d4d5 qseecom: use of_reserved_mem_lookup to get heap base and size
As cma_get_base and cma_get_size are not intended to be used by
leaf drivers on GKI enabled build, use of_reserved_mem_lookup to
get heap base and size.

Change-Id: I91194187c89ff8c7f7d445833afce1a4716f0ea4
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-01-31 14:29:38 -08:00
Jordan Crouse
65b841c39b qseeecom: Fix possible unused function
When building as a module, the __setup() macro is undefined and the
compiler will warn about the now unused setup function. Mark it as
__maybe_unused to avoid the compiler warning.

Change-Id: Ic0dedbad341aae7d83169517d94af3b0ea038ac9
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-01-31 12:11:49 -08:00
Dinesh K Garg
1c9e1a912f qseecom: update interface as per new scm driver
SCM driver has changed its interfaces. This requires corresponding
change in qseecom driver.

Change-Id: I9e55ed1bbbe04d25679f2e90d80e5913581887de
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
2020-01-10 15:09:49 -08:00
Zhen Kong
f9bafc3ad6 qseecom: Add qseecom driver snapshot for Lahaina
Add snapshot for qseecom driver from msm-4.19 commit 87a248d5b496d
("qseecom: invalidate listener buffer cache when get listener request").

Change-Id: I22261ad22fa8302b72b5569c68b311ca7fef9192
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2020-01-02 11:17:15 -08:00