提交線圖

100 次程式碼提交

作者 SHA1 備註 日期
qctecmdr
77a5daed43 Merge "Revert "securemsm-kernel: exposing smcinvoke headers"" 2022-12-06 14:18:38 -08:00
Spencer Willett
a785a207a2 Revert "securemsm-kernel: exposing smcinvoke headers"
This reverts commit 796ae71391.

This commit is being reverted due to build conflicts
with other teams

CRS-Fixed: 3354563

Change-Id: I915cc5bd0e718a1b82641ac02d2f0184f2fa1f37
2022-12-06 13:38:24 -08:00
Anmolpreet Kaur
b38291450d smcinvoke: Make memory objects release inline with callback objects
Release memory object from userspace when a call to release comes in
kernel to prevent the memory leaks in the cases where mem objects
are passed as a response inside a callback call.

Change-Id: I5ce57b6be90e71e255a890895d5f2859312ba1e4
Signed-off-by: Anmolpreet Kaur <quic_anmolpre@quicinc.com>
2022-11-29 12:51:24 -08:00
qctecmdr
399c8f65d0 Merge "securemsm-kernel: exposing smcinvoke headers" 2022-11-23 20:54:37 -08:00
Spencer Willett
796ae71391 securemsm-kernel: exposing smcinvoke headers
We are exposing headers present in "include/linux" for the rest of the kernel DLKM's.
These changes allow for other kernel teams to access these headers.

CRS-Fixed: 3338788

Change-Id: I5926ddeee8541398b32010db0b01af529b19fa3e
2022-11-23 09:49:37 -08:00
Smita Ghosh
111af59f67 smcinvoke: update process_tzcb_req to be more responsive
1. While waiting for callback response instead of waiting uninterruptibly for
  1sec split wait timeout to 100ms and increase number of retries to 50.

2. If a wait is interrupted due to signal, continue to wait if callback server
   is in a good state.

Change-Id: I15faf27ebdb98e2df4a0c75695643a611ad9889d
2022-11-23 09:09:12 -08:00
Spencer Willett
01bb45918b securemsm-kernel : expose ITrustedCameraDriver header file
expose ITrustedCameraDriver header file to camera so that
camera kernel driver can trigger protect/unprotect call.

CRS-Fixed: 3343680

Change-Id: I011f17a93f9d7c32140835406488def34429f983
2022-11-22 15:09:19 -08:00
Gaurav Kashyap
ecc83d4090 Revert "securemsm-kernel: Disable crypto driver"
This reverts commit 5e668ad0274363663328f06b3b272802178ed175.

Change-Id: I28838e318db59bb60473f18b88cb2ad03fcf6d16
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-11-21 09:21:52 -08:00
Smita Ghosh
5233220e29 smcinvoke: Fix compilation error
With Bazel some of the warnings are now error.

Change-Id: Ie195c8bc993dce27cf5f2353a8965605ac50ae72
2022-11-16 09:09:05 -08:00
Smita Ghosh
81cf72e4ab smcinvoke: Print retry_count value
This is important to estimate how long each clients are waiting
for secure side.

Signed-off-by: Smita Ghosh <quic_smitag@quicinc.com>
2022-11-04 09:18:12 -07:00
qctecmdr
cb0e64e092 Merge "securemsm-kernel: Disable crypto driver" 2022-11-02 16:08:35 -07:00
Smita Ghosh
d85ee4d347 securemsm-kernel: Disable crypto driver
Disable the driver until sps-bam is available.

Change-Id: Ib8b52e722ce763be0292993f43c72b2dcb996cdf
2022-10-28 17:26:46 -07:00
Gaurav Kashyap
9dd79a02a6 qcedev: replace ksize with buffer sizes
Using ksize to calculate buffer sizes during memset
is causing buffer overflows due to incorrect
calculations, replace this to directly use malloced
buffer sizes.

