OP-TEE / optee_os

Trusted side of the TEE
Other
1.57k stars 1.06k forks source link

Versal Port - DNA Request Error During OP-TEE Boot - HUK Generation #6314

Closed nathan-menhorn closed 11 months ago

nathan-menhorn commented 1 year ago

Hi @ldts

When I don’t enable PLM and mailbox debugging, for some reason there’s an error calling the IPI message to read the DNA. This doesn’t happen all the time but happens most of the time. However, when enabling PLM and mailbox debugging the call works as expected all the time. Seems like some weird timing error and I haven't spent enough time to find out the specifics of the issue but wanted to make you aware of it. Here are the logs:

Error State:

I/TC: Hardware Root of Trust: Asymmetric[OFF], Symmetric[OFF] D/TC:0 0 call_initcalls:40 level 3 versal_sha3_384_init() E/TC80 0 versal_mbox_notify:318 Can't read the remote response orD/TC:0 0 versal_mbox_notify:328 PLM: plm status = 0x0, lib_status = 0x1ab E/TC:0 0 call_initcalls:43 Initcall text_start + 0x00087b08 failed D/TC:0 0 call_initcalls:40 level 3 check_ta_store() D/TC:0 0 check_ta_store:454 TA store: "early TA" D/TC:0 0 check_ta_store:454 TA store: "Secure Storage TA" D/TC:0 0 check_ta_store:454 TA store: "REE" D/TC:0 0 call_initcalls:40 level 3 early_ta_init() D/TC:0 0 early_ta_init:56 Early TA f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c size 47680 (compressed, uncompressed 109256) D/TC:0 0 call_initcalls:40 level 3 verify_pseudo_tas_conformance() D/TC:0 0 call_initcalls:40 level 3 tee_cryp_init() D/TC:0 0 call_initcalls:40 level 4 tee_fs_init_key_manager() E/TC:0 0 versal_mbox_notify:318 Can't read the remote response or Command ID: 0xB1box_notify:328 PLM: plm status = 0x141, lib_status = 0x0 E/TC:0 0 efuse_req:156 Mailbox error E/TC:0 0 call_initcalls:43 Initcall text_start + 0x00087b80 failed D/TC:0 0 call_initcalls:40 level 5 trng_hrng_mode_init() D/TC:0 0 call_initcalls:40 level 5 ecc_init() E/TC:0 0 veXPlmi_IpiDispatchHandler: Error: IPI command failed forD/TC:0 0 versal_mbox_notify:328 PLM: plm status = 0x0, lib_status = 0x1ab E/TC:0 0 ecc_init:439 Versal KAG NIST_P384: Unknown E/TC:0 0 call_initcalls:43 Initcall text_start + 0x00087bb0 failed D/TC:0 0 call_initcalls:40 level 5 rsa_init() E/TC:0 0 versal_mbox_notify:318 Can't read the remote response orD/TC:0 0 versal_mbox_notify:328 PLM: plm status = 0x2504, lib_status = 0xa E/TC:0 0 call_initcalls:43 Initcall text_start + 0x00087bc8 failed D/TC:0 0 call_initcalls:40 level 6 versal_register_authenc() D/TC:0 0 call_initcalls:40 level 6 mobj_init() D/TC:0 0 call_initcalls:40 level 6 default_mobj_init()

Expected State without PLM/Mailbox Debug

