Commit Graph

183 Commits

Author SHA1 Message Date
Linux Image Build Automation
d341a0e7d8 Revert "securemsm-kernel : Unload hdcp1 when all instances are closed"
This reverts commit 49cc227c2c.

Change-Id: I3790bc37093f7a05e2919bcf98847d912218da4b
Signed-off-by: Linux Image Build Automation <quic_ibautomat@quicinc.com>
2023-07-18 15:55:42 -07:00
Linux Image Build Automation
4bb6768c69 Revert "securemsm-kernel : handle hdcp timeout when sink response is delay"
This reverts commit f3f3f36d41.

Change-Id: Ib0e865e70314c9ec1f983c50cdfc9c85e11c6d8b
Signed-off-by: Linux Image Build Automation <quic_ibautomat@quicinc.com>
2023-07-18 15:54:12 -07:00
Sheik Anwar Shabic Y
f3f3f36d41 securemsm-kernel : handle hdcp timeout when sink response is delay
handle hdcp timeout cmd in driver when timout is received from dp
driver for delay in sink response.

Change-Id: I71359f0af31db597409b5e3352bda1cc0fedd632
Signed-off-by: Sheik Anwar Shabic Y <quic_sheikanw@quicinc.com>
Signed-off-by: Linux Image Build Automation <quic_ibautomat@quicinc.com>
2023-07-11 15:36:48 -07:00
Sheik Anwar Shabic Y
49cc227c2c securemsm-kernel : Unload hdcp1 when all instances are closed
Unload hdcp1 TA when all client instances are closed.

Change-Id: I8d25d0609e54fc1cba99e78ceec2d437203b27ba
Signed-off-by: Sheik Anwar Shabic Y <quic_sheikanw@quicinc.com>
Signed-off-by: Linux Image Build Automation <quic_ibautomat@quicinc.com>
2023-07-11 15:34:20 -07:00
Linux Image Build Automation
2c6e46cfb9 Revert "securemsm-kernel : Unload hdcp1 when all instances are closed"
This reverts commit 1274b70a17.

Change-Id: I3aae6bbeb40414dfd4b224e79250a269eab0a331
Signed-off-by: Linux Image Build Automation <quic_ibautomat@quicinc.com>
2023-07-06 17:38:37 -07:00
Sheik Anwar Shabic Y
1274b70a17 securemsm-kernel : Unload hdcp1 when all instances are closed
Unload hdcp1 TA when all client instances are closed.

Change-Id: I1b8728ace7b0ddc9d0237b3247202c0c5c4228cf
Signed-off-by: Sheik Anwar Shabic Y <quic_sheikanw@quicinc.com>
Signed-off-by: Linux Image Build Automation <quic_ibautomat@quicinc.com>
2023-06-26 15:03:45 -07:00
Linux Build Service Account
b4ad3daaac Merge 986fef5bf8 on remote branch
Change-Id: Ic3fff7f991116ed3c44d213faa723db504703e3d
2023-06-21 07:59:57 -07:00
Divisha Bisht
986fef5bf8 securemsm-kernel: Enable CONFIG_QSEECOM_COMPAT for pineapple
Bzl files changes to enable CONFIG_QSEECOM_COMPAT for pineapple.
Now that ddk flag is enabled, the config can no longer be enabled
with Kbuild, instead we have to use bzl based changes to enable
it.

Change-Id: I2f1bb9bb4b78413289b7fa988a49fc7b10e7836e
Signed-off-by: Divisha Bisht <quic_divibish@quicinc.com>
2023-06-16 23:51:28 +05:30
qctecmdr
f611793ab5 Merge "securemsm-kernel: smmu-proxy: Remove TVM messaing log" 2023-06-16 02:35:54 -07:00
Reut Zysman
780711b60c securemsm-kernel: smcinvoke: expand API
Expand SMCInvoke API to support possible
future requirements.

Change-Id: I9f6031751489c43a27afc2860a1cb9f87c7ebb87
Signed-off-by: Reut Zysman <quic_rzysman@quicinc.com>
2023-06-15 07:26:07 -07:00
Nitin LNU
cdef6720fe securemsm-kernel: Enable Qseecom driver by default
Enable qseecom driver by default to compile on all chipset
in parallel with Qseecom-compat enable.

