diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index a511e5fc13944647a483300de3ec8713e74a9258..72135409f15db0c127e5c44f041ddbbb596fee1f 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -934,6 +934,7 @@ struct kvm_enable_cap { #define KVM_CAP_ARM_TMM 300 +#define KVM_CAP_ARM_HISI_IPIV 798 #define KVM_CAP_ARM_VIRT_MSI_BYPASS 799 struct kvm_irq_routing_irqchip { diff --git a/target/arm/kvm.c b/target/arm/kvm.c index 6f66d642907a3341bd9b10dcd4be26c3f796a50f..64164f0ea86c393300efe6ac66c4fdf71c44d490 100644 --- a/target/arm/kvm.c +++ b/target/arm/kvm.c @@ -258,6 +258,22 @@ int kvm_arch_get_default_type(MachineState *ms) return fixed_ipa ? 0 : size; } +static void kvm_update_ipiv_cap(KVMState *s) +{ + int ret; + + if (!kvm_check_extension(s, KVM_CAP_ARM_HISI_IPIV)) { + return; + } + + ret = kvm_vm_enable_cap(s, KVM_CAP_ARM_HISI_IPIV, 0); + if (ret) { + fprintf(stderr, "Could not enable KVM_CAP_ARM_HISI_IPIV: %d\n", ret); + } + + return; +} + int kvm_arch_init(MachineState *ms, KVMState *s) { int ret = 0; @@ -312,6 +328,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) } kvm_arm_init_debug(s); + kvm_update_ipiv_cap(s); return ret; }