Hey Roman
That is interesting - I was under the impression that having the structure marked as volatile was semantically the same as having all of its member volatile. Do you notice a considerable stack usage change with this fix?
I think if you do notice one, we'd be happy to have that change upstream. There's always some performance/size penalty to the FIH code but we should definitely try to minimize it if we can.
Raef
________________________________________ From: Roman.Mazurak--- via TF-M tf-m@lists.trustedfirmware.org Sent: 08 December 2023 19:58 To: tf-m@lists.trustedfirmware.org Subject: [TF-M] FIH volatile structure and stack usage
Hi all,
I found that using FIH medium/high profile with gcc generates code that uses stack extensively. It happens because fih_int structure is marked as volatile. Is there any reason why structure itself is marked as volatile? Why it’s not enough to make val and msk volatile members of fih_int structure?
Best regards, Roman.