aboutsummaryrefslogtreecommitdiff
path: root/cpus.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-10-18 00:00:06 +0800
committerJan Kiszka <jan.kiszka@siemens.com>2012-01-19 12:14:40 +0100
commit02c091953cd8c24db46649ad2862b9648c50f865 (patch)
tree3ff157d089409a92ce597a224447da45ffafe8f5 /cpus.c
parentab388a98148e5b44ba0b6bc0269fdb983b4a6838 (diff)
apic: Inject external NMI events via LINT1
On real hardware, NMI button events are injected via the LINT1 line of the APICs. E.g. kdump expect this wiring and gets upset if the per-APIC LINT1 mask is not respected, i.e. if NMIs are injected to VCPUs that should not receive them. Change the APIC emulation code to reflect this. Based on qemu-kvm patch by Lai Jiangshan. CC: Lai Jiangshan <laijs@cn.fujitsu.com> Reported-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Diffstat (limited to 'cpus.c')
-rw-r--r--cpus.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpus.c b/cpus.c
index 2dae549225..f45a438b29 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1217,7 +1217,11 @@ void qmp_inject_nmi(Error **errp)
CPUState *env;
for (env = first_cpu; env != NULL; env = env->next_cpu) {
- cpu_interrupt(env, CPU_INTERRUPT_NMI);
+ if (!env->apic_state) {
+ cpu_interrupt(env, CPU_INTERRUPT_NMI);
+ } else {
+ apic_deliver_nmi(env->apic_state);
+ }
}
#else
error_set(errp, QERR_UNSUPPORTED);