Commit a07771ac authored by Thomas Gleixner's avatar Thomas Gleixner

x86/apic/vector: Print APIC control bits in debugfs

Extend the debugability of the vector management by adding the state bits
to the debugfs output.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarSong Liu <songliubraving@fb.com>
Cc: Joerg Roedel <jroedel@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Song Liu <liu.song.a23@gmail.com>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: Mike Travis <mike.travis@hpe.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Tariq Toukan <tariqt@mellanox.com>
Link: https://lkml.kernel.org/r/20180604162224.908136099@linutronix.de
parent 12f47073
...@@ -588,8 +588,7 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq, ...@@ -588,8 +588,7 @@ static int x86_vector_alloc_irqs(struct irq_domain *domain, unsigned int virq,
static void x86_vector_debug_show(struct seq_file *m, struct irq_domain *d, static void x86_vector_debug_show(struct seq_file *m, struct irq_domain *d,
struct irq_data *irqd, int ind) struct irq_data *irqd, int ind)
{ {
unsigned int cpu, vector, prev_cpu, prev_vector; struct apic_chip_data apicd;
struct apic_chip_data *apicd;
unsigned long flags; unsigned long flags;
int irq; int irq;
...@@ -605,24 +604,26 @@ static void x86_vector_debug_show(struct seq_file *m, struct irq_domain *d, ...@@ -605,24 +604,26 @@ static void x86_vector_debug_show(struct seq_file *m, struct irq_domain *d,
return; return;
} }
apicd = irqd->chip_data; if (!irqd->chip_data) {
if (!apicd) {
seq_printf(m, "%*sVector: Not assigned\n", ind, ""); seq_printf(m, "%*sVector: Not assigned\n", ind, "");
return; return;
} }
raw_spin_lock_irqsave(&vector_lock, flags); raw_spin_lock_irqsave(&vector_lock, flags);
cpu = apicd->cpu; memcpy(&apicd, irqd->chip_data, sizeof(apicd));
vector = apicd->vector;
prev_cpu = apicd->prev_cpu;
prev_vector = apicd->prev_vector;
raw_spin_unlock_irqrestore(&vector_lock, flags); raw_spin_unlock_irqrestore(&vector_lock, flags);
seq_printf(m, "%*sVector: %5u\n", ind, "", vector);
seq_printf(m, "%*sTarget: %5u\n", ind, "", cpu); seq_printf(m, "%*sVector: %5u\n", ind, "", apicd.vector);
if (prev_vector) { seq_printf(m, "%*sTarget: %5u\n", ind, "", apicd.cpu);
seq_printf(m, "%*sPrevious vector: %5u\n", ind, "", prev_vector); if (apicd.prev_vector) {
seq_printf(m, "%*sPrevious target: %5u\n", ind, "", prev_cpu); seq_printf(m, "%*sPrevious vector: %5u\n", ind, "", apicd.prev_vector);
seq_printf(m, "%*sPrevious target: %5u\n", ind, "", apicd.prev_cpu);
} }
seq_printf(m, "%*smove_in_progress: %u\n", ind, "", apicd.move_in_progress ? 1 : 0);
seq_printf(m, "%*sis_managed: %u\n", ind, "", apicd.is_managed ? 1 : 0);
seq_printf(m, "%*scan_reserve: %u\n", ind, "", apicd.can_reserve ? 1 : 0);
seq_printf(m, "%*shas_reserved: %u\n", ind, "", apicd.has_reserved ? 1 : 0);
seq_printf(m, "%*scleanup_pending: %u\n", ind, "", !hlist_unhashed(&apicd.clist));
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment