Commit Graph

162 次程式碼提交

作者 SHA1 備註 提交日期
Linux Build Service Account
eb33c973df Merge 319ca50656 on remote branch
Change-Id: I983c3ae778ff55a1cb089ead4fc4e8cf8a60b02e
2023-05-19 19:09:14 -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
qctecmdr
9b418d37e6 Merge "securemsm-kernel: Meet external module dependency with bazel" 2023-02-27 17:06:47 -08:00
Smita Ghosh
d45cf2d3bf securemsm-kernel: Meet external module dependency with bazel
Make required changes to satisfy external module dependency.
This gives flexibilty for external modules to include
*.h
linux/*.h

Change-Id: I68c5a5842f84622b85da0056f998775f89e6eebf
2023-02-24 14:44:34 -08:00
Indranil Pradhan
af72396c96 sec-kernel:Removed name from log message.
Removed name from log message
Test:Compiled and boot up tested.

Change-Id: Ia5c21710a63bb2e461259cf07951c579c3c95bee
Signed-off-by: Indranil Pradhan <quic_ipradhan@quicinc.com>
2023-02-24 08:48:26 -08:00
qctecmdr
e5d8b50bfd Merge "smcinvoke: ADCI methods call on rootEnv" 2023-02-22 08:33:06 -08:00
Pawan Rai
d0ede8a88c smcinvoke: ADCI methods call on rootEnv
Change adci methods call on rootEnv from clientEnv as per
QTEE implementation.

Change-Id: Ib1ca4312844f6f3dedbfb639e5b83f71d97ecc68
2023-02-22 10:49:11 +05:30
qctecmdr
05197c5c16 Merge "securemsm: Add support for Bazel/Kleaf" 2023-02-17 09:43:39 -08:00
Linux Build Service Account
6df11978f4 Merge 17a1e87fc9 on remote branch
Change-Id: I263c651a37435f8d70b3c205d04e0a6edbefdd74
2023-02-17 05:02:11 -08:00
qctecmdr
ef1d604ba1 Merge "securemsm-kernel: Add the base SMMU proxy driver" 2023-02-16 12:09:40 -08:00
qctecmdr
d6fffd66ea Merge "securemsm-kernel: Add the UAPI headers for the SMMU proxy driver" 2023-02-16 10:42:42 -08:00
Smita Ghosh
3c9e16a3e9 securemsm: Add support for Bazel/Kleaf
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

3. Test done:

   Able to compile smcinvoke/tz_log/qseecom DLKM and able to install it
   at
   out/target/product/<target>/dlkm/lib/modules

Change-Id: I8258a1351281a0acb05a2e909bbc421d576b4ee0
2023-02-16 09:23:37 -08:00
Manjunatha Madana
4924ac3c04 securemsm-kernel:Fix Compilation errors for Android U Auto gen3
Test : Tested build compilation.

Change-Id: I3640f42467fbfb6fa1b139974654f20d9b1b9f48
2023-02-07 00:30:34 -08:00
Chris Goldsworthy
e9c5417cdd securemsm-kernel: Add the base SMMU proxy driver
Add the base of the SMMU proxy driver for Android. The proxy driver
will take memory from the PVM, share it with the TVM and map it into
an S1 context bank on the TVM, before returning an IOVA for the mapped
buffer.

This patch intended to create the driver to allow other kenrel modules
to compile against it.

Change-Id: Id2951fbf467fcce0a3f1a1c45eba5b041f76f080
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-02-02 17:43:53 -08:00
Chris Goldsworthy
08b1eb82e2 securemsm-kernel: Add the UAPI headers for the SMMU proxy driver
Add the UAPI headers for the SMMU proxy driver and make them usable in
Android.

Change-Id: Ibea130d79631f4d973e957a43dffde27fc472035
Signed-off-by: Chris Goldsworthy <quic_cgoldswo@quicinc.com>
2023-02-02 17:41:37 -08:00
Gaurav Kashyap
17a1e87fc9 qcedev: Port missing 13.1 changes to 14.0.
qcedev: enable/disable bam irqs during clocks
qcedev: fix null pointer dereference in qcedev_release
qcedev: delete request from list if it gets timed out
qcedev: Fix for some coding errors

Test: OEMCrypto tests.

Change-Id: I3c97890963b113d8287f9159adcd192f7be9790f
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-02-01 13:00:22 -08:00
Pawan Rai
ca9f562c5a smcinvoke: adci interface adaptation as per QTEE
Adapted the latest IClientEnv adci and other
interface methods from QTEE.
Change-Id: I05730e56d656977fbc53a2d3dedb04426474be1c
2023-01-29 10:58:20 -08:00
Linux Build Service Account
2e34344bd1 Merge a7350ce560 on remote branch
Change-Id: Iafb888033e20656723509cb97efe3bff990d79da
2023-01-27 18:03:27 -08:00
qctecmdr
703d2a9e9d Merge "qcedev: ensure sequential req_done on error" 2023-01-27 11:50:36 -08:00
Gaurav Kashyap
8f021039d5 qcedev: ensure sequential req_done on error
req_done is usually scheduled on success scenarios as
it needs to wakeup the sleep thread. However, in the
scenario where sleep has timed out, there is nothing to
wake up, and req_done can be called sequentially instead
of scheduling it (which might cause use after free).

Test: OEMCrypto tests.

Change-Id: I296076fcb43d91d16b00f08819dca45bd9049198
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2023-01-22 15:12:46 -08:00
Anmolpreet Kaur
1177b17bdb smcinvoke: Handle suspend and resume issues in smcinvoke driver
This change makes changes to smcinvoke driver to handle suspend and resume
scenarios. If the accept thread gets interrupted, do not set the server state
as defunct if the thread is in freezing state, i.e. if the thread is going in
suspend. In such cases, increase timeout of that server so that invoke thread
waits indefinitely for response from userspace until the system resumes back.

Tests:
1. Stability testing has been done on kalama.
2. smcinvoke vendor client testing is done on pineapple.

Change-Id: Iaa7b91d6ed484305349c04468263919e26a3316d
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2023-01-18 17:10:02 +05:30
Reut Zysman
a7350ce560 SMCInvoke: memory object optimization
Add support for map objects to be written into the async
side channel rather than have to be explicitly asked for
by QTEE.

Change-Id: Ia1c56555dc3a6422f4fb448f94f73fef661ac89d
Signed-off-by: Reut Zysman <quic_rzysman@quicinc.com>
2023-01-12 08:48:09 -08:00
Amirreza Zarrabi
e354297278 smcinvoke: remove global lock around the call to QTEE.
Change-Id: I741c44fce96e168e69eb4ee9d3ca5081ee6af89b
Signed-off-by: Amirreza Zarrabi <quic_azarrabi@quicinc.com>
2023-01-10 16:04:51 -08:00