Hello Marco,

On 2/10/26 10:35 AM, Marco Felsch wrote:
> On 26-02-09, Ahmad Fatoum wrote:
>>>> static_assert(sizeof(struct imx_scratch_space)
>>>>           - offsetof(struct imx_scratch_space, fdt)
>>>>                    <= PBL_OPTEE_DTB_MAX_SIZE);
>>>
>>> This would introduce a very strict dependency for CONFIG_SCRATCH_SIZE to
>>> the not always visible PBL_OPTEE_DTB_MAX_SIZE. As you said:
>>
>> Wrap the assert in an #ifdef then.

Alternatively, define it to 0 the same way we define OPTEE_SIZE in a header.

> 
> Sure, but still it would bind the SCARTCH_SIZE very tightly to
> PBL_OPTEE_DTB_MAX_SIZE. E.g. this assert would always be triggered if
> $someone wants to have a PBL_OPTEE_DTB_MAX_SIZE size of 4K and keep the
> default SCRATCH_SIZE of 32K. IMHO this is an surprising behaviour.
> 
> However, it's fine for me too, I just wanted to point this out.

Sorry, I got this the wrong round. The size of the fdt flexible array
should be of course larger than or equal CONFIG_PBL_OPTEE_DTB_MAX_SIZE.

SoC OP-TEE support will use PBL_OPTEE_DTB_MAX_SIZE as maximum size to
write and OP-TEE will use DTB_MAX_SIZE internally of course.

Would this work?

Cheers,
Ahmad

> 
>>>>>> In that case, this should go to security/Kconfig and be named something
>>>>>> like PBL_OPTEE_DTB_MAX_SIZE. There's no need to ask every user that
>>>>>> configures barebox about this.
>>>
>>> Therefore I would like to use your name suggestion
>>> PBL_OPTEE_DTB_MAX_SIZE but keep it loose like RK does.
>>>
>>>> The benefits I see:
>>>>   - Just one argument to tune (CONFIG_SCRATCH_SIZE) like we already use
>>>>     for Rockchip
>>>
>>> Rockchip is using two Kconfig switch too (ARCH_ROCKCHIP_ATF_FDT_SIZE).
>>
>> Oh, I see. I can send patches to switch this over to
>> PBL_OPTEE_DTB_MAX_SIZE then.
> 
> Thanks :)
> 
> Regards,
>   Marco
> 
>>
>>>
>>>>   - We still have a dedicated option that can be kept in-sync with the
>>>>     exact option value in OP-TEE to find problems at compile-time
>>>>   - Only those who actually use OP-TEE will be asked about
>>>>     PBL_OPTEE_DTB_MAX_SIZE
>>>
>>> Good points!
>>>
>>>> Would this work for you?
>>>
>>> Please see above.
>>
>> Cheers,
>> Ahmad
>>
>>>
>>> Regards,
>>>   Marco
>>>
>>>
>>>>
>>>> Cheers,
>>>> Ahmad
>>>>
>>>>
>>>>>
>>>>> Regards,
>>>>>   Marco
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>> Cheers,
>>>>>> Ahmad
>>>>>>
>>>>>> -- 
>>>>>> Pengutronix e.K.                  |                             |
>>>>>> Steuerwalder Str. 21              | http://www.pengutronix.de/  |
>>>>>> 31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
>>>>>> Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
>>>>>>
>>>>>>
>>>>>
>>>>
>>>> -- 
>>>> Pengutronix e.K.                  |                             |
>>>> Steuerwalder Str. 21              | http://www.pengutronix.de/  |
>>>> 31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
>>>> Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
>>>>
>>>>
>>>
>>
>> -- 
>> Pengutronix e.K.                  |                             |
>> Steuerwalder Str. 21              | http://www.pengutronix.de/  |
>> 31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
>> Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
>>
>>
> 

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |


Reply via email to