Hi Varun,
On 2/9/23 16:20, Varun Wadekar wrote:
Hi,
Although we've not completely thought through all the details, we suspect we will have to isolate each strong implementation under plat/common/ in a separate file such that platforms can pick and choose just the files (and thus, just the functions) they need.
[VW] It would be interesting to see if a function pointer based solution, similar to psci_ops, would be useful.
I see that Raghu raised the same idea in Gerrit, quoting his comment for reference:
Another alternative to providing interfaces is using const function pointers. People may barf at function pointers as a security issue, but conscious use of const function pointers that defines platform interfaces, that must be filled, is another way to get similar effect to weak functions without breaking security or potential for causing bugs.
I agree that *const* function pointers sound safe from a security point of view.
I just have a doubt about the performance impact. Would there be any? Or would the "constness" of these function pointers allow the compiler to optimize and remove any indirection we'd get with mutable function pointers?
Best regards, Sandrine