Change-Id: I3dd3aa2864c41196197f0770020225fa36f088c1
Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
2023-06-15 00:31:14 -07:00
Divisha Bisht
3983090d0e securemsm-kernel: Moving qseecom headers to securemsm-kernel
Move qseecom headers to securemsm-kernel. Also, cleanup and split
of qseecom header done based on usage.
These qseecom headers are now exposed to userspace as
qseecom_kernel_headers.
All the other changes are to take care of compilation dependencies
from the above.

Tests: Tested in device with local build with qseecom sampleclient
cmds.

Change-Id: I55442ce7380636a2630c2e372099735fec0756a8
Signed-off-by: Divisha Bisht <quic_divibish@quicinc.com>
2023-06-13 17:34:45 +05:30
Chris Goldsworthy
53116dd965 securemsm-kernel: smmu-proxy: Remove TVM messaing log
Remove a log on the TVM when we receive a message in the proxy driver.

Change-Id: Ib7197eee830d0cf86b62893949cb6356c4a7b951
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-06-08 15:47:53 -07:00
Gaurav Kashyap
de989fe1a3 qcedev: support for additional offload pipes
Add support for two additional offload pipes.
1 new HLOS_HLOS pipes.
1 new HLOS_CPB pipe.

Change-Id: Ia9acf3cbdf9c1f148dbddc9426d51ade0d26ff75
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-06-08 11:34:25 -07:00
Gaurav Kashyap
e0e07de5fd qcedev: check crypto status before unlocking
Whenever there is a crypto error, the pipe is reset which
in turn resets the crypto core. When the pipe is reset wait
for it to complete by monitoring the crypto status.

Change-Id: Id79838e517df491b8062ec379baff2407fea500c
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-06-06 10:17:16 -07:00
Gaurav Kashyap
ed0eab9c68 sec-kernel: move uapi securemsm headers to uapi path
Move the securemsm-kernel uapi headers to a uapi include path,
to conform with the uapi requirements.

NOTE: Duplicating qcedev.h & smcinvoke.h temporarily until
clients that manually include the path use the exported headers.

Change-Id: I33d390954ff0e6c721a5fa8256b431020e4f8912
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-06-05 09:47:37 -07:00
qctecmdr
71c22e9af9 Merge "Misc: hdcp : Add smcinvoke support for hdcp driver" 2023-05-31 08:49:34 -07:00
Sarthak Patidar
1efb70736f Misc: hdcp : Add smcinvoke support for hdcp driver
Change-Id: I76b0e8f24df7f3e36288b1383fc7203bb295c181
Signed-off-by:Sarthak Patidar <quic_spatidar@quicinc.com>
2023-05-30 21:33:34 -07:00
Gaurav Kashyap
33d4df25bc qcedev: increase timeout for non-offload requests
Increase the wait timeout for non-offload requests as
there are no expected failures such as timer or pause
events like in the offload pipes. This way, corner case
race scenarios are avoided.

Change-Id: I0be3a3d1807710bb8f0427f88bfee9144591a685
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-05-23 15:24:15 -07:00
Linux Build Service Account
eb33c973df Merge 319ca50656 on remote branch
Change-Id: I983c3ae778ff55a1cb089ead4fc4e8cf8a60b02e
2023-05-19 19:09:14 -07:00
Amirreza Zarrabi
11d07e1a50 securemsm-kernel: smcinvoke: Add argument to choose to retry the EBUSY
The synchronous release may happen in the path of callback response.
The retry may unnecessarily be resulted in callback response timeout.

Run concurrently to evaluate the test:
smcinvoke_vendor_client -i /data/smplap64.mbn 5 1
smcinvoke_vendor_client -c /data 1

Change-Id: Idefca46a34fd72c867e3cba616d30985af40ffe4
Signed-off-by: Amirreza Zarrabi <quic_azarrabi@quicinc.com>
2023-05-17 14:03:19 -07:00
Nitin LNU
f7797f7c04 securemsm-kernel: Limit frequency of log from tzcb
Limit the rate of logs from tzcb by printing one out of 5 logs
of retries.

Change-Id: I4138ab3c4a3d8fa92ef045e9e5c7e7919253823c
2023-05-16 10:34:39 -07:00
Amirreza Zarrabi
319ca50656 securemsm-kernel: smcinvoke: fix the duoble release for memobj.
If the server dies, the memobj would be released two times.
Assuming, one instance is already held by the server which
is not true.

