[PATCH v4 9/9] KVM: arm64: Ensure that SME controls are disabled in protected mode
Mark Brown
broonie at kernel.org
Mon Jun 3 07:43:02 PDT 2024
On Mon, Jun 03, 2024 at 01:28:51PM +0100, Fuad Tabba wrote:
> +++ b/arch/arm64/kvm/fpsimd.c
> @@ -90,6 +90,13 @@ void kvm_arch_vcpu_load_fp(struct kvm_vcpu *vcpu)
> fpsimd_save_and_flush_cpu_state();
> }
> }
> +
> + /*
> + * If normal guests gain SME support, maintain this behavior for pKVM
> + * guests, which don't support SME.
> + */
> + WARN_ON(is_protected_kvm_enabled() && system_supports_sme() &&
> + read_sysreg_s(SYS_SVCR));
> }
The comment doesn't line up clearly with the check here, we're checking
if the hypervisor supports protected guests not if the current guest is
protected. At this point we're dealing with the host state rather than
the guest state so the guest being protected or not doesn't matter when
we check SVCR. I'm not sure this assert really makes sense, or perhaps
it should be hoisted into the above system_support_sme() section?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240603/199d751d/attachment.sig>
More information about the linux-arm-kernel
mailing list