Skip to contentSkip to conversation

target-i386: fix "info lapic" segfault on isapc

PATCH Applied Tejaswini 2 participants 2 messages Mar 28, 2017

lore
Share & tools
lore

Tejaswini

author
#0 lore raw

PATCH 1/1 target-i386: fix "info lapic" segfault on isapc

From: Tejaswini Poluri <[email protected]>

Start QEMU with
"qemu-system-x86_64 -nographic -M isapc -serial none-monitor stdio" and enter "info lapic" at the monitor prompt ⇒ Segmentation fault

---
 target/i386/helper.c | 4 ++++
 1 file changed, 4 insertions(+)
target/i386/helper.c +4 -0
index e2af340..f11cac6 100644
@@ -326,6 +326,10 @@ void x86_cpu_dump_local_apic_state(CPUState *cs, FILE *f,
 {
     X86CPU *cpu = X86_CPU(cs);
     APICCommonState *s = APIC_COMMON(cpu->apic_state);
+    if (!s) {
+        cpu_fprintf(f, "local apic state not available\n");
+        return;
+    }
     uint32_t *lvt = s->lvt;
 
     cpu_fprintf(f, "dumping local APIC state for CPU %-2u\n\n",
Signature · 1 line
2.7.4
#1 lore raw
Quoted 18 lines · Tejaswini

From: Tejaswini Poluri <[email protected]>

Start QEMU with
"qemu-system-x86_64 -nographic -M isapc -serial none-monitor stdio" and enter "info lapic" at the monitor prompt ⇒ Segmentation fault

---
 target/i386/helper.c | 4 ++++
 1 file changed, 4 insertions(+)
target/i386/helper.c +0 -0
index e2af340..f11cac6 100644

target/i386/helper.c void x86_cpu_dump_local_apic_state(CPUState *cs, FILE *f, · line 335

Quoted 10 lines
target/i386/helper.c +4 -0
@@ -326,6 +326,10 @@ void x86_cpu_dump_local_apic_state(CPUState *cs, FILE *f,
 {
     X86CPU *cpu = X86_CPU(cs);
     APICCommonState *s = APIC_COMMON(cpu->apic_state);
+    if (!s) {
+        cpu_fprintf(f, "local apic state not available\n");
+        return;
+    }
     uint32_t *lvt = s->lvt;
 
     cpu_fprintf(f, "dumping local APIC state for CPU %-2u\n\n",

Queued, thanks.

Paolo