Re: [PATCH v19 19/20] KVM: arm64: CCA: Expose SVE VL register before VCPU finalization
From: Gavin Shan
Date: Sun Sep 27 2026 - 21:29:44 EST
On 9/21/26 7:28 AM, Suzuki K Poulose wrote:
From: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
Userspace must configure the SVE vector length before the Realm is created
(as it is part of the parameter for Realm creation), but the Realm VCPUs
cannot be finalized until after the Realm Descriptor has been created.
KVM_GET_REG_LIST currently rejects the unfinalized VCPUs, which prevents
the userspace from discovering and configuring the VLs for the Realm.
Allow KVM_GET_REG_LIST for unfinalized RECs and make the SVE register
enumeration handle the unfinalized case explicitly. i.e., only expose
KVM_REG_ARM64_SVE_VLS before SVE is finalized.
One adverse side effect of this change is that a KVM_GET_REG_LIST call that
only probes for the array size will now succeed even if SVE is not
finalized, but that seems harmless since the following KVM_GET_REG_LIST
with the full array will fail.
Signed-off-by: Jean-Philippe Brucker <jean-philippe@xxxxxxxxxx>
Signed-off-by: Steven Price <steven.price@xxxxxxx>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@xxxxxxx>
---
Changes since v17:
- Rewrite the commit description to clearly describe the purpose
---
arch/arm64/kvm/arm.c | 15 ++++++++++++++-
arch/arm64/kvm/guest.c | 10 +++++-----
2 files changed, 19 insertions(+), 6 deletions(-)
Reviewed-by: Gavin Shan <gshan@xxxxxxxxxx>