[PATCH 03/11] KVM: arm64: CCA: Check for RMI support at KVM init

Suzuki K Poulose suzuki.poulose at arm.com
Wed Nov 4 02:39:15 PST 2026


Hi Kohei

On 04/11/2026 10:27, Kohei Enju wrote:
> On 11/04 19:23, Kohei Enju wrote:
>> Hi Steven,
>>
>> On 11/02 14:12, Steven Price wrote:
>>> Check if the RMI support is sufficient for using in KVM. Specifically, we
>>> will only support creating realm VMs when KVM is set to 'rmm' mode.
>>>
>>> Signed-off-by: Steven Price <steven.price at arm.com>
>>> ---
>>>   arch/arm64/kvm/Kconfig | 1 +
>>>   arch/arm64/kvm/rmi.c   | 4 +++-
>>>   2 files changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig
>>> index cecea0820e52..d067063a3686 100644
>>> --- a/arch/arm64/kvm/Kconfig
>>> +++ b/arch/arm64/kvm/Kconfig
>>> @@ -34,6 +34,7 @@ menuconfig KVM
>>>   	select GUEST_PERF_EVENTS if PERF_EVENTS
>>>   	select KVM_GUEST_MEMFD
>>>   	select KVM_GENERIC_PRE_FAULT_MEMORY
>>> +	select ARM_RMM_RMI
>>>   	help
>>>   	  Support hosting virtualized guest machines.
>>>   
>>> diff --git a/arch/arm64/kvm/rmi.c b/arch/arm64/kvm/rmi.c
>>> index 5ecc8b349869..9d118768550d 100644
>>> --- a/arch/arm64/kvm/rmi.c
>>> +++ b/arch/arm64/kvm/rmi.c
>>> @@ -3,6 +3,7 @@
>>>    * Copyright (C) 2023-2026 ARM Ltd.
>>>    */
>>>   
>>> +#include <linux/arm-rmi-cmds.h>
>>>   #include <linux/kvm_host.h>
>>>   
>>>   #include <asm/virt.h>
>>> @@ -12,7 +13,8 @@ void kvm_init_rmi(void)
>>>   	if (kvm_get_mode() != KVM_MODE_RMM)
>>>   		return;
>>>   
>>> -	/* TODO: Check if the RMI is available */
>>> +	if (!is_rmi_available())
>>> +		return;
>>
>>  From an admin/operator's perspective, kvm_rmi_is_available would
>> silently remain FALSE in either of the following cases:
>> - kvm-arm.mode=rmm is set, but RMI is not available for some reason.

We could add a kvm_info() message for this.

>> - RMI is available, but the admin forgot to set kvm-arm.mode=rmm.

But not this one. We are additionally planning to move the RMM
activation to gate on kvm-arm.mode=rmm. I will send out a patch
soon.

Cheers
Suzuki





More information about the linux-arm-kernel mailing list