eventfd.c (f29f24b5568fd6169e0363c78f1a80db38d0e7e9) eventfd.c (654f1f13ea56b92bacade8ce2725aea0457f91c0)
1/*
2 * kvm eventfd support - use eventfd objects to signal various KVM events
3 *
4 * Copyright 2009 Novell. All Rights Reserved.
5 * Copyright 2010 Red Hat, Inc. and/or its affiliates.
6 *
7 * Author:
8 * Gregory Haskins <ghaskins@novell.com>

--- 30 unchanged lines hidden (view full) ---

39#include <trace/events/kvm.h>
40
41#include <kvm/iodev.h>
42
43#ifdef CONFIG_HAVE_KVM_IRQFD
44
45static struct workqueue_struct *irqfd_cleanup_wq;
46
1/*
2 * kvm eventfd support - use eventfd objects to signal various KVM events
3 *
4 * Copyright 2009 Novell. All Rights Reserved.
5 * Copyright 2010 Red Hat, Inc. and/or its affiliates.
6 *
7 * Author:
8 * Gregory Haskins <ghaskins@novell.com>

--- 30 unchanged lines hidden (view full) ---

39#include <trace/events/kvm.h>
40
41#include <kvm/iodev.h>
42
43#ifdef CONFIG_HAVE_KVM_IRQFD
44
45static struct workqueue_struct *irqfd_cleanup_wq;
46
47bool __attribute__((weak))
48kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args)
49{
50 return true;
51}
52
47static void
48irqfd_inject(struct work_struct *work)
49{
50 struct kvm_kernel_irqfd *irqfd =
51 container_of(work, struct kvm_kernel_irqfd, inject);
52 struct kvm *kvm = irqfd->kvm;
53
54 if (!irqfd->resampler) {

--- 237 unchanged lines hidden (view full) ---

292 struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL;
293 int ret;
294 __poll_t events;
295 int idx;
296
297 if (!kvm_arch_intc_initialized(kvm))
298 return -EAGAIN;
299
53static void
54irqfd_inject(struct work_struct *work)
55{
56 struct kvm_kernel_irqfd *irqfd =
57 container_of(work, struct kvm_kernel_irqfd, inject);
58 struct kvm *kvm = irqfd->kvm;
59
60 if (!irqfd->resampler) {

--- 237 unchanged lines hidden (view full) ---

298 struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL;
299 int ret;
300 __poll_t events;
301 int idx;
302
303 if (!kvm_arch_intc_initialized(kvm))
304 return -EAGAIN;
305
306 if (!kvm_arch_irqfd_allowed(kvm, args))
307 return -EINVAL;
308
300 irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL_ACCOUNT);
301 if (!irqfd)
302 return -ENOMEM;
303
304 irqfd->kvm = kvm;
305 irqfd->gsi = args->gsi;
306 INIT_LIST_HEAD(&irqfd->list);
307 INIT_WORK(&irqfd->inject, irqfd_inject);

--- 658 unchanged lines hidden ---
309 irqfd = kzalloc(sizeof(*irqfd), GFP_KERNEL_ACCOUNT);
310 if (!irqfd)
311 return -ENOMEM;
312
313 irqfd->kvm = kvm;
314 irqfd->gsi = args->gsi;
315 INIT_LIST_HEAD(&irqfd->list);
316 INIT_WORK(&irqfd->inject, irqfd_inject);

--- 658 unchanged lines hidden ---