Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kvm: Check irqchip mode before assign irqfd
When assigning kvm irqfd we didn't check the irqchip mode but we allow KVM_IRQFD to succeed with all the irqchip modes. However it does not make much sense to create irqfd even without the kernel chips. Let's provide a arch-dependent helper to check whether a specific irqfd is allowed by the arch. At least for x86, it should make sense to check: - when irqchip mode is NONE, all irqfds should be disallowed, and, - when irqchip mode is SPLIT, irqfds that are with resamplefd should be disallowed. For either of the case, previously we'll silently ignore the irq or the irq ack event if the irqchip mode is incorrect. However that can cause misterious guest behaviors and it can be hard to triage. Let's fail KVM_IRQFD even earlier to detect these incorrect configurations. CC: Paolo Bonzini <[email protected]> CC: Radim Krčmář <[email protected]> CC: Alex Williamson <[email protected]> CC: Eduardo Habkost <[email protected]> Signed-off-by: Peter Xu <[email protected]> Cc: [email protected] Signed-off-by: Paolo Bonzini <[email protected]>
- Loading branch information