On 22/05/2025 11:56, Luca Fancellu wrote: > Hi Michal, > >>> + >>> +/* >>> + * Set limit address of MPU protection region. >>> + * >>> + * @pr: pointer to the protection region structure. >>> + * @limit: exclusive address as limit of the protection region. >>> + */ >>> +static inline void pr_set_limit(pr_t *pr, paddr_t limit) >>> +{ >>> + pr->prlar.reg.limit = (((limit - 1) & ~MPU_REGION_RES0) >> Might be worth adding a comment that PRLAR expects inclusive limit hence >> (limit -1). > > You mean on top of the assignment? I’ve probably misunderstood you comment in > the past version > and thought that the @limit description was enough, I’m ok to add also this > comment. The comment says that the address must be exclusive. The code then transforms it into inclusive before the write, so one might wonder why. ~Michal
- [PATCH v5 0/6] First chunk for Arm R82 and MPU support Luca Fancellu
- [PATCH v5 4/6] arm/mpu: Provide access to the MPU regio... Luca Fancellu
- Re: [PATCH v5 4/6] arm/mpu: Provide access to the M... Orzel, Michal
- [PATCH v5 5/6] arm/mpu: Introduce utility functions for... Luca Fancellu
- Re: [PATCH v5 5/6] arm/mpu: Introduce utility funct... Orzel, Michal
- Re: [PATCH v5 5/6] arm/mpu: Introduce utility f... Luca Fancellu
- Re: [PATCH v5 5/6] arm/mpu: Introduce utili... Orzel, Michal
- [PATCH v5 1/6] docs/arm: Document Xen booting protocol ... Luca Fancellu
- [PATCH v5 3/6] arm/mpu: Provide and populate MPU C data... Luca Fancellu
- Re: [PATCH v5 3/6] arm/mpu: Provide and populate MP... Julien Grall
- Re: [PATCH v5 3/6] arm/mpu: Provide and populat... Luca Fancellu
- Re: [PATCH v5 3/6] arm/mpu: Provide and pop... Julien Grall
- [PATCH v5 2/6] arm/mpu: Introduce MPU memory region map... Luca Fancellu
- Re: [PATCH v5 2/6] arm/mpu: Introduce MPU memory re... Julien Grall
- Re: [PATCH v5 2/6] arm/mpu: Introduce MPU memory re... Orzel, Michal
- Re: [PATCH v5 2/6] arm/mpu: Introduce MPU memor... Luca Fancellu