On 29/04/2025 17:20, Luca Fancellu wrote: > Introduce few utility function to manipulate and handle the s/few/a few/ s/function/functions/ > pr_t type. > > Signed-off-by: Luca Fancellu <luca.fance...@arm.com> > --- > v4 changes: > - Modify comment on top of the helpers. Clarify pr_set_limit > takes exclusive address. > Protected common code with #ifdef Arm64 until Arm32 is ready > with pr_t > --- > xen/arch/arm/include/asm/mpu.h | 64 ++++++++++++++++++++++++++++++++++ > 1 file changed, 64 insertions(+) > > diff --git a/xen/arch/arm/include/asm/mpu.h b/xen/arch/arm/include/asm/mpu.h > index 40a86140b6cc..0e0a7f05ade9 100644 > --- a/xen/arch/arm/include/asm/mpu.h > +++ b/xen/arch/arm/include/asm/mpu.h > @@ -24,6 +24,70 @@ > #define NUM_MPU_REGIONS_MASK (NUM_MPU_REGIONS - 1) > #define MAX_MPU_REGION_NR 255 > > +#ifndef __ASSEMBLY__ > + > +#ifdef CONFIG_ARM_64 > +/* > + * Set base address of MPU protection region. > + * > + * @pr: pointer to the protection region structure. > + * @base: base address as base of the protection region. > + */ > +static inline void pr_set_base(pr_t *pr, paddr_t base) > +{ > + pr->prbar.reg.base = (base >> MPU_REGION_SHIFT); Shouldn't you take MPU_REGION_RES0 into account? ~Michal
- Re: [PATCH v4 4/7] arm/mpu: Provide access to the M... Orzel, Michal
- Re: [PATCH v4 4/7] arm/mpu: Provide access to t... Luca Fancellu
- [PATCH v4 3/7] arm/mpu: Provide and populate MPU C data ... Luca Fancellu
- Re: [PATCH v4 3/7] arm/mpu: Provide and populate MP... Luca Fancellu
- Re: [PATCH v4 3/7] arm/mpu: Provide and populate MP... Orzel, Michal
- Re: [PATCH v4 3/7] arm/mpu: Provide and populat... Luca Fancellu
- [PATCH v4 2/7] arm/mpu: Introduce MPU memory region map ... Luca Fancellu
- Re: [PATCH v4 2/7] arm/mpu: Introduce MPU memory re... Orzel, Michal
- Re: [PATCH v4 2/7] arm/mpu: Introduce MPU memory re... Julien Grall
- [PATCH v4 5/7] arm/mpu: Introduce utility functions for ... Luca Fancellu
- Re: [PATCH v4 5/7] arm/mpu: Introduce utility funct... Orzel, Michal
- Re: [PATCH v4 5/7] arm/mpu: Introduce utility f... Luca Fancellu
- [PATCH v4 6/7] arm/mpu: Provide a constructor for pr_t t... Luca Fancellu
- Re: [PATCH v4 6/7] arm/mpu: Provide a constructor f... Ayan Kumar Halder
- Re: [PATCH v4 6/7] arm/mpu: Provide a construct... Luca Fancellu
- Re: [PATCH v4 6/7] arm/mpu: Provide a constructor f... Orzel, Michal
- Re: [PATCH v4 6/7] arm/mpu: Provide a construct... Luca Fancellu
- Re: [PATCH v4 6/7] arm/mpu: Provide a const... Julien Grall
- Re: [PATCH v4 6/7] arm/mpu: Provide a c... Luca Fancellu
- Re: [PATCH v4 6/7] arm/mpu: Provide a construct... Luca Fancellu