• Dave Martin's avatar
    KVM: arm64/sve: Allow userspace to enable SVE for vcpus · 9a3cdf26
    Dave Martin authored
    Now that all the pieces are in place, this patch offers a new flag
    KVM_ARM_VCPU_SVE that userspace can pass to KVM_ARM_VCPU_INIT to
    turn on SVE for the guest, on a per-vcpu basis.
    
    As part of this, support for initialisation and reset of the SVE
    vector length set and registers is added in the appropriate places,
    as well as finally setting the KVM_ARM64_GUEST_HAS_SVE vcpu flag,
    to turn on the SVE support code.
    
    Allocation of the SVE register storage in vcpu->arch.sve_state is
    deferred until the SVE configuration is finalized, by which time
    the size of the registers is known.
    
    Setting the vector lengths supported by the vcpu is considered
    configuration of the emulated hardware rather than runtime
    configuration, so no support is offered for changing the vector
    lengths available to an existing vcpu across reset.
    Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
    Reviewed-by: default avatarJulien Thierry <julien.thierry@arm.com>
    Tested-by: default avatarzhang.lei <zhang.lei@jp.fujitsu.com>
    Signed-off-by: default avatarMarc Zyngier <marc.zyngier@arm.com>
    9a3cdf26
reset.c 10.6 KB