Skip to content
  • Philippe Gerum via Xenomai's avatar
    cobalt/intr: fix interrupt stat iterator · a73102d5
    Philippe Gerum via Xenomai authored and Jan Kiszka's avatar Jan Kiszka committed
    
    
    The implementation does not iterate fully over all CPU slots for every
    handler, leaving some of them uncollected. In addition, if maxcpus= is
    used to restrict the number of available CPUs to a subset of the
    present ones, with the highest numbered CPU marked offline, the
    iterator rescans the first valid IRQ slot indefinitely, eventually
    leading to memory corruption due to out-of-bound writes.
    
    Rewrite the iterator in order to implement the following loop as
    expected:
    
    for_each_irq(irq)
        for_each_handler_of_irq(handler, irq)
        	for_each_online_cpu(cpu)
    	    collect_stats(irq, handler, cpu);
    
    Signed-off-by: default avatarJan Kiszka <jan.kiszka@siemens.com>
    a73102d5