Re: [PATCH v6 01/11] KVM: arm64: CCA: Introduce Realms

From: Kohei Enju

Date: Fri Dec 04 2026 - 11:07:30 EST


On 12/04 11:57, Steven Price wrote:
> From: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
>
> Introduce the Realm VM flavor and per-VM state tracking. Realm and
> protected pKVM states are mutually exclusive, so share their storage
> in kvm_arch. Update pKVM callers of the protected VM helpers to
> check the VM flavor.
>
> Realm VMs cannot be created yet; RMI initialization and the creation
> UABI follow in later patches.
>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
> Signed-off-by: Steven Price <steven.price@xxxxxxx>
> Reviewed-by: Fuad Tabba <fuad.tabba@xxxxxxxxx>

Reviewed-by: Kohei Enju <enju.kohei@xxxxxxxxxxx>

Minor nit below.

[...]
> +/**
> + * enum realm_state - State of a Realm
> + *
> + * Mirrors the RMM's Realm lifecycle states where they are meaningful to KVM,
> + * with REALM_STATE_DYING being a KVM-internal state used to prevent further

Strictly speaking, REALM_STATE_NONE and REALM_STATE_DEAD are also
KVM-internal states, so I think the comment should reflect this if you
resend the series.

Thanks,
Kohei

> + * requests while teardown is in progress. KVM does not track REALM_SYSTEM_OFF
> + * or REALM_ZOMBIE separately as they naturally lead to teardown.
> + */
> +enum realm_state {
> + /**
> + * @REALM_STATE_NONE:
> + * Realm has not yet been created. rmi_realm_create() has not
> + * yet been called.
> + */
> + REALM_STATE_NONE,
> + /**
> + * @REALM_STATE_NEW:
> + * Realm is under construction, Realm Descriptor has been created,
> + * but it is not yet activated. Memory may be populated.
> + */
> + REALM_STATE_NEW,
> + /**
> + * @REALM_STATE_ACTIVE:
> + * Realm has been created and is eligible for execution with
> + * rmi_rec_enter(). Memory may no longer be populated with known
> + * contents.
> + */
> + REALM_STATE_ACTIVE,
> + /**
> + * @REALM_STATE_DYING:
> + * Realm is in the process of being destroyed or has already been
> + * destroyed.
> + */
> + REALM_STATE_DYING,
> + /**
> + * @REALM_STATE_DEAD:
> + * Realm has been destroyed.
> + */
> + REALM_STATE_DEAD
> +};