On Thu, 25 Jul 2019 10:40:11 -0500 Shivaprasad G Bhat <sb...@linux.ibm.com> wrote:
> The KVM_CAP_PPC_UNSET_IRQ is part of kernel since v2.6.36. > Kernels older than that are not supported anymore. > So, remove the checks. > Ok to drop the dead paths but we do need this cap to be present. int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int level) { unsigned virq = level ? KVM_INTERRUPT_SET_LEVEL : KVM_INTERRUPT_UNSET; ... } Please add an error message and exit in kvm_arch_init() like you did for SET_LEVEL. > Signed-off-by: Shivaprasad G Bhat <sb...@linux.ibm.com> > --- > target/ppc/kvm.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c > index 5ab5e6c6a9..94a2ecb84f 100644 > --- a/target/ppc/kvm.c > +++ b/target/ppc/kvm.c > @@ -55,7 +55,6 @@ const KVMCapabilityInfo kvm_arch_required_capabilities[] = { > KVM_CAP_LAST_INFO > }; > > -static int cap_interrupt_unset; > static int cap_segstate; > static int cap_booke_sregs; > static int cap_ppc_smt; > @@ -104,7 +103,6 @@ static int kvmppc_get_dec_bits(void); > > int kvm_arch_init(MachineState *ms, KVMState *s) > { > - cap_interrupt_unset = kvm_check_extension(s, KVM_CAP_PPC_UNSET_IRQ); > cap_segstate = kvm_check_extension(s, KVM_CAP_PPC_SEGSTATE); > cap_booke_sregs = kvm_check_extension(s, KVM_CAP_PPC_BOOKE_SREGS); > cap_ppc_smt_possible = kvm_vm_check_extension(s, > KVM_CAP_PPC_SMT_POSSIBLE); > @@ -1309,7 +1307,7 @@ int kvmppc_set_interrupt(PowerPCCPU *cpu, int irq, int > level) > return 0; > } > > - if (!kvm_enabled() || !cap_interrupt_unset) { > + if (!kvm_enabled()) { > return 0; > } > >