Subject: Re: [PATCH v14 08/44] arm64: RMI: Ensure that the RMM has GPT entries for memory

From: Marc Zyngier <[email-masked]>
Date: Thu, 21 May 2026 15:24:47 +0100

On Thu, 21 May 2026 14:47:55 +0100,
Marc Zyngier <[email-masked]> wrote:
> 
> On Wed, 13 May 2026 14:17:16 +0100,
> Steven Price <[email-masked]> wrote:
> > 
> > +/*
> > + * For now we set the tracking_region_size to 0 for RMI_RMM_CONFIG_SET().
> > + * TODO: Support other tracking sizes (via Kconfig option).
> > + */
> > +#ifdef CONFIG_PAGE_SIZE_4KB
> > +#define RMM_GRANULE_TRACKING_SIZE	SZ_1G
> > +#elif defined(CONFIG_PAGE_SIZE_16KB)
> > +#define RMM_GRANULE_TRACKING_SIZE	SZ_32M
> > +#elif defined(CONFIG_PAGE_SIZE_64KB)
> > +#define RMM_GRANULE_TRACKING_SIZE	SZ_512M
> > +#endif
> 
> Basically, a level 2 mapping. Which means this whole block really is:
> 
> #define RMM_GRANULE_TRAKING_SIZE	(2 * PAGE_SHIFT - 3)

Obviously wrong:

#define RMM_GRANULE_TRAKING_SIZE	BIT(2 * PAGE_SHIFT - 3)

	M.

-- 
Without deviation from the norm, progress is not possible.