Re: [PATCH v19 5/7] firmware: arm_rmm: Activate the RMM

From: Catalin Marinas

Date: Wed Oct 21 2026 - 13:49:22 EST


On Wed, Oct 21, 2026 at 03:30:07PM +0100, Marc Zyngier wrote:
> On Wed, 21 Oct 2026 10:58:13 +0100,
> Suzuki K Poulose <suzuki.poulose@xxxxxxx> wrote:
> >
> > On 29/09/2026 12:15, Catalin Marinas wrote:
> > > On Mon, Sep 28, 2026 at 07:28:20PM +0100, Suzuki K Poulose wrote:
> > >> On 28/09/2026 19:01, Catalin Marinas wrote:
> > >>> possible, to defer the RMM activation until the first user (still do the
> > >>> RMI probing as an initcall). If we run on RME-capable hardware and
> > >>> firmware but don't care about realms or TSM, we still get the normal OS
> > >>> functionality.
> > >>
> > >> Would you prefer this in the first drop of the RMM ? Or is this
> > >> something we could add as a separate series ?
> > >
> > > I think we could add the deferring as a separate patch, maybe together
> > > with the KVM bits. An advantage of keeping it here if we merge this
> > > first is that we still exercise the activation path without full realm
> > > support or TSM. Otherwise a lot of this would be dead code until the
> > > other series arrive. Either way, do it as as separate patch on top of
> > > this series.
> > >
> >
> > I have been looking at the "on-demand" activation support and came
> > across the following design decision.
> >
> > * We have KVM_CAP_ARM_RME which advertises that KVM can create Realm VMs
> > to the userspace. A VMM could check this before it creates a Realm VM
> > using KVM_CREATE_VM with type=RealmVM.
> >
> >
> > Now, we could delay the RMM activation as late as the KVM_CREATE_VM and
> > kick it off while we initialise the kvm as part of kvm_arch_init_vm().
> > But if that fails, we would fail the KVM_CREATE_VM.
> >
> > The question is, what should KVM_CAP_ARM_RME indicate ? We could
> > initially enable the cap based on the presence of RMM (but not
> > activated). However, should we turn the KVM_CAP_ARM_RME=off when we
> > fail to activate the RMM ? Is that senisble ? (i.e., runtime
> > disabling a cap).
>
> I think this sets a bad precedent. If activation can fail, KVM end-up
> not delivering on the promise that it makes, and that's not great.
>
> My take is that the least surprising behaviour is best. If you have
> bought into the CCA kool-aid by enabling it on the kernel command
> line, that's not by accident. You expect your VMs to reliably be
> created when KVM tells you that CCA is available.
>
> So KVM_CAP_ARM_RME should indicate whether the RMM has been
> successfully activated, and nothing else.

Tying activation to kvm-arm.mode=rmm works for me, roughly similar to
kvm-arm.mode=protected. It's still an eager activation (just
conditional) and KVM_CAP_ARM_RME then only reports whether activation
succeeded. We lose kexec/hibernation but that's fine, it was explicitly
requested on the command line.

There's also the case of a host-only PCIe TSM (without realms). IIUC
(grep'ing FIRME spec) on an RME system IDE key programming goes via the
RMM, so this would need the RMM activated even without KVM. Not sure it
makes sense without realms, so I think we can ignore it until there's a
concrete use case (and add one more hook to activate the RMM).

--
Catalin