Wykres commitów

62 Commity

Autor SHA1 Wiadomość Data
Gaurav Kashyap
795df801dd qcedev: concurrency support in crypto driver
Support to have multiple qcedev requests at a time in
the driver.

Change-Id: I2ba8f22e2b659db04db348dfa3b06b70bf234d0b
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-08-01 09:17:50 -07:00
Patrick Daly
3c241f3b30 securemsm-kernel: Fix compilation errors with CONFIG_FTRACE=n
smcinvoke.c:578:10: error: implicit declaration of function 'kthread_should_stop'
while (!kthread_should_stop()) {

smcinvoke.c:617:43: error: implicit declaration of function 'kthread_run'
smcinvoke[i].postprocess_kthread_task = kthread_run(

Change-Id: Id6a8b6844ec7ae00b55c81d3760a91da9d49a9ad
Signed-off-by: Patrick Daly <quic_pdaly@quicinc.com>
2022-07-29 20:56:57 -07:00
qctecmdr
87cf5b684b Merge "qcedev: Added qce50 compilation for qcedev driver" 2022-07-28 23:10:30 -07:00
qctecmdr
7b72e440ac Merge "securemsm-kernel: Create device node of smcinvoke later" 2022-07-27 22:19:30 -07:00
Anvisha
0d26cf953e qcedev: Added qce50 compilation for qcedev driver
This change will compile and generate qce50 object
only when QCEDEV(QTI Crypto Engine driver) is
compiled.

Test: Nominal, Stress, Adversial and Repetitive Test passed.

Change-Id: I00f41c825d516dcf6e974a7e0333899a746f696f
Signed-off-by: Anvisha <quic_anvisriv@quicinc.com>
2022-07-27 13:16:10 +05:30
wenji
0841f5d4c3 securemsm-kernel: Create device node of smcinvoke later
Because the device node of smcinvoke is published at the
beginning of the smcinvoke_probe(), the device node will
be ready while the smcinvoke is not initialized completely.
Hence the smcinvoke_release probably is called when the
smcinvoke driver is not ready. this case will lead to
smcinvoke crash issue.

To avoid this concurrency issue, we create the device node
at the end of the smcinvoke_probe.

Change-Id: I930685a24fb744893017c90c1881f13e2f2c3d7c
Signed-off-by: wenji <quic_wenji@quicinc.com>
2022-07-26 10:38:18 +08:00
Gaurav Kashyap
79b3d0e377 qcedev: vote for clocks based on dts values
Use DTSI values to vote for clocks instead of using
fixed values. This enables to vote for crypto clocks
on a per target basis.

Change-Id: I05c9e55f4aa0ec876903f1963f859ecf1fc929ab
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-07-18 08:10:30 -07:00
wenji
1bdcb08f83 securemsm-kernel: Postpone the shambridge created by smcinvoke
1. When there is a large shambridge memory which is not
   deleted in time, The shambridge in QTEE might be out of
   memory. we met this issue in the TVM TUI unit test.

  TrustedUISampleTest -vm  --gtest_filter=*Basic_TUIStartStop*

2. To avoid being out of shambridge memory, we should postpone
   the deletion of shambridge created by smcinvoke itself.

Change-Id: I2ef837339881c1dcd78a0da10fc848488c9819ca
Signed-off-by: wenji <quic_wenji@quicinc.com>
2022-07-18 11:56:34 +08:00
qctecmdr
a3079924a2 Merge "securemsm-kernel: Post process shmbridge delete and object release" 2022-07-06 17:51:50 -07:00
qctecmdr
cb8f5bd80b Merge "securemsm-kernel:Changing the kernel error messages to Info message for scm_call" 2022-07-06 15:24:05 -07:00
Gaurav Kashyap
63658ee1fd qcedev: reduce wait timeout for crypto operations
Current wait times for crypto is too high which might cause
concurerency issues for other EEs. Reduce this to what is
required.

Also, reset the offload error for every new IOCTL call.

Change-Id: I43dd2e59e3f30706c87cdc4f633d8132dc8410c9
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-07-05 10:47:15 -07:00
Indranil Pradhan
236cdfb109 securemsm-kernel:Changing the kernel error messages to Info message for scm_call
Changing the kernel error messages to Info message for unsupported sys-call in TZ.
Test: Compiled tested and validated on device.

Change-Id: Iced52a7c0ac40717de11d6b07923d414b380c40f
2022-06-29 17:03:46 +05:30
Nitin LNU
e2231d0fe2 securemsm-kernel: Post process shmbridge delete and object release
1.When the QTEE is busy with a high concurrency, the objects and shared
memory bridge will not be released and deleted in time, this will lead
to memory leakage issues in the QTEE.
2.To avoid the memory leakage in case of EBUSY, we add 2 exclusive worker
threads to postprocess the object release and shmbridge deletion
separately.

Change-Id: I94c656d191d5098f1c093650e4321e6b5353e45e
Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
2022-06-23 22:32:26 -07:00
Gaurav Kashyap
cc0d815923 qce: changes for non offload usecases
With the offload implementation, there are a couple of issues
for non-offload usecases.

1. Set config and offload op parameters correctly for non-cipher
usecases.
2. Due to default wait value, there is a crypto operation irrespective
of previous errors, fix that.

Change-Id: Idba55b3603349b7ad831eccd6ee25c98b1df5de6
2022-06-13 14:54:22 -07:00
Gaurav Kashyap
c7859ce020 qce: add null pointer checks and correct return vals
1. Currently, each request api sometimes returns 0 even
when an error has occured. This will result in unecessary
crypto requests when failures are expected.
2. The request callback handlers does not check handles to
be NULL before accessing. Fix to add NULL handling.

Change-Id: Ia44e353bdb75434dfbc0e3ec0582abc0208be6a7
2022-06-10 15:14:11 -07:00
qctecmdr
4cc3edff47 Merge "qce: stability and performance improvements" 2022-06-08 23:23:09 -07:00
qctecmdr
4287580d4c Merge "securemsm-kernel: Enable/Disable DLKM" 2022-06-07 17:54:26 -07:00
Gaurav Kashyap
ab140f0f11 qce: stability and performance improvements
1. There is no need to vote for high bandwidth for every
ioctl operation, Instead, vote only when a new device
node is opened (which translates to a new session from
a userspace point of view).
2. Fix the way BAM pipes are reset when there is a crypto
operation by initializing it correctly through the SPS
BAM framework.
3. Checking crypto status for every request is performance
heavy. Remove these checks and read status only on
error conditions.

Change-Id: Ibb3607ecb6919f563b00a9a8cd6f5440a8c3940a
2022-06-07 17:36:18 -07:00
Bruce Levy
995c3731b7 smcinvoke: Fix mutex lock and unlock
Acquire lock before delete_cb_txn_locked.
This API expects the lock is aquired before calling it
release the lock afterwards.

Also rename the api with_locked to state that api
needs to be called on locked mutex.

Change-Id: I6384ff60004da90b46904823e399c62c55ea4273
2022-06-07 08:26:27 -07:00
Divya Sharma
6d6aad924f securemsm-kernel: Enable/Disable DLKM
Control DLKM using TARGET_ENABLE_DLKM.
During early bring when most of the modules are not ready
either due to missing header or other reasons. Its good idea
to keep it disabled until its fully ready.

Change-Id: I421f7329cd84d53b3233cea96b0e1920de9d39ea
2022-06-07 08:21:19 -07:00
qctecmdr
c1203ba9a0 Merge "qcedev: assign pattern info correctly" 2022-06-02 12:00:54 -07:00
Jeevan Shriram
0dfcefe3d7 securemsm: Add securemsm module loading during recovery
Add support for loading securemsm module to be loaded during
recovery to avoid unknown symbols error for other dependent drivers.

Change-Id: I477b69cc649ed6b40d0f22a695a25a8d674328f2
2022-05-31 23:02:25 -07:00
Gaurav Kashyap
3f33efa2c9 qcedev: assign pattern info correctly
When non-pattern tests are run after pattern tests, there is
stale data from previous tests that never get erased, which
depending on crypto behavior might cause decrypt discrepancies.
Make the change to correctly set the pattern info to the
command descriptors.

Also, convert all debug logs to pr_info to avoid flooding serial
when QCE_DEBUG is enabled.

Change-Id: Ib84f4025263c622d6e51a47fc147856049bd75d4
2022-05-26 12:29:47 -07:00
Nicholas Pelham
e6550eb67e securemsm-kernel: Export get_client_env_object
Expose basic smcinvoke support for kernel clients.

Change-Id: I754ff56c8c20579d5c824170d0e1b61d0a22535c
2022-05-24 13:47:44 -07:00
Pavan Bobba
d577197ff2 smcinvoke : file private data validation which is sent by userspace
a validation added to check  whether retrieved struct smcinvoke_file_data
inside the function get_server_id belongs to g_smcinvoke_fops or not.

Change-Id: I50bce93ab89759b4fdcb76e41f699d8199771fbd
Signed-off-by: Pavan Bobba <quic_pav@quicinc.com>
2022-05-23 00:03:42 -07:00
qctecmdr
56d39957f0 Merge "smcinvoke: SHM create/delete handling in memory objects" 2022-05-17 10:02:22 -07:00
Pavan Bobba
828d87565b smcinvoke: SHM create/delete handling in memory objects
simplify handling of shm bridge create and delete
Signed-off-by: Pavan Bobba <quic_pav@quicinc.com>

Change-Id: I231d982ff27725bd20efc0080c6871f079e1be2a
2022-05-17 14:19:00 +05:30
Indranil Pradhan
0d3eabb246 securemsm-kernel: Removal of export error and ununsed variable.
Disabling export error and commenting out ununsed variable
which will be resolved with correct export symbol in future.
Test: Compile tested for complete apps build.

Change-Id: I51c45b522de1437d341c7b3fce0aaa82fd233e55
2022-05-16 12:38:00 +05:30
Jeevan Shriram
ce09152acc smcinvoke: Add MODULE_IMPORT_NS for smcinvoke driver
Add MODULE_IMPORT_NS for smcinvoke driver to ignore consider it as as
filesystem and not a driver.

Change-Id: I839b972f68f45f184f6a46de6779ac6adace9d38
2022-05-10 14:24:28 -07:00
qctecmdr
bada5b1dd0 Merge "securemsm-kernel: Enable qseecom module for auto platform" 2022-05-06 12:32:44 -07:00
Sonal Aggarwal
4f96dd41ec securemsm-kernel : Add new functionality in HLOS for TZ to sleep for certain
amount of time.

Change-Id: I6352bbe201ffcf81fde6ac7fc65e6f8eaeb0c64e
2022-05-06 23:28:07 +05:30
Indranil Pradhan
ac5ae74540 securemsm-kernel: Enable qseecom module for auto platform
Add support for qseecom as DLKM with basic qseecom test cases
passed except listener services.

Change-Id: I09ad0433f757d00f0902df937714132c6dff5030
2022-05-05 23:56:58 +05:30
qctecmdr
bd912a6bb3 Merge "smcinvoke: Conditionally disable DLKM" 2022-05-03 13:19:50 -07:00
Bruce Levy
0311094bc0 smcinvoke: Conditionally disable DLKM
Disable DLKM's for specific target as for that target these
DLKM's comes as kernel modules.

Change-Id: Ie6a53add3e6ebc17e662f3b564cade7e7f284020
2022-05-02 13:40:22 -07:00
Gaurav Kashyap
64e85a3b4a qcedev: add gpce key pause error conditions
Add support in the qcedev driver to detect KEY_PAUSE
error conditions and report accordingly to userspace.

Change-Id: Id7bbde02ca4d08917bcf21d6f62e21f3c71abc7b
2022-04-14 22:19:06 -07:00
Nitin LNU
d1d7d597d6 smcinvoke: take lock again in free_mem_obj_locked
insted of premature unlock return with lock in free_mem_obj_locked
api.

Signed-off-by: Nitin LNU <quic_nlakra@quicinc.com>
2022-04-14 11:06:50 -07:00
Gaurav Kashyap
48af421629 qcedev compilation fix
Change-Id: Ib1c531b002faa1bcdc5ab306f629bb1702787a46
2022-04-13 23:37:50 -07:00
Gaurav Kashyap
31f097f988 crypto-qti: qcedev: add support for hlos offload path
Add support for HLOS offload data path in the qcedev driver
mainly to support DRM and HDCP usecases.

Changes extend the current driver to support the following.
- Register multiple pipes for different offload usecases.
- Report timer expiry errors back to userspace.
- Support different iv CTR sizes based on userspace input.
- Support new IOCTLS to support encryption, decryption and
  copy offload usecases for DRM and HDCP.

Change-Id: Ie9b74c173d0afd7b8c863ed57a68ec6e74baa9b4
2022-04-13 21:25:06 -07:00
Sheik Anwar Shabic Y
177899dde3 securemsm-kernel : Resolve external dependancy for hdcp module
Resolve external dependancy for hdcp symbols.

Change-Id: If4bad51a7aabdbb334f9e7efaa45f40f0988c857
2022-04-11 14:40:34 -07:00
Bruce Levy
5387ff0884 smcinvoke: Upgrade smcinvoke to latest
pull commits

smcinvoke: Release lock for non critical region

When entering into non critical region make sure to release the lock and
increase reference for memobj instead of holding the lock and causing
memobj not to be released when third party module using it.

smcinvoke: Add support for splitbin

Remove hard limit on the number of splitbins available.
Let the TZ decide if the reassembled binary is good for usage.
cherrypicked from I6d7b5c3154c8c362be0a6bad2da1c4687191536d

Change-Id: Ibb12bc906fb3e995928a0b51b742e8193d737ba3
2022-04-11 12:35:03 -07:00
Bruce Levy
abb78cf97c securemsm-kernel: Fix product_packages entry
Fix product_package entry for module list.

Change-Id: I48acc82fca94fc2f8c4547d5d1c600e62fa8c114
2022-04-11 10:31:24 -07:00
qctecmdr
d9e5c36524 Merge "securemsm-kernel : Correction in LF Copyright" 2022-04-11 06:42:30 -07:00
qctecmdr
01d87a3b37 Merge "securemsm-kernel: Correction in LF Copyright" 2022-04-11 06:03:10 -07:00
Griffin Stamp
31689a70c8 securemsm-kernel: compile only smcinvoke on LE
Change-Id: I13c0794a621f62165a2e6cb0eb1eb117325ee097
2022-04-05 18:26:55 -07:00
Gaurav Kashyap
7398cbd4c4 securemsm-kernel : Correction in LF Copyright for qrng.
Change-Id: I1f0b5a2b39a1bd0207a9cedcb85f5ef53e843e86
2022-04-05 18:26:21 -07:00
Phalguni Bumhyavarapu
1496aefc9e securemsm-kernel : Correction in LF Copyright 2022-03-09 15:55:32 -08:00
Ashish Pratap Singh Bhadoria
5f29ef701b securemsm-kernel: Correction in LF Copyright 2022-03-09 12:35:31 +05:30
Joseph Oh
4fa9a50df2 securemsm: Fix QCEDEV module compilation
Fix the qcedev module compilation.
2022-03-04 18:52:31 -08:00
Gaurav Kashyap
d4014194cc sec-kernel: qrng: add qrng driver support
Add the qrng driver which adds support for the kernel to utilize
QTI's PRNG hardware for RNG operations.

Change-Id: I9c9cb7f907470c88e182dc869f302e4ca83fb798
2022-02-25 14:20:50 -08:00
qctecmdr
98c4a1ab9e Merge "securemsm-kernel : Add new functionality in HLOS for TZ to sleep for certain amount of time." 2022-02-23 04:10:40 -08:00