From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Xu <peterx@redhat.com>
Subject: [Qemu-devel] [PULL 22/32] x86: ioapic: add traces for ioapic
Date: Mon, 16 Jan 2017 17:59:06 +0100 [thread overview]
Message-ID: <20170116165916.8575-23-pbonzini@redhat.com> (raw)
In-Reply-To: <20170116165916.8575-1-pbonzini@redhat.com>
From: Peter Xu <peterx@redhat.com>
>From time to time, there are issues with ioapic, either on guest side or
on hypervisor side. Good to have some persistent traces for better
triaging and debugging.
Signed-off-by: Peter Xu <peterx@redhat.com>
Message-Id: <1483952153-7221-2-git-send-email-peterx@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/intc/ioapic.c | 17 +++++++++++++++--
hw/intc/trace-events | 7 +++++++
2 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index ea7ea0b..d1254f8 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -33,6 +33,7 @@
#include "target/i386/cpu.h"
#include "hw/i386/apic-msidef.h"
#include "hw/i386/x86-iommu.h"
+#include "trace.h"
//#define DEBUG_IOAPIC
@@ -115,6 +116,7 @@ static void ioapic_service(IOAPICCommonState *s)
s->irr &= ~mask;
} else {
coalesce = s->ioredtbl[i] & IOAPIC_LVT_REMOTE_IRR;
+ trace_ioapic_set_remote_irr(i);
s->ioredtbl[i] |= IOAPIC_LVT_REMOTE_IRR;
}
@@ -220,6 +222,8 @@ void ioapic_eoi_broadcast(int vector)
uint64_t entry;
int i, n;
+ trace_ioapic_eoi_broadcast(vector);
+
for (i = 0; i < MAX_IOAPICS; i++) {
s = ioapics[i];
if (!s) {
@@ -229,6 +233,7 @@ void ioapic_eoi_broadcast(int vector)
entry = s->ioredtbl[n];
if ((entry & IOAPIC_LVT_REMOTE_IRR)
&& (entry & IOAPIC_VECTOR_MASK) == vector) {
+ trace_ioapic_clear_remote_irr(n, vector);
s->ioredtbl[n] = entry & ~IOAPIC_LVT_REMOTE_IRR;
if (!(entry & IOAPIC_LVT_MASKED) && (s->irr & (1 << n))) {
ioapic_service(s);
@@ -256,7 +261,9 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
int index;
uint32_t val = 0;
- switch (addr & 0xff) {
+ addr &= 0xff;
+
+ switch (addr) {
case IOAPIC_IOREGSEL:
val = s->ioregsel;
break;
@@ -286,6 +293,9 @@ ioapic_mem_read(void *opaque, hwaddr addr, unsigned int size)
DPRINTF("read: %08x = %08x\n", s->ioregsel, val);
break;
}
+
+ trace_ioapic_mem_read(addr, size, val);
+
return val;
}
@@ -324,7 +334,10 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
IOAPICCommonState *s = opaque;
int index;
- switch (addr & 0xff) {
+ addr &= 0xff;
+ trace_ioapic_mem_write(addr, size, val);
+
+ switch (addr) {
case IOAPIC_IOREGSEL:
s->ioregsel = val;
break;
diff --git a/hw/intc/trace-events b/hw/intc/trace-events
index 340f617..180b893 100644
--- a/hw/intc/trace-events
+++ b/hw/intc/trace-events
@@ -14,6 +14,13 @@ apic_deliver_irq(uint8_t dest, uint8_t dest_mode, uint8_t delivery_mode, uint8_t
apic_mem_readl(uint64_t addr, uint32_t val) "%"PRIx64" = %08x"
apic_mem_writel(uint64_t addr, uint32_t val) "%"PRIx64" = %08x"
+# hw/intc/ioapic.c
+ioapic_set_remote_irr(int n) "set remote irr for pin %d"
+ioapic_clear_remote_irr(int n, int vector) "clear remote irr for pin %d vector %d"
+ioapic_eoi_broadcast(int vector) "EOI broadcast for vector %d"
+ioapic_mem_read(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem read addr 0x%"PRIx8" size 0x%"PRIx8" retval 0x%"PRIx32
+ioapic_mem_write(uint8_t addr, uint8_t size, uint32_t val) "ioapic mem write addr 0x%"PRIx8" size 0x%"PRIx8" val 0x%"PRIx32
+
# hw/intc/slavio_intctl.c
slavio_intctl_mem_readl(uint32_t cpu, uint64_t addr, uint32_t ret) "read cpu %d reg 0x%"PRIx64" = %x"
slavio_intctl_mem_writel(uint32_t cpu, uint64_t addr, uint32_t val) "write cpu %d reg 0x%"PRIx64" = %x"
--
2.9.3
next prev parent reply other threads:[~2017-01-16 16:59 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-16 16:58 [Qemu-devel] [PULL v2 00/32] Misc patches for 2017-01-11 Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 01/32] bugfix: vm halt when in reset looping Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 02/32] megasas: fix guest-triggered memory leak Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 03/32] qom: Make all interface types abstract Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 04/32] smbios: filter based on CONFIG_SMBIOS rather than TARGET Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 05/32] stubs: merge all monitor stubs in one file, remove monitor_cur_is_qmp stub Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 06/32] stubs: move smbios stubs to hw/smbios Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 07/32] stubs: move acpi stubs to hw/acpi Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 08/32] stubs: remove unused stub for serial_hd Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 09/32] hw: move reset handlers from vl.c to hw/core Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 10/32] stubs: group stubs for user-mode emulation Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 11/32] stubs: group all monitor_fdset_* functions in a single file Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 12/32] stubs: move vhost stubs to stubs/vhost.o Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 13/32] event_notifier: cleanups around event_notifier_set_handler Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 14/32] build: remove --enable-colo/--disable-colo Paolo Bonzini
2017-01-16 16:58 ` [Qemu-devel] [PULL 15/32] stubs: remove stubs/kvm.c Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 16/32] acpi: filter based on CONFIG_ACPI_X86 rather than TARGET Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 17/32] pc: fix crash in rtc_set_memory() if initial cpu is marked as hotplugged Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 18/32] scsi-block: fix direction of BYTCHK test for VERIFY commands Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 19/32] serial: fix memory leak in serial exit Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 20/32] qemu-thread: fix qemu_thread_set_name() race in qemu_thread_create() Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 21/32] hxtool: emit Texinfo headings as @subsection Paolo Bonzini
2017-01-16 16:59 ` Paolo Bonzini [this message]
2017-01-16 16:59 ` [Qemu-devel] [PULL 23/32] x86: ioapic: dump version for "info ioapic" Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 24/32] x86: ioapic: fix fail migration when irqchip=split Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 25/32] exec: Add missing rcu_read_unlock Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 26/32] char: fix ctrl-a b not working Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 27/32] ramblock-notifier: new Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 28/32] kvm: move cpu synchronization code Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 29/32] target/i386: Add Intel HAX files Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 30/32] Plumb the HAXM-based hardware acceleration support Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 31/32] hax: add Darwin support Paolo Bonzini
2017-01-16 16:59 ` [Qemu-devel] [PULL 32/32] Revert "win32: don't run subprocess tests on Mingw32 platform" Paolo Bonzini
2017-01-16 17:49 ` [Qemu-devel] [PULL v2 00/32] Misc patches for 2017-01-11 no-reply
2017-01-19 13:35 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170116165916.8575-23-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).