Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
* [tglx-devel:irq/core 31/47] kernel/irq/manage.c:2651:3: error: cannot jump from this goto statement to its label
@ 2025-05-07  8:37 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-05-07  8:37 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: llvm, oe-kbuild-all

Hi Thomas,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/core
head:   b8203edb7846253466282425b6009c20a4c85eb8
commit: 936031eb6f97c198231aa2de74c052c5c06b3177 [31/47] genirq/manage: Convert to lock guards
config: um-allnoconfig (https://download.01.org/0day-ci/archive/20250507/202505071620.Cn0x5EZu-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250507/202505071620.Cn0x5EZu-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505071620.Cn0x5EZu-lkp@intel.com/

All errors (new ones prefixed by >>):

>> kernel/irq/manage.c:2651:3: error: cannot jump from this goto statement to its label
    2651 |                 goto err_irq_setup;
         |                 ^
   kernel/irq/manage.c:2653:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    2653 |         guard(raw_spinlock_irqsave)(&desc->lock);
         |         ^
   include/linux/cleanup.h:319:15: note: expanded from macro 'guard'
     319 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:96:1: note: expanded from here
      96 | __UNIQUE_ID_guard270
         | ^
   kernel/irq/manage.c:2647:3: error: cannot jump from this goto statement to its label
    2647 |                 goto err_out;
         |                 ^
   kernel/irq/manage.c:2653:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    2653 |         guard(raw_spinlock_irqsave)(&desc->lock);
         |         ^
   include/linux/cleanup.h:319:15: note: expanded from macro 'guard'
     319 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:96:1: note: expanded from here
      96 | __UNIQUE_ID_guard270
         | ^
   2 errors generated.


vim +2651 kernel/irq/manage.c

1b7047edfcfb257 Marc Zyngier    2015-03-18  2591  
4b078c3f1a26487 Julien Thierry  2019-01-31  2592  /**
4b078c3f1a26487 Julien Thierry  2019-01-31  2593   * request_percpu_nmi - allocate a percpu interrupt line for NMI delivery
4b078c3f1a26487 Julien Thierry  2019-01-31  2594   * @irq:	Interrupt line to allocate
4b078c3f1a26487 Julien Thierry  2019-01-31  2595   * @handler:	Function to be called when the IRQ occurs.
4b078c3f1a26487 Julien Thierry  2019-01-31  2596   * @name:	An ascii name for the claiming device
4b078c3f1a26487 Julien Thierry  2019-01-31  2597   * @dev_id:	A percpu cookie passed back to the handler function
4b078c3f1a26487 Julien Thierry  2019-01-31  2598   *
4b078c3f1a26487 Julien Thierry  2019-01-31  2599   * This call allocates interrupt resources for a per CPU NMI. Per CPU NMIs
a51866946c0aa0b Julien Thierry  2019-02-13  2600   * have to be setup on each CPU by calling prepare_percpu_nmi() before
a51866946c0aa0b Julien Thierry  2019-02-13  2601   * being enabled on the same CPU by using enable_percpu_nmi().
4b078c3f1a26487 Julien Thierry  2019-01-31  2602   *
38caf05690922d5 Thomas Gleixner 2025-03-13  2603   * @dev_id must be globally unique. It is a per-cpu variable, and the
38caf05690922d5 Thomas Gleixner 2025-03-13  2604   * handler gets called with the interrupted CPU's instance of that
38caf05690922d5 Thomas Gleixner 2025-03-13  2605   * variable.
4b078c3f1a26487 Julien Thierry  2019-01-31  2606   *
4b078c3f1a26487 Julien Thierry  2019-01-31  2607   * Interrupt lines requested for NMI delivering should have auto enabling
4b078c3f1a26487 Julien Thierry  2019-01-31  2608   * setting disabled.
4b078c3f1a26487 Julien Thierry  2019-01-31  2609   *
4b078c3f1a26487 Julien Thierry  2019-01-31  2610   * If the interrupt line cannot be used to deliver NMIs, function
4b078c3f1a26487 Julien Thierry  2019-01-31  2611   * will fail returning a negative value.
4b078c3f1a26487 Julien Thierry  2019-01-31  2612   */
4b078c3f1a26487 Julien Thierry  2019-01-31  2613  int request_percpu_nmi(unsigned int irq, irq_handler_t handler,
4b078c3f1a26487 Julien Thierry  2019-01-31  2614  		       const char *name, void __percpu *dev_id)
4b078c3f1a26487 Julien Thierry  2019-01-31  2615  {
4b078c3f1a26487 Julien Thierry  2019-01-31  2616  	struct irqaction *action;
4b078c3f1a26487 Julien Thierry  2019-01-31  2617  	struct irq_desc *desc;
4b078c3f1a26487 Julien Thierry  2019-01-31  2618  	int retval;
4b078c3f1a26487 Julien Thierry  2019-01-31  2619  
4b078c3f1a26487 Julien Thierry  2019-01-31  2620  	if (!handler)
4b078c3f1a26487 Julien Thierry  2019-01-31  2621  		return -EINVAL;
4b078c3f1a26487 Julien Thierry  2019-01-31  2622  
4b078c3f1a26487 Julien Thierry  2019-01-31  2623  	desc = irq_to_desc(irq);
4b078c3f1a26487 Julien Thierry  2019-01-31  2624  
4b078c3f1a26487 Julien Thierry  2019-01-31  2625  	if (!desc || !irq_settings_can_request(desc) ||
4b078c3f1a26487 Julien Thierry  2019-01-31  2626  	    !irq_settings_is_per_cpu_devid(desc) ||
4b078c3f1a26487 Julien Thierry  2019-01-31  2627  	    irq_settings_can_autoenable(desc) ||
4b078c3f1a26487 Julien Thierry  2019-01-31  2628  	    !irq_supports_nmi(desc))
4b078c3f1a26487 Julien Thierry  2019-01-31  2629  		return -EINVAL;
4b078c3f1a26487 Julien Thierry  2019-01-31  2630  
4b078c3f1a26487 Julien Thierry  2019-01-31  2631  	/* The line cannot already be NMI */
6678ae1918ff554 Jinjie Ruan     2024-04-23  2632  	if (irq_is_nmi(desc))
4b078c3f1a26487 Julien Thierry  2019-01-31  2633  		return -EINVAL;
4b078c3f1a26487 Julien Thierry  2019-01-31  2634  
4b078c3f1a26487 Julien Thierry  2019-01-31  2635  	action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
4b078c3f1a26487 Julien Thierry  2019-01-31  2636  	if (!action)
4b078c3f1a26487 Julien Thierry  2019-01-31  2637  		return -ENOMEM;
4b078c3f1a26487 Julien Thierry  2019-01-31  2638  
4b078c3f1a26487 Julien Thierry  2019-01-31  2639  	action->handler = handler;
4b078c3f1a26487 Julien Thierry  2019-01-31  2640  	action->flags = IRQF_PERCPU | IRQF_NO_SUSPEND | IRQF_NO_THREAD
4b078c3f1a26487 Julien Thierry  2019-01-31  2641  		| IRQF_NOBALANCING;
4b078c3f1a26487 Julien Thierry  2019-01-31  2642  	action->name = name;
4b078c3f1a26487 Julien Thierry  2019-01-31  2643  	action->percpu_dev_id = dev_id;
4b078c3f1a26487 Julien Thierry  2019-01-31  2644  
4b078c3f1a26487 Julien Thierry  2019-01-31  2645  	retval = irq_chip_pm_get(&desc->irq_data);
4b078c3f1a26487 Julien Thierry  2019-01-31  2646  	if (retval < 0)
4b078c3f1a26487 Julien Thierry  2019-01-31  2647  		goto err_out;
4b078c3f1a26487 Julien Thierry  2019-01-31  2648  
4b078c3f1a26487 Julien Thierry  2019-01-31  2649  	retval = __setup_irq(irq, desc, action);
4b078c3f1a26487 Julien Thierry  2019-01-31  2650  	if (retval)
4b078c3f1a26487 Julien Thierry  2019-01-31 @2651  		goto err_irq_setup;
4b078c3f1a26487 Julien Thierry  2019-01-31  2652  
936031eb6f97c19 Thomas Gleixner 2025-03-13  2653  	guard(raw_spinlock_irqsave)(&desc->lock);
4b078c3f1a26487 Julien Thierry  2019-01-31  2654  	desc->istate |= IRQS_NMI;
4b078c3f1a26487 Julien Thierry  2019-01-31  2655  	return 0;
4b078c3f1a26487 Julien Thierry  2019-01-31  2656  
4b078c3f1a26487 Julien Thierry  2019-01-31  2657  err_irq_setup:
4b078c3f1a26487 Julien Thierry  2019-01-31  2658  	irq_chip_pm_put(&desc->irq_data);
4b078c3f1a26487 Julien Thierry  2019-01-31  2659  err_out:
4b078c3f1a26487 Julien Thierry  2019-01-31  2660  	kfree(action);
4b078c3f1a26487 Julien Thierry  2019-01-31  2661  
4b078c3f1a26487 Julien Thierry  2019-01-31  2662  	return retval;
4b078c3f1a26487 Julien Thierry  2019-01-31  2663  }
4b078c3f1a26487 Julien Thierry  2019-01-31  2664  

:::::: The code at line 2651 was first introduced by commit
:::::: 4b078c3f1a26487c39363089ba0d5c6b09f2a89f genirq: Provide NMI management for percpu_devid interrupts

:::::: TO: Julien Thierry <julien.thierry@arm.com>
:::::: CC: Marc Zyngier <marc.zyngier@arm.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tglx-devel:irq/core 31/47] kernel/irq/manage.c:2651:3: error: cannot jump from this goto statement to its label
@ 2025-05-07 10:09 kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2025-05-07 10:09 UTC (permalink / raw)
  To: Thomas Gleixner; +Cc: llvm, oe-kbuild-all

