|
@@ -44,6 +44,12 @@
|
|
|
|
|
|
|
|
static struct workqueue_struct *irqfd_cleanup_wq;
|
|
static struct workqueue_struct *irqfd_cleanup_wq;
|
|
|
|
|
|
|
|
|
|
+bool __attribute__((weak))
|
|
|
|
|
+kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args)
|
|
|
|
|
+{
|
|
|
|
|
+ return true;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
static void
|
|
static void
|
|
|
irqfd_inject(struct work_struct *work)
|
|
irqfd_inject(struct work_struct *work)
|
|
|
{
|
|
{
|
|
@@ -297,6 +303,9 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
|
|
|
if (!kvm_arch_intc_initialized(kvm))
|
|
if (!kvm_arch_intc_initialized(kvm))
|
|
|
return -EAGAIN;
|
|
return -EAGAIN;
|
|
|
|
|
|
|
|
|
|
+ if (!kvm_arch_irqfd_allowed(kvm, args))
|
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
+
|
|
|
irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL);
|
|
irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL);
|
|
|
if (!irqfd)
|
|
if (!irqfd)
|
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|