Skip to content

Conversation

@anilreddy3
Copy link

@anilreddy3 anilreddy3 commented Oct 3, 2025

Marvell eHSM crypto engine support to offload AES crypto algorithms

@anilreddy3 anilreddy3 changed the title Crypto Marvell eHSM crypto engine support to offload AES crypto algorithms Oct 3, 2025
@jenswi-linaro
Copy link
Contributor

core/drivers/crypto/marvell/cn20k looks like an extended copy of core/drivers/crypto/marvell/cn10k, where most of the lines are the same. There's a lot of duplicated code between those two directories. Would it make sense to combine the two and use #ifdef CFG_MARVEL_CN20K or if (IS_ENABLED(CFG_MARVEL_CN20K)) in the code?

Add marvell eHSM crypto engine support to offload
AES crypto algorithms for CN10K and CN20K platforms,
this will be a base for authenc and cipher drvcrypt
driver operations.

Signed-off-by: Anil Kumar Reddy <[email protected]>
This driver registers the eHSM crypto engine with-in
the drvcrypto framework, and uses eHSM service to
deliver authentication functionality of AES-GCM.

Signed-off-by: Anil Kumar Reddy <[email protected]>
This driver registers the eHSM crypto aes engine
with-in the cipher framework, and uses eHSM service to
deliver cipher operations.

Signed-off-by: Anil Kumar Reddy <[email protected]>
@anilreddy3
Copy link
Author

core/drivers/crypto/marvell/cn20k looks like an extended copy of core/drivers/crypto/marvell/cn10k, where most of the lines are the same. There's a lot of duplicated code between those two directories. Would it make sense to combine the two and use #ifdef CFG_MARVEL_CN20K or if (IS_ENABLED(CFG_MARVEL_CN20K)) in the code?

Have combined CN10K and CN20K directories, Thanks for the suggestion.

@anilreddy3
Copy link
Author

anilreddy3 commented Oct 22, 2025

I don't think my changes are responsible for CI failures. I see in other PR that issue is fixed. May i know how to retry the CI again, thanks.

@jforissier
Copy link
Contributor

@anilreddy3 CI is currently unstable ("no space left on device" errors in various jobs). The QEMUv8 Hafnium job is supposedly fixed in master by 3d0429a but now we're seeing more of this failure in the other QEMUv8 jobs (1..4/4). I am investigating.

@anilreddy3
Copy link
Author

@etienne-lms @jenswi-linaro Have addressed your review comments and pushed updated patches. Please review further and provide your comments if any, thanks.

cmd.opcode = BCM_AES_ZEROIZE;
estat = ehsm_command(handle, &cmd);
if (estat != STATUS_SUCCESS)
return (enum sec_return)estat;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit strange. We have enum ehsm_status and enum sec_return, where, from what I understand, the value 0 SEC_NO_ERROR or STATUS_SUCCESS are compatible and mean the same thing. What is this cast supposed to do?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum ehsm_status contains the error types which truly returned by the eHSM hardware block, whereas enum sec_return contains the other error types related crypto engine like we may return SEC_INVALID_MAILBOX based on the mailbox number check in ehsm_initialize(), and SEC_INVALID_PARAMETER and soon and so forth.
And finally we are combining enum ehsm_status with enum sec_return by typecasting and returning this sec_return error type to upper driver layer.

@anilreddy3
Copy link
Author

anilreddy3 commented Nov 6, 2025

@anilreddy3 CI is currently unstable ("no space left on device" errors in various jobs). The QEMUv8 Hafnium job is supposedly fixed in master by 3d0429a but now we're seeing more of this failure in the other QEMUv8 jobs (1..4/4). I am investigating.

@jforissier Seems CI reelated issues are fixed, could you please retry CI for this PR, thanks.

@jforissier
Copy link
Contributor

@anilreddy3 CI is currently unstable ("no space left on device" errors in various jobs). The QEMUv8 Hafnium job is supposedly fixed in master by 3d0429a but now we're seeing more of this failure in the other QEMUv8 jobs (1..4/4). I am investigating.

@jforissier Seems CI reelated issues are fixed, could you please retry CI for this PR, thanks.

Please rebase onto master and force-push. Simply restarting the jobs would not get the updated CI script. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants