Re: [PATCH v19 6/7] firmware: arm_rmm: Ensure the RMM has GPT entries for memory
From: Suzuki K Poulose
Date: Wed Sep 30 2026 - 04:27:14 EST
On 29/09/2026 23:29, Shanker Donthineni wrote:
Hi Suzuki,
On 9/24/2026 8:52 AM, Suzuki K Poulose wrote:
External email: Use caution opening links or attachments
From: Steven Price <steven.price@xxxxxxx>
The RMM maintains the state of all the granules in the system to make
sure that the host is abiding by the rules. This state can be maintained
at different granularity, per page (TRACKING_FINE) or per region
(TRACKING_COARSE or TRACKING_INTERMEDIATE). The region size depends on the
underlying "RMI_GRANULE_SIZE". For a "coarse"/"intermediate" region,
all pages in the region must be of the same state, this implies we need to
have "fine" tracking for DRAM, so that we can delegate individual pages.
For now we only support a statically carved out memory for tracking
granules for the "fine" regions. This can be extended in the future to
allow modifying the tracking granularity and remove the need for a
static allocation by the firmware.
...
+
+/*
+ * We do not support creating L1 GPTs yet. So, make sure that
+ * all the regions are managed by the firmware.
+ */
+static int rmi_verify_gpt_firmware_managed(phys_addr_t start, phys_addr_t end)
+{
+ unsigned long l0gpt_sz;
+ unsigned long next, par_state;
+
+ l0gpt_sz = 1UL << (30 + FIELD_GET(RMI_FEATURE_REGISTER_1_L0GPTSZ,
+ rmi_feat_reg(1)));
+ start = ALIGN_DOWN(start, l0gpt_sz);
+ end = ALIGN(end, l0gpt_sz);
+
+ while (start < end) {
+ long ret = rmi_gpt_info(start, end, &next, &par_state);
+
+ if (ret != RMI_SUCCESS)
+ return -ENOMEM;
+
+ if (WARN_ON(next <= start))
+ return -ENXIO;
+
+ if (par_state != RMI_GPT_PAR_PLAT) {
+ pr_err("GPT for the region is not managed by firmware %llx-%lx\n",
+ start, next);
+ return -ENOMEM;
Accepting only RMI_GPT_PAR_PLAT rules out the host ever creating its own
L1 GPTs. On NVIDIA platforms the PARs backing system RAM come up as
RMI_GPT_PAR_HOST_NOT_CREATED, so this returns -ENOMEM and CCA cannot be
enabled at all.
Like I mentioned in the previous response, this is staged upstreaming.
The dynamic GPT/Tracking will follow after. This also calls for on-demand activation which Catalin requested and can be combined together,
as we dedicate quite a lot of memory for the metadata and L1GPTs.
With local changes to promote granule tracking via RMI_GRANULE_TRACKING_SET
and to create the host L1 GPTs, I was able to boot a Realm with multiple
vCPUs and exercise basic boot functionality on NVIDIA silicon.
Thanks for the testing !
Cheers
Suzuki