[PATCH v10 05/43] arm64: RME: Check for RME support at KVM init
Steven Price
steven.price at arm.com
Wed Oct 1 08:34:59 PDT 2025
On 01/10/2025 14:35, Marc Zyngier wrote:
> On Wed, 01 Oct 2025 14:20:13 +0100,
> Steven Price <steven.price at arm.com> wrote:
>>
>>>> +static int rmi_check_version(void)
>>>> +{
>>>> + struct arm_smccc_res res;
>>>> + unsigned short version_major, version_minor;
>>>> + unsigned long host_version = RMI_ABI_VERSION(RMI_ABI_MAJOR_VERSION,
>>>> + RMI_ABI_MINOR_VERSION);
>>>> +
>>>> + arm_smccc_1_1_invoke(SMC_RMI_VERSION, host_version, &res);
>>>
>>> Shouldn't you first check that RME is actually available, by looking
>>> at ID_AA64PFR0_EL1.RME?
>>
>> Well, you made a good point above that this isn't RME, it's CCA. And I
>> guess there's a possible world where the CCA interface could be
>> supported with something other than FEAT_RME (FEAT_RME2 maybe?) so I'm
>> not sure it necessarily a good idea to pin this on a CPU feature
>> bit.
>
> But you cannot have CCA without RME. You cannot have CCA with
> GICv3. And my point was more that RME could be used by something other
> than CCA - I certainly don't anticipate someone else adopting the CCA
> interface for anything...
>
>> Ultimately what we want to know is whether the firmware thinks it can
>> supply us with the CCA interface and we don't really care how it
>> achieves it.
>
> I disagree. You rely on specific feature sets to be available (hell,
> everything is baked around GICv3... GICv5 anyone?).
>
> For this sort of stuff, you absolutely need to know what you are
> running on, not what some broken firmware tries to pretend it is.
Well I don't agree, but equally I think the chances of the RMM interface
existing without RME is nil, so I guess the extra check doesn't really
matter. So I'll add it. In the (highly) unlikely event that it causes a
problem then it would be easy enough to remove.
Thanks,
Steve
More information about the linux-arm-kernel
mailing list