aboutsummaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorTejaswini Poluri <tejaswinipoluri3@gmail.com>2017-03-28 12:49:43 +0530
committerPaolo Bonzini <pbonzini@redhat.com>2017-04-02 21:17:47 +0200
commitc7f15bc93661a36fec9fd0107654cf44d06c5992 (patch)
treeb104698df3196f376ea58101a81acca328a49d19 /target
parentb9afaba891458d3e1f3f853a8cb6880498ed34e3 (diff)
target-i386: fix "info lapic" segfault on isapc
Start QEMU with "qemu-system-x86_64 -nographic -M isapc -serial none-monitor stdio" and enter "info lapic" at the monitor prompt ⇒ Segmentation fault Signed-off-by: Tejaswini Poluri <tejaswinipoluri3@gmail.com> Message-Id: <1490685583-16987-1-git-send-email-tejaswinipoluri3@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'target')
-rw-r--r--target/i386/helper.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/i386/helper.c b/target/i386/helper.c
index e2af3404f2..f11cac63a1 100644
--- a/target/i386/helper.c
+++ b/target/i386/helper.c
@@ -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",