Change-Id: I9bfdfb63022ddd18a7f39450dc96b363fb4d20c3
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-10-28 09:14:20 -07:00
qctecmdr
6552bef2e0 Merge "securemsm-kernel: Expose smcinvoke header files" 2022-10-25 10:54:24 -07:00
Spencer Willett
1633f747b3 securemsm-kernel: Move header files from securemsm-kernel/smcinvoke to securemsm-kernel/linux
Relocating three header files to the linux folder.
Updated SPDX-License-Identifier comment in each file.

CRS-Fixed: 3317072

Change-Id: I4fe6b46c9f97c0d32b573a1488c5ab48120d3b0b
2022-10-21 12:19:23 -07:00
Spencer Willett
b5191f1c61 securemsm-kernel: Expose smcinvoke header files
Using genrule and cc_library_headers we expose three smcinvoke headers.
We use Android.bp edits to accomplish this.

CRS-Fixed: 3317072

Change-Id: I1d946d5a23e22e3b525c99c7223e6109aab8c059
2022-10-21 11:49:27 -07:00
Spencer Willett
50845e2d72 securemsm-kernel: smcinvoke: update error code for Invoke failed
Return OBJECT_ERROR_BUSY if the Object is busy.
Return OBJECT_ERROR_KMEM if Out of memory.
Return OBJECT_ERROR_UNAVAIL if the request could not be processed.

Change-Id: I17b9ecd7dd817b445d84cb7d01b019497248a2a3
2022-10-19 13:55:52 -07:00
Smita Ghosh
0f28e48cbc secure-kernel: Add support for 5.15 kernel
Add following changes.

Fix switch case
  latest compiler throwing error where CASE statement does
  not have break or return under all the execution paths.

Rename size_add to size_add_
  There is a name collision between this one and one coming from
  overflow.h. Hence renaming it.

Modify IRQ handling for qce50 module

Change PDE_DATA to pde_data

Signed-off-by: Smita Ghosh <quic_smitag@quicinc.com>

Change-Id: I4226fb41df12273b45d2e114f1aad2709dc36eb7
Signed-off-by: Smita Ghosh <quic_smitag@quicinc.com>
2022-10-07 14:33:11 -07:00
qctecmdr
8a7364d25d Merge "smcinvoke: Increase MAX_RETRY" 2022-09-14 09:03:37 -07:00
venkata sateesh
cc34676b70 Securemsm-kernel: Enable qseecom for Auto GVM Platform
Add qseecom support for Auto GVM platform.

Change-Id: I9b386486961e36b571498bf6c495c8c786df64c3
Signed-off-by: venkata sateesh <quic_vencher@quicinc.com>
2022-09-13 04:10:16 -07:00
Smita Ghosh
efd4a5f0bd smcinvoke: Increase MAX_RETRY
Change-Id: Ibcc7bd8614246e44938aac338ac2c06414d3ce63
2022-09-09 13:25:47 -07:00
Divisha Bisht
b7877a0496 securemsm-kernel: Update error codes in IQSEEComCompatAppLoader.h
Error codes in IQSEEComCompatAppLoader.h updated as per the actual IDL interface in TZ

Change-Id: I407d9bccdeef1d1015f6533c78adab23267133ea
2022-09-06 17:47:23 +05:30
qctecmdr
bbd4805e6b Merge "qcedev: disable clock gating till stability issues resolved" 2022-08-26 10:34:48 -07:00
qctecmdr
13e971ba2f Merge "qcedev: hold spinlock while managing crypto errors." 2022-08-26 09:37:28 -07:00
Gaurav Kashyap
2461cc62a6 qcedev: disable clock gating till stability issues resolved
Disable the clock gating feature till some of the stability
issues concerning it is resolved.