I/TC: Hardware Root of Trust: Asymmetric[OFF], Symmetric[OFF] D/TC:0 0 call_initcalls:40 level 3 versal_sha3_384_init() D/TC:0 0 call_initcalls:40 level 3 check_ta_store() D/TC:0 0 check_ta_store:454 TA store: "early TA" D/TC:0 0 check_ta_store:454 TA store: "Secure Storage TA" D/TC:0 0 check_ta_store:454 TA store: "REE" D/TC:0 0 call_initcalls:40 level 3 early_ta_init() D/TC:0 0 early_ta_init:56 Early TA f04a0fe7-1f5d-4b9b-abf7-619b85b4ce8c size 47680 (compressed, uncompressed 109256) D/TC:0 0 call_initcalls:40 level 3 verify_pseudo_tas_conformance() D/TC:0 0 call_initcalls:40 level 3 tee_cryp_init() D/TC:0 0 call_initcalls:40 level 4 tee_fs_init_key_manager() I/TC: Using Development HUK D/TC:0 0 call_initcalls:40 level 5 trng_hrng_mode_init() D/TC:0 0 call_initcalls:40 level 5 ecc_init() D/TC:0 0 call_initcalls:40 level 5 rsa_init() D/TC:0 0 call_initcalls:40 level 6 versal_register_authenc() D/TC:0 0 call_initcalls:40 level 6 mobj_init() D/TC:0 0 call_initcalls:40 level 6 default_mobj_init() I/TC: Primary CPU switching to normal world boot INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0x8000000 INFO: SPSR = 0x3c9

Expected State with PLM/Mailbox Debug

I/TC: Hardware Root of Trust: Asymmetric[OFF], Symmetric[OFF] D/TC:0 0 call_initcalls:40 level 3 versal_sha3_384_init() I/TC: --- mbox: service: CRYPTO call: SHA3_KAT D/TC:0 0 call_initcalls:40 level 3 check_ta_store() D/TC:0 0 check_ta_store:454 TA store: "early TA" D/TC:0 0 check_ta_store:454 TA store: "Secure Storage TA" D/TC:0 0 check_ta_store:454 TA store: "REE" D/TC:0 0 call_initcalls:40 level 3 early_ta_init() D/TC:0 0 early_ta_init:56 Early TA 8aaaf200-2450-11e4-abe2-0002a5d5c51b size 47390 (compressed, uncompressed 109304) D/TC:0 0 call_initcalls:40 level 3 verify_pseudo_tas_conformance() D/TC:0 0 call_initcalls:40 level 3 tee_cryp_init() D/TC:0 0 call_initcalls:40 level 4 tee_fs_init_key_manager() I/TC: --- mbox: service: NVM call: EFUSE_READ_DNA I/TC: --- mbox: service: CRYPTO call: SHA3_UPDATE I/TC: --- mbox: service: CRYPTO call: SHA3_UPDATE I/TC: --- mbox: service: CRYPTO call: AES_INIT I/TC: --- mbox: service: CRYPTO call: AES_WRITE_KEY I/TC: Using Development HUK I/TC: --- mbox: service: CRYPTO call: AES_OP_INIT I/TC: --- mbox: service: CRYPTO call: AES_UPDATE_AAD I/TC: --- mbox: service: CRYPTO call: AES_ENCRYPT_UPDATE I/TC: --- mbox: service: CRYPTO call: AES_ENCRYPT_FINAL D/TC:0 0 call_initcalls:40 level 5 trng_hrng_mode_init() D/TC:0 0 call_initcalls:40 level 5 ecc_init() I/TC: --- mbox: service: CRYPTO call: ELLIPTIC_KAT I/TC: --- mbox: service: CRYPTO call: ELLIPTIC_KAT D/TC:0 0 call_initcalls:40 level 5 rsa_init() I/TC: --- mbox: service: CRYPTO call: RSA_KAT D/TC:0 0 call_initcalls:40 level 6 versal_register_authenc() D/TC:0 0 call_initcalls:40 level 6 mobj_init() D/TC:0 0 call_initcalls:40 level 6 default_mobj_init() I/TC: Primary CPU switching to normal world boot INFO: BL31: Preparing for EL3 exit to normal world INFO: Entry point address = 0x8000000 INFO: SPSR = 0x3c9

optee-os commit 3050ae8abeb2cab6b71cc12eaeedb7f908bff1ef From https://github.com/OP-TEE/build/blob/master/versal.mk Build OS: Ubuntu 20.04.6 LTS

github-actions[bot] commented 12 months ago

This issue has been marked as a stale issue because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this issue will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time.