• Bibo Mao's avatar
    LoongArch: KVM: Add VM feature detection function · a53f48b6
    Bibo Mao authored
    Loongson SIMD Extension (LSX), Loongson Advanced SIMD Extension (LASX)
    and Loongson Binary Translation (LBT) features are defined in register
    CPUCFG2. Two kinds of LSX/LASX/LBT feature detection are added here, one
    is VCPU feature, and the other is VM feature. VCPU feature dection can
    only work with VCPU thread itself, and requires VCPU thread is created
    already. So LSX/LASX/LBT feature detection for VM is added also, it can
    be done even if VM is not created, and also can be done by any threads
    besides VCPU threads.
    
    Here ioctl command KVM_HAS_DEVICE_ATTR is added for VM, and macro
    KVM_LOONGARCH_VM_FEAT_CTRL is added to check supported feature. And
    five sub-features relative with LSX/LASX/LBT are added as following:
     KVM_LOONGARCH_VM_FEAT_LSX
     KVM_LOONGARCH_VM_FEAT_LASX
     KVM_LOONGARCH_VM_FEAT_X86BT
     KVM_LOONGARCH_VM_FEAT_ARMBT
     KVM_LOONGARCH_VM_FEAT_MIPSBT
    Signed-off-by: default avatarBibo Mao <maobibo@loongson.cn>
    Signed-off-by: default avatarHuacai Chen <chenhuacai@loongson.cn>
    a53f48b6
kvm.h 3.25 KB