Re: [PATCH v23 14/14] KVM: arm64: Prevent unsupported vcpu features for VM types
From: Fuad Tabba
Date: Fri Oct 09 2026 - 06:14:39 EST
Hi Marc,
On Fri, 09 Oct 2026 09:55:52 +0100, Marc Zyngier <maz@xxxxxxxxxx> wrote:
[...]
> A rebase would be a terrible idea. This thing *must* go on its own
> branch, and not depend on anything else.
>
> I can however fix things at merge time. is something like this what
> you had in mind? It compiles, and is therefore perfect...
Yes, that's what I had in mind, but please keep the PSCI 0.2 check
from kvm_vcpu_init_check_features():
/* EL2 implements PSCI 1.1; the host must not dispatch as 0.1. */
if (vcpu_is_protected(vcpu) &&
!test_bit(KVM_ARM_VCPU_PSCI_0_2, &features))
return -EINVAL;
Folding the allowed set into the mask covers the rest of the block you
dropped, but a mask can only reject a feature, not require one.
Without the check a protected vCPU can init without PSCI_0_2, and the
host then dispatches the forwarded calls as PSCI 0.1, while EL2
returns 1.1 to the guest.
Cheers,
/fuad