[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250624125032.GA111675@e124191.cambridge.arm.com>
Date: Tue, 24 Jun 2025 13:50:32 +0100
From: Joey Gouly <joey.gouly@....com>
To: Steven Price <steven.price@....com>
Cc: kvm@...r.kernel.org, kvmarm@...ts.linux.dev,
Suzuki K Poulose <suzuki.poulose@....com>,
Catalin Marinas <catalin.marinas@....com>,
Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>,
James Morse <james.morse@....com>,
Oliver Upton <oliver.upton@...ux.dev>,
Zenghui Yu <yuzenghui@...wei.com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Alexandru Elisei <alexandru.elisei@....com>,
Christoffer Dall <christoffer.dall@....com>,
Fuad Tabba <tabba@...gle.com>, linux-coco@...ts.linux.dev,
Ganapatrao Kulkarni <gankulkarni@...amperecomputing.com>,
Gavin Shan <gshan@...hat.com>,
Shanker Donthineni <sdonthineni@...dia.com>,
Alper Gun <alpergun@...gle.com>,
"Aneesh Kumar K . V" <aneesh.kumar@...nel.org>,
Emi Kisanuki <fj0570is@...itsu.com>
Subject: Re: [PATCH v9 28/43] arm64: RME: Allow checking SVE on VM instance
On Wed, Jun 11, 2025 at 11:48:25AM +0100, Steven Price wrote:
> From: Suzuki K Poulose <suzuki.poulose@....com>
>
> Given we have different types of VMs supported, check the
> support for SVE for the given instance of the VM to accurately
> report the status.
>
> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
> Signed-off-by: Steven Price <steven.price@....com>
> Reviewed-by: Gavin Shan <gshan@...hat.com>
Reviewed-by: Joey Gouly <joey.gouly@....com>
> ---
> arch/arm64/include/asm/kvm_rme.h | 2 ++
> arch/arm64/kvm/arm.c | 5 ++++-
> arch/arm64/kvm/rme.c | 5 +++++
> 3 files changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/include/asm/kvm_rme.h b/arch/arm64/include/asm/kvm_rme.h
> index 2d7d7233c525..af5150c084ce 100644
> --- a/arch/arm64/include/asm/kvm_rme.h
> +++ b/arch/arm64/include/asm/kvm_rme.h
> @@ -94,6 +94,8 @@ void kvm_init_rme(void);
> u32 kvm_realm_ipa_limit(void);
> u32 kvm_realm_vgic_nr_lr(void);
>
> +bool kvm_rme_supports_sve(void);
> +
> int kvm_realm_enable_cap(struct kvm *kvm, struct kvm_enable_cap *cap);
> int kvm_init_realm_vm(struct kvm *kvm);
> void kvm_destroy_realm(struct kvm *kvm);
> diff --git a/arch/arm64/kvm/arm.c b/arch/arm64/kvm/arm.c
> index 4eb229b6c315..d1ef12fe6176 100644
> --- a/arch/arm64/kvm/arm.c
> +++ b/arch/arm64/kvm/arm.c
> @@ -426,7 +426,10 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
> r = get_kvm_ipa_limit();
> break;
> case KVM_CAP_ARM_SVE:
> - r = system_supports_sve();
> + if (kvm_is_realm(kvm))
> + r = kvm_rme_supports_sve();
> + else
> + r = system_supports_sve();
> break;
> case KVM_CAP_ARM_PTRAUTH_ADDRESS:
> case KVM_CAP_ARM_PTRAUTH_GENERIC:
> diff --git a/arch/arm64/kvm/rme.c b/arch/arm64/kvm/rme.c
> index 5f1fdefc0364..6bd21223a8be 100644
> --- a/arch/arm64/kvm/rme.c
> +++ b/arch/arm64/kvm/rme.c
> @@ -38,6 +38,11 @@ static bool rme_has_feature(unsigned long feature)
> return !!u64_get_bits(rmm_feat_reg0, feature);
> }
>
> +bool kvm_rme_supports_sve(void)
> +{
> + return rme_has_feature(RMI_FEATURE_REGISTER_0_SVE_EN);
> +}
> +
> static int rmi_check_version(void)
> {
> struct arm_smccc_res res;
> --
> 2.43.0
>
Powered by blists - more mailing lists