crypto: tegra: Update crypto_engine_ctx handling

In Linux v6.6, the crypto_engine_ctx structure was removed and the
crypto_engine_ops was moved from this structure to the crypto_alg
structure. The Tegra Security Engine driver was updated accordingly to
populate the crypto_engine_ops in the appropriate structure depending
on whether the crypto_engine_ctx structure is present or not.

Currently conftest is using the presence of the crypto_engine_ctx
structure to decide where to populate the crypto_engine_ops. While
this works, it is possible that a kernel older than v6.6 also includes
a backport of commit e5e7eb023f24 ("crypto: engine - Move
crypto_engine_ops from request into crypto_alg") that moves the ops
to the crypto_alg structure. Although backporting this commit alone
should not cause any problems, it is better to detect if this commit
is present rather than relying on the presence of crypto_engine_ctx
structure.

To detect the presence of commit e5e7eb023f24 we can simply detect if
one of the functions added and exported by this commit is present.
For example, the function crypto_engine_register_aead() was added and
exported by this commit. Therefore, update conftest to detect if
commit e5e7eb023f24 is present and then update the Tegra Security
Engine accordingly.

Bug 5564561

Change-Id: I3f7688e6e954a158094a9a2fdf73354f765ed680
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499816
(cherry picked from commit c1631d32f8d80cd31f54e7297c542f308a281d25)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3508186
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
This commit is contained in:
Jon Hunter
2025-11-13 18:28:18 +00:00
committed by mobile promotions
parent bc32d4b5bd
commit 005042f3eb
6 changed files with 97 additions and 115 deletions

View File

@@ -25,7 +25,7 @@
#include "tegra-se.h" #include "tegra-se.h"
struct tegra_aes_ctx { struct tegra_aes_ctx {
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
struct crypto_engine_ctx enginectx; struct crypto_engine_ctx enginectx;
#endif #endif
struct tegra_se *se; struct tegra_se *se;
@@ -50,7 +50,7 @@ struct tegra_aes_reqctx {
}; };
struct tegra_aead_ctx { struct tegra_aead_ctx {
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
struct crypto_engine_ctx enginectx; struct crypto_engine_ctx enginectx;
#endif #endif
struct tegra_se *se; struct tegra_se *se;
@@ -81,7 +81,7 @@ struct tegra_aead_reqctx {
}; };
struct tegra_cmac_ctx { struct tegra_cmac_ctx {
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
struct crypto_engine_ctx enginectx; struct crypto_engine_ctx enginectx;
#endif #endif
struct tegra_se *se; struct tegra_se *se;
@@ -378,7 +378,7 @@ static int tegra_aes_cra_init(struct crypto_skcipher *tfm)
const char *algname; const char *algname;
int ret; int ret;
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher.base); se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher.base);
#else #else
se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher); se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher);
@@ -401,7 +401,7 @@ static int tegra_aes_cra_init(struct crypto_skcipher *tfm)
ctx->alg = ret; ctx->alg = ret;
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.prepare_request = NULL;
ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL;
ctx->enginectx.op.do_one_request = tegra_aes_do_one_req; ctx->enginectx.op.do_one_request = tegra_aes_do_one_req;
@@ -691,7 +691,7 @@ static int tegra_aes_decrypt(struct skcipher_request *req)
static struct tegra_se_alg tegra_aes_algs[] = { static struct tegra_se_alg tegra_aes_algs[] = {
{ {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_aes_cra_init, .init = tegra_aes_cra_init,
@@ -712,14 +712,14 @@ static struct tegra_se_alg tegra_aes_algs[] = {
.cra_alignmask = 0xf, .cra_alignmask = 0xf,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_aes_do_one_req, .op.do_one_request = tegra_aes_do_one_req,
#endif #endif
} }
}, { }, {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_aes_cra_init, .init = tegra_aes_cra_init,
@@ -739,14 +739,14 @@ static struct tegra_se_alg tegra_aes_algs[] = {
.cra_alignmask = 0xf, .cra_alignmask = 0xf,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_aes_do_one_req, .op.do_one_request = tegra_aes_do_one_req,
#endif #endif
} }
}, { }, {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_aes_cra_init, .init = tegra_aes_cra_init,
@@ -767,14 +767,14 @@ static struct tegra_se_alg tegra_aes_algs[] = {
.cra_alignmask = 0xf, .cra_alignmask = 0xf,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_aes_do_one_req, .op.do_one_request = tegra_aes_do_one_req,
#endif #endif
} }
}, { }, {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_aes_cra_init, .init = tegra_aes_cra_init,
@@ -794,7 +794,7 @@ static struct tegra_se_alg tegra_aes_algs[] = {
.cra_alignmask = (__alignof__(u64) - 1), .cra_alignmask = (__alignof__(u64) - 1),
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_aes_do_one_req, .op.do_one_request = tegra_aes_do_one_req,
#endif #endif
@@ -1628,7 +1628,7 @@ static int tegra_ccm_cra_init(struct crypto_aead *tfm)
algname = crypto_tfm_alg_name(&tfm->base); algname = crypto_tfm_alg_name(&tfm->base);
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base); se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base);
#else #else
se_alg = container_of(alg, struct tegra_se_alg, alg.aead); se_alg = container_of(alg, struct tegra_se_alg, alg.aead);
@@ -1648,7 +1648,7 @@ static int tegra_ccm_cra_init(struct crypto_aead *tfm)
ctx->alg = ret; ctx->alg = ret;
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.prepare_request = NULL;
ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL;
ctx->enginectx.op.do_one_request = tegra_ccm_do_one_req; ctx->enginectx.op.do_one_request = tegra_ccm_do_one_req;
@@ -1663,7 +1663,7 @@ static int tegra_gcm_cra_init(struct crypto_aead *tfm)
struct aead_alg *alg = crypto_aead_alg(tfm); struct aead_alg *alg = crypto_aead_alg(tfm);
struct tegra_se_alg *se_alg; struct tegra_se_alg *se_alg;
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base); se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base);
#else #else
se_alg = container_of(alg, struct tegra_se_alg, alg.aead); se_alg = container_of(alg, struct tegra_se_alg, alg.aead);
@@ -1680,7 +1680,7 @@ static int tegra_gcm_cra_init(struct crypto_aead *tfm)
ctx->verify_alg = SE_ALG_GCM_VERIFY; ctx->verify_alg = SE_ALG_GCM_VERIFY;
ctx->mac_alg = SE_ALG_GMAC; ctx->mac_alg = SE_ALG_GMAC;
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.prepare_request = NULL;
ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL;
ctx->enginectx.op.do_one_request = tegra_gcm_do_one_req; ctx->enginectx.op.do_one_request = tegra_gcm_do_one_req;
@@ -2112,7 +2112,7 @@ static int tegra_cmac_cra_init(struct crypto_tfm *tfm)
const char *algname; const char *algname;
algname = crypto_tfm_alg_name(tfm); algname = crypto_tfm_alg_name(tfm);
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base); se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base);
#else #else
se_alg = container_of(alg, struct tegra_se_alg, alg.ahash); se_alg = container_of(alg, struct tegra_se_alg, alg.ahash);
@@ -2126,7 +2126,7 @@ static int tegra_cmac_cra_init(struct crypto_tfm *tfm)
ctx->final_alg = SE_ALG_CMAC_FINAL; ctx->final_alg = SE_ALG_CMAC_FINAL;
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.prepare_request = NULL;
ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL;
ctx->enginectx.op.do_one_request = tegra_cmac_do_one_req; ctx->enginectx.op.do_one_request = tegra_cmac_do_one_req;
@@ -2246,7 +2246,7 @@ static int tegra_cmac_import(struct ahash_request *req, const void *in)
static struct tegra_se_alg tegra_aead_algs[] = { static struct tegra_se_alg tegra_aead_algs[] = {
{ {
.alg.aead = { .alg.aead = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_gcm_cra_init, .init = tegra_gcm_cra_init,
@@ -2266,14 +2266,14 @@ static struct tegra_se_alg tegra_aead_algs[] = {
.cra_alignmask = 0xf, .cra_alignmask = 0xf,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_gcm_do_one_req, .op.do_one_request = tegra_gcm_do_one_req,
#endif #endif
} }
}, { }, {
.alg.aead = { .alg.aead = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_ccm_cra_init, .init = tegra_ccm_cra_init,
@@ -2294,7 +2294,7 @@ static struct tegra_se_alg tegra_aead_algs[] = {
.cra_alignmask = 0xf, .cra_alignmask = 0xf,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_ccm_do_one_req, .op.do_one_request = tegra_ccm_do_one_req,
#endif #endif
@@ -2305,7 +2305,7 @@ static struct tegra_se_alg tegra_aead_algs[] = {
static struct tegra_se_alg tegra_cmac_algs[] = { static struct tegra_se_alg tegra_cmac_algs[] = {
{ {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_cmac_init, .init = tegra_cmac_init,
@@ -2330,7 +2330,7 @@ static struct tegra_se_alg tegra_cmac_algs[] = {
.cra_init = tegra_cmac_cra_init, .cra_init = tegra_cmac_cra_init,
.cra_exit = tegra_cmac_cra_exit, .cra_exit = tegra_cmac_cra_exit,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_cmac_do_one_req, .op.do_one_request = tegra_cmac_do_one_req,
#endif #endif
@@ -2338,7 +2338,7 @@ static struct tegra_se_alg tegra_cmac_algs[] = {
} }
}; };
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
int tegra_init_aes(struct tegra_se *se) int tegra_init_aes(struct tegra_se *se)
{ {
struct aead_engine_alg *aead_alg; struct aead_engine_alg *aead_alg;

View File

@@ -24,7 +24,7 @@
#include "tegra-se.h" #include "tegra-se.h"
struct tegra_sha_ctx { struct tegra_sha_ctx {
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
struct crypto_engine_ctx enginectx; struct crypto_engine_ctx enginectx;
#endif #endif
struct tegra_se *se; struct tegra_se *se;
@@ -597,7 +597,7 @@ static int tegra_sha_cra_init(struct crypto_tfm *tfm)
int ret; int ret;
algname = crypto_tfm_alg_name(tfm); algname = crypto_tfm_alg_name(tfm);
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base); se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base);
#else #else
se_alg = container_of(alg, struct tegra_se_alg, alg.ahash); se_alg = container_of(alg, struct tegra_se_alg, alg.ahash);
@@ -620,7 +620,7 @@ static int tegra_sha_cra_init(struct crypto_tfm *tfm)
ctx->alg = ret; ctx->alg = ret;
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
ctx->enginectx.op.prepare_request = NULL; ctx->enginectx.op.prepare_request = NULL;
ctx->enginectx.op.unprepare_request = NULL; ctx->enginectx.op.unprepare_request = NULL;
ctx->enginectx.op.do_one_request = tegra_sha_do_one_req; ctx->enginectx.op.do_one_request = tegra_sha_do_one_req;
@@ -767,7 +767,7 @@ static int tegra_sha_import(struct ahash_request *req, const void *in)
static struct tegra_se_alg tegra_hash_algs[] = { static struct tegra_se_alg tegra_hash_algs[] = {
{ {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -791,14 +791,14 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
} }
}, { }, {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -822,14 +822,14 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
} }
}, { }, {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -853,14 +853,14 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
} }
}, { }, {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -884,14 +884,14 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
} }
}, { }, {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -915,14 +915,14 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
} }
}, { }, {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -946,14 +946,14 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
} }
}, { }, {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -977,14 +977,14 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
} }
}, { }, {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -1008,14 +1008,14 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
} }
}, { }, {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -1039,7 +1039,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
@@ -1047,7 +1047,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
}, { }, {
.alg_base = "sha224", .alg_base = "sha224",
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -1072,7 +1072,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
@@ -1080,7 +1080,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
}, { }, {
.alg_base = "sha256", .alg_base = "sha256",
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -1105,7 +1105,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
@@ -1113,7 +1113,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
}, { }, {
.alg_base = "sha384", .alg_base = "sha384",
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -1138,7 +1138,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
@@ -1146,7 +1146,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
}, { }, {
.alg_base = "sha512", .alg_base = "sha512",
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -1171,7 +1171,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
@@ -1182,7 +1182,7 @@ static struct tegra_se_alg tegra_hash_algs[] = {
static struct tegra_se_alg tegra_sm3_algs[] = { static struct tegra_se_alg tegra_sm3_algs[] = {
{ {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sha_init, .init = tegra_sha_init,
@@ -1207,7 +1207,7 @@ static struct tegra_se_alg tegra_sm3_algs[] = {
.cra_init = tegra_sha_cra_init, .cra_init = tegra_sha_cra_init,
.cra_exit = tegra_sha_cra_exit, .cra_exit = tegra_sha_cra_exit,
} }
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sha_do_one_req, .op.do_one_request = tegra_sha_do_one_req,
#endif #endif
@@ -1301,7 +1301,7 @@ static void tegra_hash_set_regcfg(struct tegra_se *se)
int tegra_init_hash(struct tegra_se *se) int tegra_init_hash(struct tegra_se *se)
{ {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
struct ahash_engine_alg *alg; struct ahash_engine_alg *alg;
#else #else
struct ahash_alg *alg; struct ahash_alg *alg;
@@ -1316,7 +1316,7 @@ int tegra_init_hash(struct tegra_se *se)
ret = CRYPTO_REGISTER(ahash, alg); ret = CRYPTO_REGISTER(ahash, alg);
if (ret) { if (ret) {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
dev_err(se->dev, "failed to register %s\n", dev_err(se->dev, "failed to register %s\n",
alg->base.halg.base.cra_name); alg->base.halg.base.cra_name);
#else #else
@@ -1335,7 +1335,7 @@ int tegra_init_hash(struct tegra_se *se)
alg = &tegra_sm3_algs[i].alg.ahash; alg = &tegra_sm3_algs[i].alg.ahash;
ret = CRYPTO_REGISTER(ahash, alg); ret = CRYPTO_REGISTER(ahash, alg);
if (ret) { if (ret) {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
dev_err(se->dev, "failed to register %s\n", dev_err(se->dev, "failed to register %s\n",
alg->base.halg.base.cra_name); alg->base.halg.base.cra_name);
#else #else

View File

@@ -25,7 +25,7 @@
#include "tegra-se.h" #include "tegra-se.h"
struct tegra_sm4_ctx { struct tegra_sm4_ctx {
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
struct crypto_engine_ctx enginectx; struct crypto_engine_ctx enginectx;
#endif #endif
struct tegra_se *se; struct tegra_se *se;
@@ -49,7 +49,7 @@ struct tegra_sm4_reqctx {
}; };
struct tegra_sm4_gcm_ctx { struct tegra_sm4_gcm_ctx {
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
struct crypto_engine_ctx enginectx; struct crypto_engine_ctx enginectx;
#endif #endif
struct tegra_se *se; struct tegra_se *se;
@@ -80,7 +80,7 @@ struct tegra_sm4_gcm_reqctx {
}; };
struct tegra_sm4_cmac_ctx { struct tegra_sm4_cmac_ctx {
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
struct crypto_engine_ctx enginectx; struct crypto_engine_ctx enginectx;
#endif #endif
struct tegra_se *se; struct tegra_se *se;
@@ -293,7 +293,7 @@ static int tegra_sm4_cra_init(struct crypto_skcipher *tfm)
const char *algname; const char *algname;
int ret; int ret;
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher.base); se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher.base);
#else #else
se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher); se_alg = container_of(alg, struct tegra_se_alg, alg.skcipher);
@@ -316,7 +316,7 @@ static int tegra_sm4_cra_init(struct crypto_skcipher *tfm)
ctx->alg = ret; ctx->alg = ret;
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
ctx->enginectx.op.do_one_request = tegra_sm4_do_one_req; ctx->enginectx.op.do_one_request = tegra_sm4_do_one_req;
#endif #endif
@@ -548,7 +548,7 @@ static int tegra_sm4_decrypt(struct skcipher_request *req)
static struct tegra_se_alg tegra_sm4_algs[] = { static struct tegra_se_alg tegra_sm4_algs[] = {
{ {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sm4_cra_init, .init = tegra_sm4_cra_init,
@@ -570,14 +570,14 @@ static struct tegra_se_alg tegra_sm4_algs[] = {
.cra_alignmask = 0, .cra_alignmask = 0,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sm4_do_one_req, .op.do_one_request = tegra_sm4_do_one_req,
#endif #endif
} }
}, { }, {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sm4_cra_init, .init = tegra_sm4_cra_init,
@@ -599,14 +599,14 @@ static struct tegra_se_alg tegra_sm4_algs[] = {
.cra_alignmask = 0, .cra_alignmask = 0,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sm4_do_one_req, .op.do_one_request = tegra_sm4_do_one_req,
#endif #endif
} }
}, { }, {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sm4_cra_init, .init = tegra_sm4_cra_init,
@@ -628,14 +628,14 @@ static struct tegra_se_alg tegra_sm4_algs[] = {
.cra_alignmask = 0, .cra_alignmask = 0,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sm4_do_one_req, .op.do_one_request = tegra_sm4_do_one_req,
#endif #endif
} }
}, { }, {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sm4_cra_init, .init = tegra_sm4_cra_init,
@@ -657,14 +657,14 @@ static struct tegra_se_alg tegra_sm4_algs[] = {
.cra_alignmask = 0, .cra_alignmask = 0,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sm4_do_one_req, .op.do_one_request = tegra_sm4_do_one_req,
#endif #endif
} }
}, { }, {
.alg.skcipher = { .alg.skcipher = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sm4_cra_init, .init = tegra_sm4_cra_init,
@@ -686,7 +686,7 @@ static struct tegra_se_alg tegra_sm4_algs[] = {
.cra_alignmask = 0, .cra_alignmask = 0,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sm4_do_one_req, .op.do_one_request = tegra_sm4_do_one_req,
#endif #endif
@@ -1067,7 +1067,7 @@ static int tegra_sm4_gcm_cra_init(struct crypto_aead *tfm)
struct aead_alg *alg = crypto_aead_alg(tfm); struct aead_alg *alg = crypto_aead_alg(tfm);
struct tegra_se_alg *se_alg; struct tegra_se_alg *se_alg;
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base); se_alg = container_of(alg, struct tegra_se_alg, alg.aead.base);
#else #else
se_alg = container_of(alg, struct tegra_se_alg, alg.aead); se_alg = container_of(alg, struct tegra_se_alg, alg.aead);
@@ -1083,7 +1083,7 @@ static int tegra_sm4_gcm_cra_init(struct crypto_aead *tfm)
ctx->verify_alg = SE_ALG_SM4_GCM_VERIFY; ctx->verify_alg = SE_ALG_SM4_GCM_VERIFY;
ctx->mac_alg = SE_ALG_SM4_GMAC; ctx->mac_alg = SE_ALG_SM4_GMAC;
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
ctx->enginectx.op.do_one_request = tegra_sm4_gcm_do_one_req; ctx->enginectx.op.do_one_request = tegra_sm4_gcm_do_one_req;
#endif #endif
@@ -1457,7 +1457,7 @@ static int tegra_sm4_cmac_cra_init(struct crypto_tfm *tfm)
algname = crypto_tfm_alg_name(tfm); algname = crypto_tfm_alg_name(tfm);
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base); se_alg = container_of(alg, struct tegra_se_alg, alg.ahash.base);
#else #else
se_alg = container_of(alg, struct tegra_se_alg, alg.ahash); se_alg = container_of(alg, struct tegra_se_alg, alg.ahash);
@@ -1471,7 +1471,7 @@ static int tegra_sm4_cmac_cra_init(struct crypto_tfm *tfm)
ctx->alg = SE_ALG_SM4_CMAC; ctx->alg = SE_ALG_SM4_CMAC;
ctx->final_alg = SE_ALG_SM4_CMAC_FINAL; ctx->final_alg = SE_ALG_SM4_CMAC_FINAL;
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifndef NV_CRYPTO_ENGINE_OPS_PRESENT
ctx->enginectx.op.do_one_request = tegra_sm4_cmac_do_one_req; ctx->enginectx.op.do_one_request = tegra_sm4_cmac_do_one_req;
#endif #endif
@@ -1581,7 +1581,7 @@ static int tegra_sm4_cmac_import(struct ahash_request *req, const void *in)
static struct tegra_se_alg tegra_sm4_gcm_algs[] = { static struct tegra_se_alg tegra_sm4_gcm_algs[] = {
{ {
.alg.aead = { .alg.aead = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
@@ -1602,7 +1602,7 @@ static struct tegra_se_alg tegra_sm4_gcm_algs[] = {
.cra_alignmask = 0, .cra_alignmask = 0,
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sm4_gcm_do_one_req, .op.do_one_request = tegra_sm4_gcm_do_one_req,
#endif #endif
@@ -1613,7 +1613,7 @@ static struct tegra_se_alg tegra_sm4_gcm_algs[] = {
static struct tegra_se_alg tegra_sm4_cmac_algs[] = { static struct tegra_se_alg tegra_sm4_cmac_algs[] = {
{ {
.alg.ahash = { .alg.ahash = {
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
.base = { .base = {
#endif #endif
.init = tegra_sm4_cmac_init, .init = tegra_sm4_cmac_init,
@@ -1639,7 +1639,7 @@ static struct tegra_se_alg tegra_sm4_cmac_algs[] = {
.cra_init = tegra_sm4_cmac_cra_init, .cra_init = tegra_sm4_cmac_cra_init,
.cra_exit = tegra_sm4_cmac_cra_exit, .cra_exit = tegra_sm4_cmac_cra_exit,
}, },
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
}, },
.op.do_one_request = tegra_sm4_cmac_do_one_req, .op.do_one_request = tegra_sm4_cmac_do_one_req,
#endif #endif
@@ -1653,7 +1653,7 @@ struct tegra_se_regcfg tegra264_sm4_regcfg = {
.manifest = tegra_sm4_kac2_manifest .manifest = tegra_sm4_kac2_manifest
}; };
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
int tegra_init_sm4(struct tegra_se *se) int tegra_init_sm4(struct tegra_se *se)
{ {
struct aead_engine_alg *aead_alg; struct aead_engine_alg *aead_alg;

View File

@@ -540,18 +540,18 @@
#define TEGRA_AES_RESERVED_KSLT 14 #define TEGRA_AES_RESERVED_KSLT 14
#define TEGRA_XTS_RESERVED_KSLT 15 #define TEGRA_XTS_RESERVED_KSLT 15
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #if NV_IS_EXPORT_SYMBOL_PRESENT_crypto_engine_register_aead /* Linux v6.6 */
#define CRYPTO_REGISTER(alg, x) \ #define NV_CRYPTO_ENGINE_OPS_PRESENT
crypto_engine_register_##alg(x)
#else
#define CRYPTO_REGISTER(alg, x) \
crypto_register_##alg(x)
#endif #endif
#ifdef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
#define CRYPTO_REGISTER(alg, x) \
crypto_engine_register_##alg(x)
#define CRYPTO_UNREGISTER(alg, x) \ #define CRYPTO_UNREGISTER(alg, x) \
crypto_engine_unregister_##alg(x) crypto_engine_unregister_##alg(x)
#else #else
#define CRYPTO_REGISTER(alg, x) \
crypto_register_##alg(x)
#define CRYPTO_UNREGISTER(alg, x) \ #define CRYPTO_UNREGISTER(alg, x) \
crypto_unregister_##alg(x) crypto_unregister_##alg(x)
#endif #endif
@@ -609,14 +609,14 @@ struct tegra_se_alg {
const char *alg_base; const char *alg_base;
union { union {
#ifndef NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX #ifdef NV_CRYPTO_ENGINE_OPS_PRESENT
struct skcipher_alg skcipher;
struct aead_alg aead;
struct ahash_alg ahash;
#else
struct skcipher_engine_alg skcipher; struct skcipher_engine_alg skcipher;
struct aead_engine_alg aead; struct aead_engine_alg aead;
struct ahash_engine_alg ahash; struct ahash_engine_alg ahash;
#else
struct skcipher_alg skcipher;
struct aead_alg aead;
struct ahash_alg ahash;
#endif #endif
} alg; } alg;
}; };

View File

@@ -264,10 +264,9 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += of_property_read_reg
NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_fd_to_handle NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_fd_to_handle
NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_handle_to_fd NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_drm_gem_prime_handle_to_fd
NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_queue_limits_set NV_CONFTEST_GENERIC_COMPILE_TESTS += is_export_symbol_present_queue_limits_set
NV_CONFTEST_FUNCTION_COMPILE_TESTS += crypto_engine_ctx_struct_removed_test
NV_CONFTEST_MACRO_COMPILE_TESTS ?= NV_CONFTEST_MACRO_COMPILE_TESTS ?=
NV_CONFTEST_MACRO_COMPILE_TESTS += tegra264_bwmgr_debug_macro NV_CONFTEST_MACRO_COMPILE_TESTS += tegra264_bwmgr_debug_macro
NV_CONFTEST_SYMBOL_COMPILE_TESTS ?= NV_CONFTEST_SYMBOL_COMPILE_TESTS += is_export_symbol_present_crypto_engine_register_aead
$(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,functions,$(NV_CONFTEST_FUNCTION_COMPILE_TESTS))) $(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,functions,$(NV_CONFTEST_FUNCTION_COMPILE_TESTS)))
$(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,generic,$(NV_CONFTEST_GENERIC_COMPILE_TESTS))) $(eval $(call NV_GENERATE_COMPILE_TEST_HEADER,generic,$(NV_CONFTEST_GENERIC_COMPILE_TESTS)))

View File

@@ -9335,23 +9335,6 @@ compile_test() {
compile_check_conftest "$CODE" "NV_WORK_ON_CPU_KEY_PRESENT" "" "functions" compile_check_conftest "$CODE" "NV_WORK_ON_CPU_KEY_PRESENT" "" "functions"
;; ;;
crypto_engine_ctx_struct_removed_test)
#
# Determine if struct 'crypto_engine_ctx' is removed in linux kernel.
#
# Commit 5ce0bc68e0ee ("crypto: engine - Remove crypto_engine_ctx")
# Linux v6.6 removed struct crypto_engine_ctx
#
CODE="
#include <crypto/engine.h>
void conftest_crypto_engine_ctx_struct_removed_test(void) {
struct crypto_engine_ctx *ptr = NULL;
struct crypto_engine_ctx enginectx;
ptr = &enginectx;
}"
compile_check_conftest "$CODE" "NV_CONFTEST_REMOVE_STRUCT_CRYPTO_ENGINE_CTX" "" "functions"
;;
of_property_read_reg) of_property_read_reg)
# #
# Determine if the function of_property_read_reg is present or not. # Determine if the function of_property_read_reg is present or not.