Public bug reported:

[ Impact ]

Focal fails to build from source when CONFIG_PROVE_LOCKING = y:

/build/focal/kernel/time/timer.c: In function '__timer_delete_sync':
/build/focal/include/linux/lockdep.h:663:24: error: 'hardirqs_enabled' 
undeclared (first use in this function); did you mean 'trace_hardirqs_enabled'?
  663 |         !this_cpu_read(hardirqs_enabled)));  \
      |                        ^~~~~~~~~~~~~~~~
/build/focal/include/asm-generic/bug.h:96:25: note: in definition of macro 
'WARN_ON_ONCE'
   96 |  int __ret_warn_on = !!(condition);   \
      |                         ^~~~~~~~~
/build/focal/include/linux/percpu-defs.h:507:29: note: in expansion of macro 
'__pcpu_size_call_return'
  507 | #define this_cpu_read(pcp)  __pcpu_size_call_return(this_cpu_read_, pcp)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
/build/focal/include/linux/lockdep.h:663:10: note: in expansion of macro 
'this_cpu_read'
  663 |         !this_cpu_read(hardirqs_enabled)));  \
      |          ^~~~~~~~~~~~~
/build/focal/kernel/time/timer.c:1521:3: note: in expansion of macro 
'lockdep_assert_preemption_enabled'
 1521 |   lockdep_assert_preemption_enabled();
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/build/focal/include/linux/lockdep.h:663:24: note: each undeclared identifier 
is reported only once for each function it appears in
  663 |         !this_cpu_read(hardirqs_enabled)));  \
      |                        ^~~~~~~~~~~~~~~~
/build/focal/include/asm-generic/bug.h:96:25: note: in definition of macro 
'WARN_ON_ONCE'
   96 |  int __ret_warn_on = !!(condition);   \
      |                         ^~~~~~~~~
/build/focal/include/linux/percpu-defs.h:507:29: note: in expansion of macro 
'__pcpu_size_call_return'
  507 | #define this_cpu_read(pcp)  __pcpu_size_call_return(this_cpu_read_, pcp)
      |                             ^~~~~~~~~~~~~~~~~~~~~~~
/build/focal/include/linux/lockdep.h:663:10: note: in expansion of macro 
'this_cpu_read'
  663 |         !this_cpu_read(hardirqs_enabled)));  \
      |          ^~~~~~~~~~~~~
/build/focal/kernel/time/timer.c:1521:3: note: in expansion of macro 
'lockdep_assert_preemption_enabled'
 1521 |   lockdep_assert_preemption_enabled();
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC      kernel/sched/cputime.o
  CC      kernel/trace/ftrace.o
make[4]: *** [/build/focal/scripts/Makefile.build:270: kernel/time/timer.o] 
Error 1

This is because hardirqs_enabled is not a per-cpu variable in Focal.

[ Fix ]

Use hardirqs_enabled field in task_struct instead of the per-cpu
varible.

[ Test Plan ]

Compile and boot test the kernel

[ Regression Potential ]

The kernel as it is does not compile with CONFIG_PROVE_LOCKING = y.
The patch touches code only included if CONFIG_PROVE_LOCKING = y, therefore
the risk of regression does not exist.

** Affects: linux (Ubuntu)
     Importance: Undecided
     Assignee: Massimiliano Pellizzer (mpellizzer)
         Status: Invalid

** Affects: linux (Ubuntu Focal)
     Importance: Undecided
     Assignee: Massimiliano Pellizzer (mpellizzer)
         Status: In Progress

** Also affects: linux (Ubuntu Focal)
   Importance: Undecided
       Status: New

** Changed in: linux (Ubuntu)
       Status: In Progress => Invalid

** Changed in: linux (Ubuntu Focal)
       Status: New => In Progress

** Changed in: linux (Ubuntu Focal)
     Assignee: (unassigned) => Massimiliano Pellizzer (mpellizzer)

** Summary changed:

- Focal FTBFS when CONFIG_PROVE_LOCKING = y
+ Focal generic kernel FTBFS when CONFIG_PROVE_LOCKING = y

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2130776

Title:
  Focal generic kernel FTBFS when CONFIG_PROVE_LOCKING = y

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2130776/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to