mirror of
https://github.com/xemu-project/xemu.git
synced 2025-02-27 16:05:40 +00:00
kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create()
Move the init of the irqchip_inject_ioctl field of KVMState out of kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq() can be used even when no irqchip is created (for architectures that support async interrupt notification even without an in kernel irqchip). Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
This commit is contained in:
parent
2879636d55
commit
8732fbd2af
@ -1237,10 +1237,6 @@ static int kvm_irqchip_create(KVMState *s)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->irqchip_inject_ioctl = KVM_IRQ_LINE;
|
|
||||||
if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) {
|
|
||||||
s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS;
|
|
||||||
}
|
|
||||||
kvm_kernel_irqchip = true;
|
kvm_kernel_irqchip = true;
|
||||||
/* If we have an in-kernel IRQ chip then we must have asynchronous
|
/* If we have an in-kernel IRQ chip then we must have asynchronous
|
||||||
* interrupt delivery (though the reverse is not necessarily true)
|
* interrupt delivery (though the reverse is not necessarily true)
|
||||||
@ -1389,6 +1385,11 @@ int kvm_init(void)
|
|||||||
|
|
||||||
s->intx_set_mask = kvm_check_extension(s, KVM_CAP_PCI_2_3);
|
s->intx_set_mask = kvm_check_extension(s, KVM_CAP_PCI_2_3);
|
||||||
|
|
||||||
|
s->irqchip_inject_ioctl = KVM_IRQ_LINE;
|
||||||
|
if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) {
|
||||||
|
s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
ret = kvm_arch_init(s);
|
ret = kvm_arch_init(s);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
goto err;
|
goto err;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user