Commit Graph

20 Commits

Author SHA1 Message Date
Khushi
2a114f31d6 Bug Fix: Intermittent failure in NvVseTestAES
Fixed the issue caused by using common buffer in hwrng requests
which led to overwriting the buffer and mismatch during concurrent
AES operations

Bug Id: Bug 5015880

Change-Id: I52d6ae016fcc58cd9f2129d13d458d2ff9b3da59
Signed-off-by: Khushi <khushi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3273901
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: Nagaraj P N <nagarajp@nvidia.com>
Tested-by: Christoffer Arvidsson <carvidsson@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:13 +00:00
Nagaraj P N
8e33949582 vse: update device nodes per hw instance/engine
Update cryptodev device names to indicate the hw instance
and engine name.
Update implementation to allow different DT instance ids and
driver device instance IDs.

Jira ESSS-1692

Change-Id: Ib1cf91202b41276ac8342f820e170884d139090c
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3263604
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2025-07-24 10:19:13 +00:00
Khushi
9aae5199d7 vse: allocate buffer during init 2
TSEC CMAC SV
RNG
HMAC SV
CMAC SV HW verify
GCM Enc/Dec HW verify
GMAC SV HW verify

JIRA ESSS-1495

Change-Id: I9cabee686d99d3c94d46e2a72d51151ae62e7630
Signed-off-by: Khushi <khushi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3227547
Reviewed-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
2025-07-24 10:19:11 +00:00
Nagaraj P N
74e8b62f72 vse: sha: implement new sha_update API
- Initialize lock per device node and take lock at the
  start of processing of each ioctl command. This is needed
  because there is only one set of IOVA buffers allocated
  during init per device node. Without lock it leads to
  race conditions when more than one app uses the same
  device node.
- Release tfm after each API call for both sha and hmac-sha
- Validate rng buffer size provided by user
- Support buf size up to HW supported limit for GCM-Dec req
  if tag verify is supported by HW.

Jira ESSS-1517
Bug 4881474

Change-Id: I338558656ac00b91750e74990bb47c5a35f31e08
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3233377
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
2025-07-24 10:19:10 +00:00
Nagaraj P N
bc6885d338 vse: allocate dma buffers during driver init
Use dma_alloc_coherent to allocate DMA buffers during probe
instead of on per request basis for SHA/AES requests.

Bug 4637856