Change-Id: I609b1e5f64648736d26c2e780aefcf7f2db64729
2023-05-14 14:57:54 -07:00
Anmolpreet Kaur
b1c6f1e933 securemsm-kernel: smcinvoke: Release map objs if invoke call fails
If invoke call fails due to some reason, map objects created
for memory objects should also be released. Failing to do so,
creates a memory leak as TZ is unaware of these objects and
no one calls release on these.

Change-Id: If5c48b810192553e3a216a0c3671f98a79bb2b59
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2023-05-08 22:03:07 +05:30
qctecmdr
3a48ee6708 Merge "securemsm-kernel: Compile the SMMU proxy driver with Bazel" 2023-04-26 22:26:35 -07:00
Chris Goldsworthy
2b0e36e377 securemsm-kernel: Compile the SMMU proxy driver with Bazel
Compile the SMMU proxy driver with Bazel.

Change-Id: I3323e2a6fec620354c4f9a6de1270ba9155998af
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-04-24 18:33:01 -07:00
Linux Build Service Account
e50fe3fc15 Merge e1ee568286 on remote branch
Change-Id: Ie4612f83c78f2d96366da4436a6b685858e429e7
2023-04-19 09:58:53 -07:00
Chris Goldsworthy
e1ee568286 securemsm-kernel: smmu-proxy: Add custom fault handler
Add a custom fault handler for the SMMU proxy driver.

Change-Id: I155a047abb8899ba3458abd9bd48774965d339be
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-04-14 15:57:07 -07:00
Chris Goldsworthy
cc26427c40 securemsm-kernel: smmu-proxy: Zero the buffers on map and unmap
Zero the proxy buffers on mapping and unmapping them.

Change-Id: I3629f1333420aeefb4d0a6be8ad666d3e1dbc601
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-04-14 15:57:07 -07:00
Chris Goldsworthy
f2c054e049 securemsm-kernel: smmu-proxy: Move mapping state check
Proxy map calls on a locked and already-mapped buffer should succeed.
Re-arrange state checks in retrieve_and_iommu_map() to ensure this.

Change-Id: Ia14c565f2b6ba6ab97c5d4aca595b5ed707b5efb
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-04-14 15:57:07 -07:00
Chris Goldsworthy
cfb354651f securemsm-kernel: smmu-proxy: Fix CSF version caching code
We're not caching the CSF version despite intending to - fix this.

Change-Id: Iaf95c39eb0c3cade36a4c12454bb12fcd7becc74
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-04-14 15:57:07 -07:00
Chris Goldsworthy
d71f8c3401 securemsm-kernel: smmu-proxy: Return error on map failure
Return the failure code from the remote VM when smmu_proxy_map()
fails.

Change-Id: I7a7a8a5930275ce13e2bfea38365b878fba534bd
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-04-14 15:57:07 -07:00
Gaurav Kashyap
46f6032141 securemsm-kernel: qcedev & qrng bazel support
Support to build qcedev and qrng modules using
Bazel.

Change-Id: I4411d208f294cdc014280d4da1a211b72d862d53
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-04-10 11:10:55 -07:00
Vikas Kumar Sharma
61a4a72db8 securemsm-kernel: smcinvoke: Fix KW Errors
Fix usage of un-initialized variables , dereferencing of pointer after NULL check

Change-Id: I36afeaefa7f7c524fd0165420140e80ee5580503
2023-04-06 08:40:23 -07:00
Nitin LNU
8083b9b690 smcinvoke: No need maintain bridge_created by others flag.
Ref_count should be with shmbridge and shmbridge should
maintain real owner and ref_count info as smcinvoke is a
client it should blindly do register and deregister.

Change-Id: Ib9400af0db1abafa7c6262e7cd80c8ae301a4ed1
Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
2023-04-06 00:08:48 -07:00
Rohit Soneta
f76193ca96 securemsm-kernel: expose ITrustedCameraDriver header file
expose ITrustedCameraDriver header file to camera so
that camera kernel driver can trigger protect/unprotect calls.

Change-Id: I4301fc3d676e4bc12fde5a5af0bd61f6a63988aa
2023-03-22 00:18:32 -07:00
Linux Build Service Account
2b7fe69bbb Merge 08b81d2108 on remote branch
Change-Id: Ib8348135121f6f7f1505a31cca7324768fd3f9a4
2023-03-20 15:34:50 -07:00
Reut Zysman
8e63104cd2 SMCInvoke: memory object optimization for CB use case
Add support for map opjects to be written into the
async side channel also for the use case where memory
objects are created as a result of a CB request.