Hi Thomas,

FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git irq/core
head:   b8203edb7846253466282425b6009c20a4c85eb8
commit: 7db00b4a32292d301893cacde7226830d9aae6d6 [31/47] genirq/manage: Convert to lock guards
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20250507/202505071809.ajpPxfoZ-lkp@intel.com/config)
compiler: clang version 20.1.2 (https://github.com/llvm/llvm-project 58df0ef89dd64126512e4ee27b4ac3fd8ddf6247)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250507/202505071809.ajpPxfoZ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505071809.ajpPxfoZ-lkp@intel.com/

All errors (new ones prefixed by >>):

>> kernel/irq/manage.c:2651:3: error: cannot jump from this goto statement to its label
    2651 |                 goto err_irq_setup;
         |                 ^
   kernel/irq/manage.c:2653:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    2653 |         guard(raw_spinlock_irqsave)(&desc->lock);
         |         ^
   include/linux/cleanup.h:319:15: note: expanded from macro 'guard'
     319 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:122:1: note: expanded from here
     122 | __UNIQUE_ID_guard575
         | ^
   kernel/irq/manage.c:2647:3: error: cannot jump from this goto statement to its label
    2647 |                 goto err_out;
         |                 ^
   kernel/irq/manage.c:2653:2: note: jump bypasses initialization of variable with __attribute__((cleanup))
    2653 |         guard(raw_spinlock_irqsave)(&desc->lock);
         |         ^
   include/linux/cleanup.h:319:15: note: expanded from macro 'guard'
     319 |         CLASS(_name, __UNIQUE_ID(guard))
         |                      ^
   include/linux/compiler.h:166:29: note: expanded from macro '__UNIQUE_ID'
     166 | #define __UNIQUE_ID(prefix) __PASTE(__PASTE(__UNIQUE_ID_, prefix), __COUNTER__)
         |                             ^
   include/linux/compiler_types.h:84:22: note: expanded from macro '__PASTE'
      84 | #define __PASTE(a,b) ___PASTE(a,b)
         |                      ^
   include/linux/compiler_types.h:83:23: note: expanded from macro '___PASTE'
      83 | #define ___PASTE(a,b) a##b
         |                       ^
   <scratch space>:122:1: note: expanded from here
     122 | __UNIQUE_ID_guard575
         | ^
   2 errors generated.


vim +2651 kernel/irq/manage.c

1b7047edfcfb25 Marc Zyngier    2015-03-18  2591  
4b078c3f1a2648 Julien Thierry  2019-01-31  2592  /**
4b078c3f1a2648 Julien Thierry  2019-01-31  2593   * request_percpu_nmi - allocate a percpu interrupt line for NMI delivery
4b078c3f1a2648 Julien Thierry  2019-01-31  2594   * @irq:	Interrupt line to allocate
4b078c3f1a2648 Julien Thierry  2019-01-31  2595   * @handler:	Function to be called when the IRQ occurs.
4b078c3f1a2648 Julien Thierry  2019-01-31  2596   * @name:	An ascii name for the claiming device
4b078c3f1a2648 Julien Thierry  2019-01-31  2597   * @dev_id:	A percpu cookie passed back to the handler function
4b078c3f1a2648 Julien Thierry  2019-01-31  2598   *
4b078c3f1a2648 Julien Thierry  2019-01-31  2599   * This call allocates interrupt resources for a per CPU NMI. Per CPU NMIs
a51866946c0aa0 Julien Thierry  2019-02-13  2600   * have to be setup on each CPU by calling prepare_percpu_nmi() before
a51866946c0aa0 Julien Thierry  2019-02-13  2601   * being enabled on the same CPU by using enable_percpu_nmi().
4b078c3f1a2648 Julien Thierry  2019-01-31  2602   *
ee62e6fda10079 Thomas Gleixner 2025-03-13  2603   * @dev_id must be globally unique. It is a per-cpu variable, and the
ee62e6fda10079 Thomas Gleixner 2025-03-13  2604   * handler gets called with the interrupted CPU's instance of that
ee62e6fda10079 Thomas Gleixner 2025-03-13  2605   * variable.
4b078c3f1a2648 Julien Thierry  2019-01-31  2606   *
4b078c3f1a2648 Julien Thierry  2019-01-31  2607   * Interrupt lines requested for NMI delivering should have auto enabling
4b078c3f1a2648 Julien Thierry  2019-01-31  2608   * setting disabled.
4b078c3f1a2648 Julien Thierry  2019-01-31  2609   *
4b078c3f1a2648 Julien Thierry  2019-01-31  2610   * If the interrupt line cannot be used to deliver NMIs, function
4b078c3f1a2648 Julien Thierry  2019-01-31  2611   * will fail returning a negative value.
4b078c3f1a2648 Julien Thierry  2019-01-31  2612   */
4b078c3f1a2648 Julien Thierry  2019-01-31  2613  int request_percpu_nmi(unsigned int irq, irq_handler_t handler,
4b078c3f1a2648 Julien Thierry  2019-01-31  2614  		       const char *name, void __percpu *dev_id)
4b078c3f1a2648 Julien Thierry  2019-01-31  2615  {
4b078c3f1a2648 Julien Thierry  2019-01-31  2616  	struct irqaction *action;
4b078c3f1a2648 Julien Thierry  2019-01-31  2617  	struct irq_desc *desc;
4b078c3f1a2648 Julien Thierry  2019-01-31  2618  	int retval;
4b078c3f1a2648 Julien Thierry  2019-01-31  2619  
4b078c3f1a2648 Julien Thierry  2019-01-31  2620  	if (!handler)
4b078c3f1a2648 Julien Thierry  2019-01-31  2621  		return -EINVAL;
4b078c3f1a2648 Julien Thierry  2019-01-31  2622  
4b078c3f1a2648 Julien Thierry  2019-01-31  2623  	desc = irq_to_desc(irq);
4b078c3f1a2648 Julien Thierry  2019-01-31  2624  
4b078c3f1a2648 Julien Thierry  2019-01-31  2625  	if (!desc || !irq_settings_can_request(desc) ||
4b078c3f1a2648 Julien Thierry  2019-01-31  2626  	    !irq_settings_is_per_cpu_devid(desc) ||
4b078c3f1a2648 Julien Thierry  2019-01-31  2627  	    irq_settings_can_autoenable(desc) ||
4b078c3f1a2648 Julien Thierry  2019-01-31  2628  	    !irq_supports_nmi(desc))
4b078c3f1a2648 Julien Thierry  2019-01-31  2629  		return -EINVAL;
4b078c3f1a2648 Julien Thierry  2019-01-31  2630  
4b078c3f1a2648 Julien Thierry  2019-01-31  2631  	/* The line cannot already be NMI */
6678ae1918ff55 Jinjie Ruan     2024-04-23  2632  	if (irq_is_nmi(desc))
4b078c3f1a2648 Julien Thierry  2019-01-31  2633  		return -EINVAL;
4b078c3f1a2648 Julien Thierry  2019-01-31  2634  
4b078c3f1a2648 Julien Thierry  2019-01-31  2635  	action = kzalloc(sizeof(struct irqaction), GFP_KERNEL);
4b078c3f1a2648 Julien Thierry  2019-01-31  2636  	if (!action)
4b078c3f1a2648 Julien Thierry  2019-01-31  2637  		return -ENOMEM;
4b078c3f1a2648 Julien Thierry  2019-01-31  2638  
4b078c3f1a2648 Julien Thierry  2019-01-31  2639  	action->handler = handler;
4b078c3f1a2648 Julien Thierry  2019-01-31  2640  	action->flags = IRQF_PERCPU | IRQF_NO_SUSPEND | IRQF_NO_THREAD
4b078c3f1a2648 Julien Thierry  2019-01-31  2641  		| IRQF_NOBALANCING;
4b078c3f1a2648 Julien Thierry  2019-01-31  2642  	action->name = name;
4b078c3f1a2648 Julien Thierry  2019-01-31  2643  	action->percpu_dev_id = dev_id;
4b078c3f1a2648 Julien Thierry  2019-01-31  2644  
4b078c3f1a2648 Julien Thierry  2019-01-31  2645  	retval = irq_chip_pm_get(&desc->irq_data);
4b078c3f1a2648 Julien Thierry  2019-01-31  2646  	if (retval < 0)
4b078c3f1a2648 Julien Thierry  2019-01-31  2647  		goto err_out;
4b078c3f1a2648 Julien Thierry  2019-01-31  2648  
4b078c3f1a2648 Julien Thierry  2019-01-31  2649  	retval = __setup_irq(irq, desc, action);
4b078c3f1a2648 Julien Thierry  2019-01-31  2650  	if (retval)
4b078c3f1a2648 Julien Thierry  2019-01-31 @2651  		goto err_irq_setup;
4b078c3f1a2648 Julien Thierry  2019-01-31  2652  
7db00b4a32292d Thomas Gleixner 2025-03-13  2653  	guard(raw_spinlock_irqsave)(&desc->lock);
4b078c3f1a2648 Julien Thierry  2019-01-31  2654  	desc->istate |= IRQS_NMI;
4b078c3f1a2648 Julien Thierry  2019-01-31  2655  	return 0;
4b078c3f1a2648 Julien Thierry  2019-01-31  2656  
4b078c3f1a2648 Julien Thierry  2019-01-31  2657  err_irq_setup:
4b078c3f1a2648 Julien Thierry  2019-01-31  2658  	irq_chip_pm_put(&desc->irq_data);
4b078c3f1a2648 Julien Thierry  2019-01-31  2659  err_out:
4b078c3f1a2648 Julien Thierry  2019-01-31  2660  	kfree(action);
4b078c3f1a2648 Julien Thierry  2019-01-31  2661  
4b078c3f1a2648 Julien Thierry  2019-01-31  2662  	return retval;
4b078c3f1a2648 Julien Thierry  2019-01-31  2663  }
4b078c3f1a2648 Julien Thierry  2019-01-31  2664  

:::::: The code at line 2651 was first introduced by commit
:::::: 4b078c3f1a26487c39363089ba0d5c6b09f2a89f genirq: Provide NMI management for percpu_devid interrupts

:::::: TO: Julien Thierry <julien.thierry@arm.com>
:::::: CC: Marc Zyngier <marc.zyngier@arm.com>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-05-07 10:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-07  8:37 [tglx-devel:irq/core 31/47] kernel/irq/manage.c:2651:3: error: cannot jump from this goto statement to its label kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2025-05-07 10:09 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox