On 22/05/2025 14:49, Luca Fancellu wrote:
> Hi Michal,
> 
>>> +
>>> +pr_t pr_of_addr(paddr_t base, paddr_t limit, unsigned int flags)
>>> +{
>>> +    unsigned int attr_idx = PAGE_AI_MASK(flags);
>>> +    prbar_t prbar;
>>> +    prlar_t prlar;
>>> +    pr_t region;
>>> +
>>> +    /* Build up value for PRBAR_EL2. */
>>> +    prbar = (prbar_t) {
>>> +        .reg = {
>>> +            .ro = PAGE_RO_MASK(flags),
>>> +            .xn = PAGE_XN_MASK(flags),
>> Shouldn't you also initialize .xn_0 and .ap_0 or you rely on compound literal
>> implicit zero initialization of unspecified fields? But then you do 
>> initialize
>> .ns to 0 fror prlar...
> 
> Yes, because there I would like to specify that value 0 means Hyp in secure 
> world,
> but of course if you want I can explicitly initialise also these two
I'd prefer that way (so that it's more clear what are all the fields initialized
to) but I can understand that this is very subjective so you have a freedom of
choice here.

~Michal


Reply via email to