[PATCH v23 14/14] KVM: arm64: Prevent unsupported vcpu features for VM types

Marc Zyngier maz at kernel.org
Fri Oct 9 05:16:57 PDT 2026


On Fri, 09 Oct 2026 11:10:55 +0100,
Fuad Tabba <tabba at google.com> wrote:
> 
> Hi Marc,
> 
> On Fri, 09 Oct 2026 09:55:52 +0100, Marc Zyngier <maz at kernel.org> 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.

I think eventually we will have to implement this stuff as a pair of
masks on a backend basis: one for what is acceptable, one for what is
mandatory.

In the meantime, I'll fold the above hack in.

Thanks,

	M.

-- 
Without deviation from the norm, progress is not possible.



More information about the linux-arm-kernel mailing list