Change-Id: I1321b224c61d2f0cda559525b7806504943a81d7
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
(cherry picked from commit ef746fdaec135d114ce04cb7418230c86c8746c1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3213894
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
Tested-by: Khushi . <khushi@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
2025-07-24 10:19:07 +00:00
Nagaraj P N
ff7c18fc0b vse: add mempool support for GCM decryption
Jira ESSS-359

Change-Id: I1e49b331ec5be2bde208ae0fcac40d7af2fd082a
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3132632
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3191163
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-08-16 10:52:17 -07:00
Nagaraj P N
97434deea4 vse: add support for SM4 GMAC
Jira ESSS-1417

Change-Id: Ica5cdb08f04e75fba50badb9bd3342f2cd2004b9
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3172038
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-08-14 17:48:41 -07:00
Prashant Parihar
afb2145beb nvvse: Enable SM4 CMAC support
Jira ESSS-1409

Change-Id: Ib13b2901cbec8e4b9670fbe43960514e614a60c0
Signed-off-by: Prashant Parihar <pparihar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3170104
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-08-14 17:48:31 -07:00
Prashant Parihar
a21f30c983 nvvse: Add SM4 implementation
- Add VSE driver and crypto driver changes for SM4
CBC/CTR functionality
- Utilize existing function for AES CBC/CTR for SM4

Jira ESSS-1409

Change-Id: Ifaab10dd81c33b047554c28a37c399a3cb0d3419
Signed-off-by: Prashant Parihar <pparihar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3143320
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
2024-07-28 12:47:58 -07:00
Nagaraj P N
0b77774c92 vse: Add support for HMAC SHA Sign/Verify
Add support for both old and new chip

Jira ESSS-1336
Jira ESSS-1371

Change-Id: Ie4010bc7f3d8f3b71e3f49197c21911cd11a6dea
Signed-off-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3144907
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
2024-07-17 06:01:20 -07:00
Pranjal Singh Mandloi
f95a7d53c4 NVVSE: GCM/GMAC Linux changes
Jira ESSS-1378

Change-Id: Ie47a432c73cc99ae209fb4b61dfc0acbe399aaff
Signed-off-by: Pranjal Singh Mandloi<pmandloi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3163800
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2024-07-13 21:37:56 -07:00
Khushi
b7a1a14256 NVVSE SM3 Implementation
Implements SM3 in NVVSE crypto driver linux
ESSS-1346

Change-Id: I9f8b9bc18d7c30d8dac04e8f19941ef061aa8478
Signed-off-by: Khushi <khushi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3131643
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
2024-07-04 09:23:09 -07:00
Khushi
df2a7fda9c CMAC for Linux
CMAC implementation for 64 bit addressing
Remove unsupported legacy cmac function
Implemented CMAC for new chip

ESSS-1375

Change-Id: I43bc4a03b03a5914ab1e4656bef90ad179744f1a
Signed-off-by: Khushi <khushi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3146556
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Tested-by: Pranjal Singh Mandloi <pmandloi@nvidia.com>
2024-06-22 07:43:34 -07:00
Advaya Andhare
883ddf60ca NVVSE: protect shared resources through mutex
Concurrent access of shared variable causing the issue intermittently.
Conditions to wait/handle shared variable updated.
Added mutex locks to protect shared resources.

bug 4155882
Bug 4159212
jira ESSS-707

Change-Id: I3b50e39abf2dfec2ef33b813c7227fcd0634222a
Signed-off-by: Advaya Andhare <aandhare@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2928908
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-12 04:42:12 -07:00
Advaya Andhare
967fa5d4b4 NVVSE: Implement dummy-message functionality
- Introduced interrupt state for dummy message functionality
- Added functionality for dummy-message

Change-Id: I3bac031159ea9398b4515ca354fdbc2c7d4274c6
Signed-off-by: Advaya Andhare <aandhare@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913263
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913361
2023-07-12 04:42:06 -07:00
Manish Bhardwaj
ac315cf5ad nvvse: Enable Multipart/Singlepart UserNonce
crypto: hvvse: UserNonce enable for CBC/CTR

- Using SE server for CBC mode
- Updating counter for CTR mode
- Copying IV to userspace from kernelspace only for non userNonce

Jira ESSS-467

crypto: Support Multipart CBC/CTR

- Updated update_counter function
- Added support for mulitpart CBC/CTR

Jira ESSS-525

Signed-off-by: Advaya Andhare <aandhare@nvidia.com>
Change-Id: I3a85f510d28a6bd26b4b6b5b216c2659ec4052c6
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2874482
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-04-05 05:59:35 -07:00
Manish Bhardwaj
a8830def61 nvidia-oot: Increase keyslot size to 16 bytes
syncing changes b/w nvidia and nvidia-oot repo

Bug 3697677

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I0faa4d3107de5d9430ca91b407903990254e3b49
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2872402
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-03-17 10:18:08 -07:00
Advaya Andhare
9fdc09d25a nvvse: cryptodev: user nonce, TSEC alg, ivcDB
Updating Kernel 5.15 with recent linux driver changes.

Jira ESSS-504
bug 3979224

Mentioned below are the details of merging changes -

NVVSE: Added support for TSEC algorithm.

- Add support for TSEC CMAC Sign/Verify commands
- Add support for command to check TSEC Keyload status
- Don't use skip_key parameter as keyslot id is always needed by VSE driver

Jira ESSS-267

nvvse: cryptodev: Add support for user nonce

Changes:

   - Add support for userNonce and zero copy flag for
     TLS and zero copy features
   - Updaeted encrypt/decrypt function call to use
     user nonce.

Jira ESSS-415

nvvse: Updated IVCCFG offset, IVC DB parameters

- Reading max buffer size and gcm dec buffer size from DT
- Update elements of IVC DB.

Jira ESSS-417
Jira ESSS-484
Jira ESSS-468
bug 3974121

Signed-off-by: Advaya Andhare <aandhare@nvidia.com>
Change-Id: Ic7c4580dc4f443db9f7e4fabfb7ec49de2973ed3
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2862329
Reviewed-by: Rakesh Babu Bodla <rbodla@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Nagaraj P N <nagarajp@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-02-25 16:07:35 -08:00
Manish Bhardwaj
ac16d3a12b nvidia-oot: sync vse driver with nvidia repo
Using this patch we are syncing changes of
vse driver from nvidia repo to nvidia-oot repo

JIRA ESLC-7104

Change-Id: I5d45f4b645ad9c002c8f3b178fc20eb6f7324cd3
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2824196
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-12-13 06:27:05 -08:00
Manish Bhardwaj
27f17e56d1 crypto: sync crypto driver from kernel/nvidia
Using this patch we are pulling in the missing changes
from kernel/nvidia directory.

JIRA ESLC-6885

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I9376e14971be0f4d40f759858fcc9db90a7b9d72
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2785534
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2022-10-06 17:22:00 -07:00