diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 18:36:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 18:36:00 -0400 |
commit | 08d19f51f05a68ce89a289320ce4ed96e757df72 (patch) | |
tree | 31c5d718d0aeaff5083fe533cd6e1f9fbbe846bb /virt/kvm/irq_comm.c | |
parent | 1c95e1b69073cff5ff179e592fa1a1e182c78a17 (diff) | |
parent | 2381ad241d0bea1253a37f314b270848067640bb (diff) |
Merge branch 'kvm-updates/2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
* 'kvm-updates/2.6.28' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (134 commits)
KVM: ia64: Add intel iommu support for guests.
KVM: ia64: add directed mmio range support for kvm guests
KVM: ia64: Make pmt table be able to hold physical mmio entries.
KVM: Move irqchip_in_kernel() from ioapic.h to irq.h
KVM: Separate irq ack notification out of arch/x86/kvm/irq.c
KVM: Change is_mmio_pfn to kvm_is_mmio_pfn, and make it common for all archs
KVM: Move device assignment logic to common code
KVM: Device Assignment: Move vtd.c from arch/x86/kvm/ to virt/kvm/
KVM: VMX: enable invlpg exiting if EPT is disabled
KVM: x86: Silence various LAPIC-related host kernel messages
KVM: Device Assignment: Map mmio pages into VT-d page table
KVM: PIC: enhance IPI avoidance
KVM: MMU: add "oos_shadow" parameter to disable oos
KVM: MMU: speed up mmu_unsync_walk
KVM: MMU: out of sync shadow core
KVM: MMU: mmu_convert_notrap helper
KVM: MMU: awareness of new kvm_mmu_zap_page behaviour
KVM: MMU: mmu_parent_walk
KVM: x86: trap invlpg
KVM: MMU: sync roots on mmu reload
...
Diffstat (limited to 'virt/kvm/irq_comm.c')
-rw-r--r-- | virt/kvm/irq_comm.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c new file mode 100644 index 000000000000..d0169f5e6047 --- /dev/null +++ b/virt/kvm/irq_comm.c | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * irq_comm.c: Common API for in kernel interrupt controller | ||
3 | * Copyright (c) 2007, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
16 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
17 | * Authors: | ||
18 | * Yaozu (Eddie) Dong <Eddie.dong@intel.com> | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #include <linux/kvm_host.h> | ||
23 | #include "irq.h" | ||
24 | |||
25 | #include "ioapic.h" | ||
26 | |||
27 | /* This should be called with the kvm->lock mutex held */ | ||
28 | void kvm_set_irq(struct kvm *kvm, int irq, int level) | ||
29 | { | ||
30 | /* Not possible to detect if the guest uses the PIC or the | ||
31 | * IOAPIC. So set the bit in both. The guest will ignore | ||
32 | * writes to the unused one. | ||
33 | */ | ||
34 | kvm_ioapic_set_irq(kvm->arch.vioapic, irq, level); | ||
35 | #ifdef CONFIG_X86 | ||
36 | kvm_pic_set_irq(pic_irqchip(kvm), irq, level); | ||
37 | #endif | ||
38 | } | ||
39 | |||
40 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi) | ||
41 | { | ||
42 | struct kvm_irq_ack_notifier *kian; | ||
43 | struct hlist_node *n; | ||
44 | |||
45 | hlist_for_each_entry(kian, n, &kvm->arch.irq_ack_notifier_list, link) | ||
46 | if (kian->gsi == gsi) | ||
47 | kian->irq_acked(kian); | ||
48 | } | ||
49 | |||
50 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | ||
51 | struct kvm_irq_ack_notifier *kian) | ||
52 | { | ||
53 | hlist_add_head(&kian->link, &kvm->arch.irq_ack_notifier_list); | ||
54 | } | ||
55 | |||
56 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, | ||
57 | struct kvm_irq_ack_notifier *kian) | ||
58 | { | ||
59 | hlist_del(&kian->link); | ||
60 | } | ||