Skip to contentSkip to conversation

x86: Raise inter-processor NMI and SMI

PATCH In review Jan Kiszka 1 participant 2 messages Apr 12, 2008

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 2/3 x86: Raise inter-processor NMI and SMI

[ This patch obsoletes
http://permalink.gmane.org/gmane.comp.emulators.qemu/22989. ]

Make the APIC deliver inter-processor NMI and SMI requests. NMI delivery was successfully tested in the context of kgdb (Linux kernel debugger), SMI is included for the sake of completeness.

---
hw/apic.c | 8 +++++++-

1 file changed, 7 insertions(+), 1 deletion(-)
hw/apic.c +7 -1
Index: b/hw/apic.c
===================================================================
@@ -216,8 +216,14 @@ static void apic_bus_deliver(const uint3
            break;
 
        case APIC_DM_SMI:
+            foreach_apic(apic_iter, deliver_bitmask,
+                cpu_interrupt(apic_iter->cpu_env, CPU_INTERRUPT_SMI) );
+            return;
+
        case APIC_DM_NMI:
-            break;
+            foreach_apic(apic_iter, deliver_bitmask,
+                cpu_interrupt(apic_iter->cpu_env, CPU_INTERRUPT_NMI) );
+            return;
 
        case APIC_DM_INIT:
            /* normal INIT IPI sent to processors */
author
#1 lore raw
Quoted 9 lines · Jan Kiszka

[ This patch obsoletes
http://permalink.gmane.org/gmane.comp.emulators.qemu/22989. ]

Make the APIC deliver inter-processor NMI and SMI requests. NMI delivery was successfully tested in the context of kgdb (Linux kernel debugger), SMI is included for the sake of completeness.

Non-broken patch attached. Sorry.

Jan

---
 hw/apic.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
hw/apic.c +7 -1
Index: b/hw/apic.c
===================================================================
@@ -216,8 +216,14 @@ static void apic_bus_deliver(const uint3
             break;
 
         case APIC_DM_SMI:
+            foreach_apic(apic_iter, deliver_bitmask,
+                cpu_interrupt(apic_iter->cpu_env, CPU_INTERRUPT_SMI) );
+            return;
+
         case APIC_DM_NMI:
-            break;
+            foreach_apic(apic_iter, deliver_bitmask,
+                cpu_interrupt(apic_iter->cpu_env, CPU_INTERRUPT_NMI) );
+            return;
 
         case APIC_DM_INIT:
             /* normal INIT IPI sent to processors */