[PATCH RFC v2 0/2] KVM: arm64: CCA: Add MEC policy support for CCA Realms
From: Kohei Enju
Date: Wed Nov 11 2026 - 22:37:57 EST
This series adds basic support for configuring the Memory Encryption
Context (MEC) policy for Arm CCA Realms.
Patch 1 introduces the KVM_ARM_VM_RMI_CTRL device attribute group to
allow userspace to configure Realm VM parameters before the Realm is
created using KVM_SET_DEVICE_ATTR, and uses it to let userspace select
the MEC policy before the Realm is created.
Patch 2 adds a misc cgroup resource for CCA MECIDs and charges one unit
for each Realm using the private MEC policy.
Feedback on the proposed KVM ABI and on using misc cgroup for MECID
accounting would be appreciated.
This series is based on Steven and Suzuki's CCA host series [1]. I am
sending it as an RFC while the CCA host series is not yet upstreamed,
and plan to update it as needed to track future revisions of the host
series. Once the host series is merged, I plan to post a non-RFC
version.
Since the base series is not yet upstream, some CI systems may not be
able to test this series successfully. This is expected for this RFC.
Changes
- RFC v2:
- Use kvm_device_attr instead of a dedicated ioctl.
- Rebase onto the CCA host series branch listed in [1].
- RFC v1: https://lore.kernel.org/all/20260724094120.166536-1-enju.kohei@xxxxxxxxxxx/
[1]
https://gitlab.arm.com/linux-arm/linux-cca
branch: cca-host-mm/v1/integration
Signed-off-by: Kohei Enju <enju.kohei@xxxxxxxxxxx>
---
Kohei Enju (2):
KVM: arm64: CCA: Add support for configuring the Realm MEC policy
cgroup/misc: Add support for Arm CCA MECIDs
Documentation/virt/kvm/devices/vm.rst | 25 ++++++++
arch/arm64/include/asm/kvm_rmi.h | 7 +++
arch/arm64/include/uapi/asm/kvm.h | 4 ++
arch/arm64/kvm/arm.c | 4 ++
arch/arm64/kvm/rmi.c | 101 +++++++++++++++++++++++++++++++-
drivers/firmware/arm_rmm/rmi.c | 10 ++++
include/linux/arm-rmi-cmds.h | 1 +
include/linux/misc_cgroup.h | 4 ++
kernel/cgroup/misc.c | 4 ++
tools/arch/arm64/include/uapi/asm/kvm.h | 4 ++
10 files changed, 163 insertions(+), 1 deletion(-)
---
base-commit: a7644e0425de41ed0338cb73eebe5d14baf6be95
change-id: 20261112-mm-v1-mec-8c5072d6c331
Best regards,
--
Kohei Enju <enju.kohei@xxxxxxxxxxx>