Change-Id: I63798d92e40127fe842c08b892d734134f792dd9
Signed-off-by: Reut Zysman <quic_rzysman@quicinc.com>
2023-03-19 07:03:32 -07:00
qctecmdr
5714474f00 Merge "qcedev: vote for crypto clocks during module close" 2023-03-16 23:58:51 -07:00
qctecmdr
6d6e9b77b7 Merge "securemsm-kernel: smcinvoke: Move TZ min buf size to header file" 2023-03-14 20:08:30 -07:00
qctecmdr
467996557d Merge "Securemsm-kernel:hdcp bazel support" 2023-03-14 12:36:13 -07:00
Gaurav Kashyap
53d80a5fca qcedev: vote for crypto clocks during module close
When qcedev module is exiting, it disconnects SPS.
At this times, crypto clocks need to be turned on
or it will cause a synchronous abort.

Tests: rmmod on the qcedev module.

Change-Id: I1721fe408392ef81b07a6c08d2196b2413ba2b2f
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-03-14 11:49:05 -07:00
Sarthak Patidar
2b906f4c2f Securemsm-kernel:hdcp bazel support
Steps to test

1. Create symlink
    cd kernel_platform
    mkdir techpacks
    cd techpacks
    mkdir securemsm-kernel
    cd securemsm-kernel
    ln /vendor/qcom/open-source/securemsm-kernel/* .

2. To compile

   cd kernel_platfrom
   tools/bazel run  --lto=thin //techpacks/securemsm-kernel:pineapple_consolidate_securemsm-kernel_dist

  Test done::
   Able to compile hdcp DLKM and able to install it at

   out/target/product/<target>/dlkm/lib/modules

Change-Id: Ic2ab2656bd6434944583a12f54920e3db6c15f2d
2023-03-13 19:59:03 -07:00
qctecmdr
08b81d2108 Merge "securemsm-kernel: smmu-proxy: Add full drivers" 2023-03-13 17:21:28 -07:00
Chris Goldsworthy
4b658ee6ce securemsm-kernel: smmu-proxy: Add full drivers
Add the full drivers for the PVM and TVM.

Change-Id: I3046306fff91670928c750ffa31db02bd0240c9c
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-03-09 21:52:47 -08:00
Anmolpreet Kaur
50fd822191 securemsm-kernel: smcinvoke: Move TZ min buf size to header file
Move SMCINVOKE_TZ_MIN_BUF_SIZE to header file so that it can
be used by userspace modules.

Change-Id: I1f690c2507c6694175c317fe14fcca21cc907714
2023-03-09 14:42:17 -08:00
Reut Zysman
b56eed703e SMCInvoke: limit excessive logging
Use printk_ratelimit() to limit the logs
indicating that secure side is busy,
that the sever state was set to defunct,
and other logs that may be printed frequently.

Change-Id: I93c64bfa65cc2f499cabff3fd26b74764269b6f6
Signed-off-by: Reut Zysman <quic_rzysman@quicinc.com>
2023-03-08 10:34:36 -08:00
Amanpreet Kaur
cad389e7ff tz_log: Make creation of directories dependent on whether hypervisor is enabled.
Disable creation of hyp_general, hyp_log and rm_log directories if hypervisor is disabled.

Change-Id: I5a7b73dd9dbda9c438d99b1e644a201367eb124f
2023-03-02 02:48:46 -08:00
Smita Ghosh
71bed607f8 qseecom: Fix qseecom driver for latest target.
Replace DMA_BUF_MAP with IOSYS_MAP Conditionally
based on kernel version.
Add break/fallthrough after every case.
Add return in all the return path.
Import DMA_BUF.

Change-Id: I67c5b477d1f3a44456789dc37ab7ff7ab1ae905b
2023-02-28 07:55:01 -08:00
Nitin LNU
b87455c99c securemsm-kernel: smcinvoke: Call object release sync once before adding to queue
call release tz object in sync manner
only in case of EBUSY add
object in to post process list, so that we can retry
and process it later in a seprate kthread.

Change-Id: I2158b3faa5c41d2f10ed532c50c9c6b113961c57
2023-02-28 03:11:03 -08:00