Hi Michal,

> On 14 Apr 2025, at 16:01, Orzel, Michal <michal.or...@amd.com> wrote:
> 
> 
> 
> On 14/04/2025 16:50, Luca Fancellu wrote:
>> Hi Michal,
>> 
>>> On 14 Apr 2025, at 11:17, Orzel, Michal <michal.or...@amd.com> wrote:
>>> 
>>> 
>>> 
>>> On 11/04/2025 16:56, Luca Fancellu wrote:
>>>> From: Penny Zheng <penny.zh...@arm.com>
>>>> 
>>>> Introduce pr_t typedef which is a structure having the prbar
>>>> and prlar members, each being structured as the registers of
>>>> the aarch64 armv8-r architecture.
>>>> 
>>>> Introduce the array 'xen_mpumap' that will store a view of
>>>> the content of the MPU regions.
>>>> 
>>>> Introduce MAX_MPU_REGIONS macro that uses the value of
>>>> NUM_MPU_REGIONS_MASK just for clarity, because using the
>>>> latter as number of elements of the xen_mpumap array might
>>>> be misleading.
>>> What should be the size of this array? I thought NUM_MPU_REGIONS indicates 
>>> how
>>> many regions there can be (i.e. 256) and this should be the size. Yet you 
>>> use
>>> MASK for size which is odd.
>> 
>> So the maximum number of regions for aarch64 armv8-r are 255, 
>> MPUIR_EL2.REGION is an
>> 8 bit field advertising the number of region supported.
> So there can be max 255 regions. Ok.
> 
>> 
>> Is it better if I use just the below?
>> 
>> #define MAX_MPU_REGIONS 255
> If there are 255 regions, what NUM_MPU_REGIONS macro is for which stores 256?
> These two macros confuse me. Or is it that by your macro you want to denote 
> the
> max region number? In that case, the macro should be named MAX_MPU_REGION_NR 
> or
> alike.

I know, NUM_MPU_REGIONS should have a different name as it’s a bit misleading, 
ok
I’ll name the macro I use here as MAX_MPU_REGION_NR.

Cheers,
Luca

Reply via email to