[PATCH v18 3/7] firmware: arm_rmm: Configure the RMM with the host's page size

Suzuki K Poulose suzuki.poulose at arm.com
Mon Sep 21 02:31:20 PDT 2026


On 19/09/2026 02:27, Jonathan Cameron wrote:
>> RMM v2.0 brings the ability to set the RMM's granule size. Check the
>> feature registers and configure the RMM so that it matches the host's
>> page size. This means that operations can be done with a granularity
>> equal to PAGE_SIZE.
>>
>> Reviewed-by: Suzuki K Poulose <suzuki.poulose at arm.com>
>> Signed-off-by: Steven Price <steven.price at arm.com>
>> Signed-off-by: Suzuki K Poulose <suzuki.poulose at arm.com>
> 
> One trivial but looks like it is getting quite a few changes from
> Gavin's comments so no tags yet.

...

>> +
>> +	config = (struct rmm_config *)get_zeroed_page(GFP_KERNEL);
>> +	if (!config) {
>> +		pr_err("Unable to allocate memory for RMM config\n");
>> +		return -ENOMEM;
>> +	}
>> +
>> +	config->rmi_granule_size = granule_size;
>> +
>> +	/*
>> +	 * For now we set the tracking_region_size to 0 which is the only option
>> +	 * for 4KB PAGE_SIZE (1GB for 4KB PAGE_SIZE, 32MB/512MB for 16KB/64KB).
>> +	 * TODO: Support other tracking sizes via Kconfig option for other
>> +	 * PAGE_SIZES
>> +	 */
>> +	config->tracking_region_size = 0;
>> +
>> +	ret = rmi_rmm_config_set(virt_to_phys(config));
>> +	if (ret) {
>> +		pr_err("RMM config set failed (%d)\n", ret);
>> +		ret = -EINVAL;
>> +	}
>> +
>> +	free_page((unsigned long)config);
> 
> Maybe some __free() magic is applicable here - would let you just
> return in the error path above making for tidier flow and get
> rid of need to assign ret above.

Ack

Cheers
Suzuki>




More information about the linux-arm-kernel mailing list