Add support for passing keyslot usage to SE-Server

This patch adds support for passing keyslot usage to SE-Server

Bug 5236776

Change-Id: Iafa6ec15daff6f2acefad207e8b1939f656d7d3f
Signed-off-by: Surajit Karmakar <skarmakar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3348146
(cherry picked from commit f438b482a173bc745af46fe5b08f10a806b43a2f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3361963
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Sriharsha Allenki <sallenki@nvidia.com>
Reviewed-by: Vipin Kumar <vipink@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: Khushi . <khushi@nvidia.com>
Reviewed-by: Leo Chiu <lchiu@nvidia.com>
This commit is contained in:
Surajit Karmakar
2025-04-23 23:34:06 +05:30
committed by Jon Hunter
parent 2085a29b32
commit a7b08a9c27
4 changed files with 6 additions and 0 deletions

View File

@@ -396,6 +396,7 @@ struct tegra_virtual_se_addr64_buf_size {
struct key_args { struct key_args {
uint8_t keyslot[KEYSLOT_SIZE_BYTES]; uint8_t keyslot[KEYSLOT_SIZE_BYTES];
uint32_t key_usage;
uint32_t key_instance; uint32_t key_instance;
uint32_t key_grp_id; uint32_t key_grp_id;
uint32_t token_id; uint32_t token_id;
@@ -1110,6 +1111,7 @@ int tegra_hv_vse_allocate_keyslot(struct tegra_vse_key_slot_ctx *key_slot,
ivc_tx->cmd = TEGRA_VIRTUAL_SE_CMD_ALLOC_KEY; ivc_tx->cmd = TEGRA_VIRTUAL_SE_CMD_ALLOC_KEY;
memcpy(ivc_tx->keys.keyslot, key_slot->key_id, KEYSLOT_SIZE_BYTES); memcpy(ivc_tx->keys.keyslot, key_slot->key_id, KEYSLOT_SIZE_BYTES);
ivc_tx->keys.key_usage = key_slot->key_usage;
ivc_tx->keys.key_grp_id = key_slot->key_grp_id; ivc_tx->keys.key_grp_id = key_slot->key_grp_id;
ivc_tx->keys.token_id = key_slot->token_id; ivc_tx->keys.token_id = key_slot->token_id;
g_crypto_to_ivc_map[node_id].vse_thread_start = true; g_crypto_to_ivc_map[node_id].vse_thread_start = true;

View File

@@ -48,6 +48,7 @@ struct tegra_vse_membuf_ctx {
struct tegra_vse_key_slot_ctx { struct tegra_vse_key_slot_ctx {
uint8_t key_id[KEYSLOT_SIZE_BYTES]; uint8_t key_id[KEYSLOT_SIZE_BYTES];
uint8_t key_usage;
uint8_t token_id; uint8_t token_id;
uint8_t key_instance_idx; uint8_t key_instance_idx;
uint32_t key_grp_id; uint32_t key_grp_id;

View File

@@ -215,6 +215,7 @@ static int tnvvse_crypto_allocate_key_slot(struct tnvvse_crypto_ctx *ctx,
memset(&key_slot_params, 0, sizeof(key_slot_params)); memset(&key_slot_params, 0, sizeof(key_slot_params));
memcpy(key_slot_params.key_id, key_slot_allocate_ctl->key_id, KEYSLOT_SIZE_BYTES); memcpy(key_slot_params.key_id, key_slot_allocate_ctl->key_id, KEYSLOT_SIZE_BYTES);
key_slot_params.key_usage = key_slot_allocate_ctl->key_usage;
key_slot_params.token_id = key_slot_allocate_ctl->token_id; key_slot_params.token_id = key_slot_allocate_ctl->token_id;
key_slot_params.key_grp_id = ctx->key_grp_id; key_slot_params.key_grp_id = ctx->key_grp_id;
err = tegra_hv_vse_allocate_keyslot(&key_slot_params, ctx->node_id); err = tegra_hv_vse_allocate_keyslot(&key_slot_params, ctx->node_id);

View File

@@ -127,6 +127,8 @@ enum tegra_nvvse_cmac_type {
struct tegra_nvvse_allocate_key_slot_ctl { struct tegra_nvvse_allocate_key_slot_ctl {
/** [in] Holds the key id */ /** [in] Holds the key id */
uint8_t key_id[KEYSLOT_SIZE_BYTES]; uint8_t key_id[KEYSLOT_SIZE_BYTES];
/** [in] Holds the key usage */
uint8_t key_usage;
/** [in] Holds the token id */ /** [in] Holds the token id */
uint8_t token_id; uint8_t token_id;
/** [out] Holds the Key instance index */ /** [out] Holds the Key instance index */