From: Peng Liang liangpeng10@huawei.com
hulk inclusion category: feature bugzilla: NA CVE: NA
Add KVM_CAP_ARM_CPU_FEATURE extension for userpace to check whether KVM supports to set CPU features in AArch64.
Signed-off-by: zhanghailiang zhang.zhanghailiang@huawei.com Signed-off-by: Peng Liang liangpeng10@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- include/uapi/linux/kvm.h | 2 ++ virt/kvm/arm/arm.c | 1 + 2 files changed, 3 insertions(+)
diff --git a/include/uapi/linux/kvm.h b/include/uapi/linux/kvm.h index 69827df01bfd..14f6e58ae6e5 100644 --- a/include/uapi/linux/kvm.h +++ b/include/uapi/linux/kvm.h @@ -965,6 +965,8 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_ARM_VM_IPA_SIZE 165 /* returns maximum IPA bits for a VM */ #define KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 174
+#define KVM_CAP_ARM_CPU_FEATURE 555 + #ifdef KVM_CAP_IRQ_ROUTING
struct kvm_irq_routing_irqchip { diff --git a/virt/kvm/arm/arm.c b/virt/kvm/arm/arm.c index 37a9288dcac7..7a61b194a396 100644 --- a/virt/kvm/arm/arm.c +++ b/virt/kvm/arm/arm.c @@ -218,6 +218,7 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) case KVM_CAP_MP_STATE: case KVM_CAP_IMMEDIATE_EXIT: case KVM_CAP_ARM_IRQ_LINE_LAYOUT_2: + case KVM_CAP_ARM_CPU_FEATURE: r = 1; break; case KVM_CAP_ARM_SET_DEVICE_ADDR: