aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2018-06-04 11:34:00 -0400
committerThomas Gleixner <tglx@linutronix.de>2018-06-06 09:18:22 -0400
commita07771ac6a78860777a9da5d9bc38830ec993fe7 (patch)
tree84453d27cbedc861c81c2925b389b2e908ba2609
parent12f47073a40f6aa75119d8f5df4077b7f334cced (diff)
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: Thomas Gleixner <tglx@linutronix.de> Tested-by: Song 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
-rw-r--r--arch/x86/kernel/apic/vector.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index b708f597eee3..35aaee4fc028 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -588,8 +588,7 @@ error:
588static void x86_vector_debug_show(struct seq_file *m, struct irq_domain *d, 588static void x86_vector_debug_show(struct seq_file *m, struct irq_domain *d,
589 struct irq_data *irqd, int ind) 589 struct irq_data *irqd, int ind)
590{ 590{
591 unsigned int cpu, vector, prev_cpu, prev_vector; 591 struct apic_chip_data apicd;
592 struct apic_chip_data *apicd;
593 unsigned long flags; 592 unsigned long flags;
594 int irq; 593 int irq;
595 594
@@ -605,24 +604,26 @@ static void x86_vector_debug_show(struct seq_file *m, struct irq_domain *d,
605 return; 604 return;
606 } 605 }
607 606
608 apicd = irqd->chip_data; 607 if (!irqd->chip_data) {
609 if (!apicd) {
610 seq_printf(m, "%*sVector: Not assigned\n", ind, ""); 608 seq_printf(m, "%*sVector: Not assigned\n", ind, "");
611 return; 609 return;
612 } 610 }
613 611
614 raw_spin_lock_irqsave(&vector_lock, flags); 612 raw_spin_lock_irqsave(&vector_lock, flags);
615 cpu = apicd->cpu; 613 memcpy(&apicd, irqd->chip_data, sizeof(apicd));
616 vector = apicd->vector;
617 prev_cpu = apicd->prev_cpu;
618 prev_vector = apicd->prev_vector;
619 raw_spin_unlock_irqrestore(&vector_lock, flags); 614 raw_spin_unlock_irqrestore(&vector_lock, flags);
620 seq_printf(m, "%*sVector: %5u\n", ind, "", vector); 615
621 seq_printf(m, "%*sTarget: %5u\n", ind, "", cpu); 616 seq_printf(m, "%*sVector: %5u\n", ind, "", apicd.vector);
622 if (prev_vector) { 617 seq_printf(m, "%*sTarget: %5u\n", ind, "", apicd.cpu);
623 seq_printf(m, "%*sPrevious vector: %5u\n", ind, "", prev_vector); 618 if (apicd.prev_vector) {
624 seq_printf(m, "%*sPrevious target: %5u\n", ind, "", prev_cpu); 619 seq_printf(m, "%*sPrevious vector: %5u\n", ind, "", apicd.prev_vector);
620 seq_printf(m, "%*sPrevious target: %5u\n", ind, "", apicd.prev_cpu);
625 } 621 }
622 seq_printf(m, "%*smove_in_progress: %u\n", ind, "", apicd.move_in_progress ? 1 : 0);
623 seq_printf(m, "%*sis_managed: %u\n", ind, "", apicd.is_managed ? 1 : 0);
624 seq_printf(m, "%*scan_reserve: %u\n", ind, "", apicd.can_reserve ? 1 : 0);
625 seq_printf(m, "%*shas_reserved: %u\n", ind, "", apicd.has_reserved ? 1 : 0);
626 seq_printf(m, "%*scleanup_pending: %u\n", ind, "", !hlist_unhashed(&apicd.clist));
626} 627}
627#endif 628#endif
628 629