Hi, Olivier, As I can see in the Hafnium code, Hafnium performs a number of one-time functions at boot phase, like one_time_init_mm and one_time_init. I want to initialize Hafnium again from image_entry and then initialize optee after optee is updated. I wonder if there are any problems with this flow for hafnium at runtime phase. Does Hafnium provide any interface to boot optee directly at runtime phase, and if not, how do you think it makes sense to modify the above flow? Does anyone else know how to fix it? Thanks for your support. Regards, Yuye.
Hi Yuye,
See few comments inline [OD].
Regards, Olivier.
________________________________ From: 梅建强(禹夜) meijianqiang.mjq@alibaba-inc.com Sent: 06 May 2023 09:34 To: Olivier Deprez Olivier.Deprez@arm.com Cc: hafnium hafnium@lists.trustedfirmware.org Subject: optee hot update
Hi, Olivier,
As I can see in the Hafnium code, Hafnium performs a number of one-time functions at boot phase, like one_time_init_mm and one_time_init.
I want to initialize Hafnium again from image_entry and then initialize optee after optee is updated. I wonder if there are any problems with this flow for hafnium at runtime phase.
[OD] Unfortunately Hafnium is not designed for this. I can see few places where things can go wrong, but firstly as you highlighted in another thread, the init should take place on the same core that was used for initializing (aka the primary core). As I understand, the optee load smc can happen on any core as it's launched from a nwd/linux thread running on any core. This is not only a hafnium limitation, I guess OP-TEE would have the same problem further on, as it also must go through the primary core init on physical boot/primary core. Then it would require the normal world to coordinate the secondary core init. for all cores, the same way as it happens in the cold boot phase by duplicating TF-A's PSCI boot flows.
Does Hafnium provide any interface to boot optee directly at runtime phase, and if not, how do you think it makes sense to modify the above flow?
[OD] No this isn't supported and not in our roadmap. As things stand with upstream components, it would be preferable going with a regular FW update flow (but requires a machine reboot).
Does anyone else know how to fix it?
Thanks for your support.
Regards, Yuye.
hafnium@lists.trustedfirmware.org