diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-21 00:13:26 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-21 00:13:26 -0400 |
commit | f076ab8d048f152b968bb1c6313fed88abb037fe (patch) | |
tree | fe9ff7bc40d04c5a12eb41a90cc0e1dbf8ae4e45 /virt/kvm/ioapic.c | |
parent | db6d8c7a4027b48d797b369a53f8470aaeed7063 (diff) | |
parent | 597a5f551ec4cd0aa0966e4fff4684ecc8c31c0d (diff) |
Merge branch 'kvm-updates-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm
* 'kvm-updates-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/avi/kvm: (70 commits)
KVM: Adjust smp_call_function_mask() callers to new requirements
KVM: MMU: Fix potential race setting upper shadow ptes on nonpae hosts
KVM: x86 emulator: emulate clflush
KVM: MMU: improve invalid shadow root page handling
KVM: MMU: nuke shadowed pgtable pages and ptes on memslot destruction
KVM: Prefix some x86 low level function with kvm_, to avoid namespace issues
KVM: check injected pic irq within valid pic irqs
KVM: x86 emulator: Fix HLT instruction
KVM: Apply the kernel sigmask to vcpus blocked due to being uninitialized
KVM: VMX: Add ept_sync_context in flush_tlb
KVM: mmu_shrink: kvm_mmu_zap_page requires slots_lock to be held
x86: KVM guest: make kvm_smp_prepare_boot_cpu() static
KVM: SVM: fix suspend/resume support
KVM: s390: rename private structures
KVM: s390: Set guest storage limit and offset to sane values
KVM: Fix memory leak on guest exit
KVM: s390: dont allocate dirty bitmap
KVM: move slots_lock acquision down to vapic_exit
KVM: VMX: Fake emulate Intel perfctr MSRs
KVM: VMX: Fix a wrong usage of vmcs_config
...
Diffstat (limited to 'virt/kvm/ioapic.c')
-rw-r--r-- | virt/kvm/ioapic.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/virt/kvm/ioapic.c b/virt/kvm/ioapic.c index 44589088941f..c0d22870ee9c 100644 --- a/virt/kvm/ioapic.c +++ b/virt/kvm/ioapic.c | |||
@@ -146,6 +146,11 @@ static int ioapic_inj_irq(struct kvm_ioapic *ioapic, | |||
146 | return kvm_apic_set_irq(vcpu, vector, trig_mode); | 146 | return kvm_apic_set_irq(vcpu, vector, trig_mode); |
147 | } | 147 | } |
148 | 148 | ||
149 | static void ioapic_inj_nmi(struct kvm_vcpu *vcpu) | ||
150 | { | ||
151 | kvm_inject_nmi(vcpu); | ||
152 | } | ||
153 | |||
149 | static u32 ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest, | 154 | static u32 ioapic_get_delivery_bitmask(struct kvm_ioapic *ioapic, u8 dest, |
150 | u8 dest_mode) | 155 | u8 dest_mode) |
151 | { | 156 | { |
@@ -239,8 +244,19 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, int irq) | |||
239 | } | 244 | } |
240 | } | 245 | } |
241 | break; | 246 | break; |
242 | 247 | case IOAPIC_NMI: | |
243 | /* TODO: NMI */ | 248 | for (vcpu_id = 0; deliver_bitmask != 0; vcpu_id++) { |
249 | if (!(deliver_bitmask & (1 << vcpu_id))) | ||
250 | continue; | ||
251 | deliver_bitmask &= ~(1 << vcpu_id); | ||
252 | vcpu = ioapic->kvm->vcpus[vcpu_id]; | ||
253 | if (vcpu) | ||
254 | ioapic_inj_nmi(vcpu); | ||
255 | else | ||
256 | ioapic_debug("NMI to vcpu %d failed\n", | ||
257 | vcpu->vcpu_id); | ||
258 | } | ||
259 | break; | ||
244 | default: | 260 | default: |
245 | printk(KERN_WARNING "Unsupported delivery mode %d\n", | 261 | printk(KERN_WARNING "Unsupported delivery mode %d\n", |
246 | delivery_mode); | 262 | delivery_mode); |
@@ -291,7 +307,8 @@ void kvm_ioapic_update_eoi(struct kvm *kvm, int vector) | |||
291 | __kvm_ioapic_update_eoi(ioapic, i); | 307 | __kvm_ioapic_update_eoi(ioapic, i); |
292 | } | 308 | } |
293 | 309 | ||
294 | static int ioapic_in_range(struct kvm_io_device *this, gpa_t addr) | 310 | static int ioapic_in_range(struct kvm_io_device *this, gpa_t addr, |
311 | int len, int is_write) | ||
295 | { | 312 | { |
296 | struct kvm_ioapic *ioapic = (struct kvm_ioapic *)this->private; | 313 | struct kvm_ioapic *ioapic = (struct kvm_ioapic *)this->private; |
297 | 314 | ||