Change-Id: I7c7832a843240a75b426ca9187fd02dc1488d0ca
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-08-25 22:39:23 -07:00
qctecmdr
a0b7e74a2a Merge "securemsm-kernel: Remove interruptable signal" 2022-08-25 22:31:52 -07:00
Gaurav Kashyap
bbca708384 qcedev: hold spinlock while managing crypto errors.
Currently, there is no lock held when doing crypto
housekeeping when a timeout occurs. Use a lock in this
scenario to avoid concurrent scenario timing errors.

Change-Id: I60c243e0dfde5a716df772177ab4cd75d9b5b7cc
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-08-25 22:18:49 -07:00
qctecmdr
391d4254eb Merge "qcedev: check num_fds during unmap" 2022-08-25 19:30:41 -07:00
qctecmdr
510e6935af Merge "Securemsm-kernel: Enable qseecom for khaje" 2022-08-25 03:36:06 -07:00
Jayasri Bhattacharyya
ccc44aff77 Securemsm-kernel: Enable qseecom for khaje
1. Add qseecom_dlkm.ko based on Khaje and AUTO arch type
2. Restructure conf file into multiple conf files
   to enable feature based conf file.

Change-Id: I8bc0472667aebc35e8d1afa37eaca5c3353fd191
Signed-off-by: Jayasri Bhattacharyya <quic_jbhattac@quicinc.com>
2022-08-24 07:32:48 -07:00
Jayasri Bhattacharyya
91e3da89cb securemam-kernel: Change the scope of CONFIG_QSEECOM
Export get_client_env_object when CONFIG_QSEECOM is enabled

Change-Id: I1a52d6e86c8bc75436df55a91759b251caeaa051
2022-08-24 05:32:20 -07:00
Gaurav Kashyap
6aec313e2a Revert "qcedev: Added qce50 compilation for qcedev driver"
This reverts commit 0d26cf953e.

Change-Id: I904eac0ef56f5851d63aee9bcb97f0585069a41e
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-08-17 15:40:27 -07:00
wenji
20f8c5a846 securemsm-kernel: Remove interruptable signal
1. When invoke thread have resumed from freezing to running or is
   killed, the interruption signals will always interrupt the
   smcinvoke callback calls. this will lead the QTEE and listener
   to be out of sync.
2. To fix this issue, we remove the signal interruption, this solution
   will prevent the smcinvoke from being out of sync.

Change-Id: I8f0cd7342784564ce12e617dc4076638f365aba9
Signed-off-by: wenji <quic_wenji@quicinc.com>
2022-08-17 06:25:20 -07:00
Gaurav Kashyap
94990a445d qcedev: check num_fds during unmap
check the num_fds passed into unmap buf ioctl,
or else it can lead to an out of bounds access.

Change-Id: Ief209a60a6b7dc1ea4be485eaf5cf51d2955a980
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-08-15 17:19:49 -07:00
qctecmdr
84e37447e5 Merge "qcedev: vote at lowsvs by default in hlos" 2022-08-11 18:36:03 -07:00
basant kumar
200b12bb33 securemsm-kernel: smcinvoke: Add explicit cache flush during callback req from TZ
During Callback request from TZ, smcinvoke in and out buffers need
explicit cache operation with legacy smcinvoke.

Change-Id: I3eacd69901c1ce117017b2d59a28dfab83b5f3f9
2022-08-11 14:43:05 +05:30
Gaurav Kashyap
2f31c15027 qcedev: vote at lowsvs by default in hlos
Since TZ already votes at nominal, voting at nominal from
HLOS will cause aggregate to cross Turbo, so vote at lowSVS
by default from HLOS.

Change-Id: I662fecfa1c8dd29e71eb3c59e2c03d58710ca387
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-08-04 12:12:20 -07:00
Nicholas Pelham
a4a925db92 securemsm-kernel: Add IClientEnv_registerWithCredentials
Use new ClientEnv register method for kernel clients

Change-Id: I3ce32788c5c7658dcaf808c00d52c32df226fec6
2022-08-01 17:24:07 -07:00
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