Skip to content

Commit 504dba5

Browse files
kelleymhhansendc
authored andcommitted
x86/irq: Add hardcoded hypervisor interrupts to /proc/stat
Some hypervisor interrupts (such as for Hyper-V VMbus and Hyper-V timers) have hardcoded interrupt vectors on x86 and don't have Linux IRQs assigned. These interrupts are shown in /proc/interrupts, but are not reported in the first field of the "intr" line in /proc/stat because the x86 version of arch_irq_stat_cpu() doesn't include them. Fix this by adding code to arch_irq_stat_cpu() to include these interrupts, similar to existing interrupts that don't have Linux IRQs. Use #if IS_ENABLED() because unlike all the other nearby #ifdefs, CONFIG_HYPERV can be built as a module. Signed-off-by: Michael Kelley <[email protected]> Signed-off-by: Dave Hansen <[email protected]> Link: https://lore.kernel.org/all/1677523568-50263-1-git-send-email-mikelley%40microsoft.com
1 parent 9561de3 commit 504dba5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/x86/kernel/irq.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ u64 arch_irq_stat_cpu(unsigned int cpu)
211211
#ifdef CONFIG_X86_MCE_THRESHOLD
212212
sum += irq_stats(cpu)->irq_threshold_count;
213213
#endif
214+
#ifdef CONFIG_X86_HV_CALLBACK_VECTOR
215+
sum += irq_stats(cpu)->irq_hv_callback_count;
216+
#endif
217+
#if IS_ENABLED(CONFIG_HYPERV)
218+
sum += irq_stats(cpu)->irq_hv_reenlightenment_count;
219+
sum += irq_stats(cpu)->hyperv_stimer0_count;
220+
#endif
214221
#ifdef CONFIG_X86_MCE
215222
sum += per_cpu(mce_exception_count, cpu);
216223
sum += per_cpu(mce_poll_count, cpu);

0 commit comments

Comments
 (0)