[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 04/16] apic: Inject external NMI events via LINT1
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH v5 04/16] apic: Inject external NMI events via LINT1 |
Date: |
Thu, 15 Dec 2011 13:33:19 +0100 |
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 <address@hidden>
Reported-by: Kenji Kaneshige <address@hidden>
Signed-off-by: Jan Kiszka <address@hidden>
---
hw/apic.c | 7 +++++++
hw/apic.h | 1 +
monitor.c | 6 +++++-
3 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/hw/apic.c b/hw/apic.c
index 4b97b17..b9d733c 100644
--- a/hw/apic.c
+++ b/hw/apic.c
@@ -205,6 +205,13 @@ void apic_deliver_pic_intr(DeviceState *d, int level)
}
}
+void apic_deliver_nmi(DeviceState *d)
+{
+ APICState *s = DO_UPCAST(APICState, busdev.qdev, d);
+
+ apic_local_deliver(s, APIC_LVT_LINT1);
+}
+
#define foreach_apic(apic, deliver_bitmask, code) \
{\
int __i, __j, __mask;\
diff --git a/hw/apic.h b/hw/apic.h
index a5c910f..a62d83b 100644
--- a/hw/apic.h
+++ b/hw/apic.h
@@ -8,6 +8,7 @@ void apic_deliver_irq(uint8_t dest, uint8_t dest_mode, uint8_t
delivery_mode,
uint8_t vector_num, uint8_t trigger_mode);
int apic_accept_pic_intr(DeviceState *s);
void apic_deliver_pic_intr(DeviceState *s, int level);
+void apic_deliver_nmi(DeviceState *d);
int apic_get_interrupt(DeviceState *s);
void apic_reset_irq_delivered(void);
int apic_get_irq_delivered(void);
diff --git a/monitor.c b/monitor.c
index 1be222e..6bd0fb1 100644
--- a/monitor.c
+++ b/monitor.c
@@ -2354,7 +2354,11 @@ static int do_inject_nmi(Monitor *mon, const QDict
*qdict, QObject **ret_data)
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);
+ }
}
return 0;
--
1.7.3.4
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, (continued)
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Anthony Liguori, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 06/16] apic: Introduce backend/frontend infrastructure for KVM reuse, Avi Kivity, 2011/12/20
[Qemu-devel] [PATCH v5 09/16] ioapic: Introduce backend/frontend infrastructure for KVM reuse, Jan Kiszka, 2011/12/15
[Qemu-devel] [PATCH v5 04/16] apic: Inject external NMI events via LINT1,
Jan Kiszka <=
[Qemu-devel] [PATCH v5 13/16] kvm: x86: Add user space part for in-kernel APIC, Jan Kiszka, 2011/12/15
Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Marcelo Tosatti, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Jan Kiszka, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Jan Kiszka, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Avi Kivity, 2011/12/20
- Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Anthony Liguori, 2011/12/19
- Re: [Qemu-devel] [PATCH v5 00/16] uq/master: Introduce basic irqchip support, Jan Kiszka, 2011/12/19