<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux.git/lib/kunit, branch v7.2-rc1</title>
<subtitle>Linux kernel source tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/'/>
<entry>
<title>Merge tag 'linux_kselftest-kunit-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest</title>
<updated>2026-06-16T11:03:57+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-06-16T11:03:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=42eb3a5ef6bc56192bf450c79a3f274e081f8131'/>
<id>42eb3a5ef6bc56192bf450c79a3f274e081f8131</id>
<content type='text'>
Pull kunit updates from Shuah Khan:
 "Fixes to tool and kunit core and new features to both to support JUnit
  XML (primitive) and backtrace suppression API:
   - Core support for suppressing warning backtraces
   - Parse and print the reason tests are skipped
   - Add (primitive) support for outputting JUnit XML
   - Don't write to stdout when it should be disabled
   - Add backtrace suppression self-tests
   - Suppress intentional warning backtraces in scaling unit tests
   - Add documentation for warning backtrace suppression API
   - Fix spelling mistakes in comments and messages
   - gen_compile_commands: Ignore libgcc.a
   - qemu_configs: Add or1k / openrisc configuration"

* tag 'linux_kselftest-kunit-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  kunit:tool: Don't write to stdout when it should be disabled
  kunit: tool: Add (primitive) support for outputting JUnit XML
  kunit: tool: Parse and print the reason tests are skipped
  kunit: Add documentation for warning backtrace suppression API
  drm: Suppress intentional warning backtraces in scaling unit tests
  kunit: Add backtrace suppression self-tests
  bug/kunit: Core support for suppressing warning backtraces
  kunit: Fix spelling mistakes in comments and messages
  kunit: qemu_configs: Add or1k / openrisc configuration
  gen_compile_commands: Ignore libgcc.a
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull kunit updates from Shuah Khan:
 "Fixes to tool and kunit core and new features to both to support JUnit
  XML (primitive) and backtrace suppression API:
   - Core support for suppressing warning backtraces
   - Parse and print the reason tests are skipped
   - Add (primitive) support for outputting JUnit XML
   - Don't write to stdout when it should be disabled
   - Add backtrace suppression self-tests
   - Suppress intentional warning backtraces in scaling unit tests
   - Add documentation for warning backtrace suppression API
   - Fix spelling mistakes in comments and messages
   - gen_compile_commands: Ignore libgcc.a
   - qemu_configs: Add or1k / openrisc configuration"

* tag 'linux_kselftest-kunit-7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  kunit:tool: Don't write to stdout when it should be disabled
  kunit: tool: Add (primitive) support for outputting JUnit XML
  kunit: tool: Parse and print the reason tests are skipped
  kunit: Add documentation for warning backtrace suppression API
  drm: Suppress intentional warning backtraces in scaling unit tests
  kunit: Add backtrace suppression self-tests
  bug/kunit: Core support for suppressing warning backtraces
  kunit: Fix spelling mistakes in comments and messages
  kunit: qemu_configs: Add or1k / openrisc configuration
  gen_compile_commands: Ignore libgcc.a
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'gpio-updates-for-v7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux</title>
<updated>2026-06-16T02:00:52+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-06-16T02:00:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=77d084d66b7694e2a912abdd8b9e5a0e7a32d28e'/>
<id>77d084d66b7694e2a912abdd8b9e5a0e7a32d28e</id>
<content type='text'>
Pull gpio updates from Bartosz Golaszewski:
 "There's one new driver, one legacy driver removed, a kunit test-suite
  for the GPIO core, support for new models in existing drivers and a
  slew of various changes in many places though I can't think of
  anything controversial that would stand out - it's been a relatively
  calm cycle.

  GPIO core:
   - Add an initial set of kunit test cases for the GPIO subsystem
   - Use the devres owner as the GPIO chip's parent in absence of any
     other parent
   - Fix const-correctness of GPIO chip SRCU guards
   - Provide new GPIO consumer interfaces: gpiod_is_single_ended() and
     fwnode_gpiod_get()
   - Quarantine all legacy GPIO APIs in linux/gpio/legacy.h
   - Use __ro_after_init where applicable

  New drivers:
   - Add driver for the GPIO controller on Waveshare DSI TOUCH panels

  Removed drivers:
   - Remove the obsolete ts5500 GPIO driver

  Driver updates:
   - Modernize gpio-timberdale: remove platform data support and use
     generic device property accessors
   - Extend test build coverage by enabling COMPILE_TEST for more GPIO
     drivers
   - Add some missing dependencies in Kconfig
   - Add support for sparse fixed direction to gpio-regmap
   - Remove dead code from gpio-nomadik
   - use BIT() in gpio-mxc
   - use bitmap_complement() in gpio-xilinx and gpio-pca953x
   - Use more appropriate printing functions where applicable
   - Use named initializers for platform_device_id and i2c_device_id
     arrays
   - Convert gpio-altera to using the generic GPIO chip helper library
   - Add support for new models to gpio-dwapb, gpio-zynq, gpio-usbio and
     gpio-tegra186
   - Unify the naming convention for Qualcomm in GPIO drivers
   - Fix interrupt bank mapping to GPIO chips in gpio-mt7621
   - Add support for the lines-initial-states property to gpio-74x164
   - Switch to using dynamic GPIO base in gpio-ixp4xx
   - Move the handling of an OF quirk from ASoC to gpiolib-of.c where
     other such quirks live
   - Use handle_bad_irq() in gpio-ep93xx
   - Some other minor tweaks and refactorings

  Devicetree bindings:
   - Document the Waveshare GPIO controller for DSI TOUCH panels
   - Document new models: Tegra238 in gpio-tegra186 and EIO GPIO in
     gpio-zynq
   - Add new properties for gpio-dwapb and fairchild,74hc595
   - Fix whitespace issues
   - Sort compatibles alphabetically in gpio-zynq

  Documentation:
   - Fix kerneldoc warnings in gpio-realtek-otto

  Misc:
   - Attach software nodes representing GPIO chips to the actual struct
     device objects associated with them in some legacy platforms
     enabling real firmware node lookup instead of string matching
   - Drop unneeded dependencies on OF_GPIO from bus and staging drivers"

* tag 'gpio-updates-for-v7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (62 commits)
  gpio: nomadik: remove dead DB8540 code from &lt;gpio/gpio-nomadik.h&gt;
  gpio: mt7621: fix interrupt banks mapping on gpio chips
  bus: ts-nbus: drop unneeded dependency on OF_GPIO
  staging: media: max96712: drop unneeded dependency on OF_GPIO
  gpiolib: Replace strcpy() with memcpy()
  gpio: remove obsolete UAF FIXMEs from lookup paths
  gpio: core: fix const-correctness of gpio_chip_guard
  gpio: mxc: use BIT() macro
  gpio: realtek-otto: fix kernel-doc warnings
  gpio: max77620: Unify usage of space and comma in platform_device_id array
  gpio: Use named initializers for platform_device_id arrays
  gpio: cros-ec: Drop unused assignment of platform_device_id driver data
  ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
  ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx
  ARM: omap1: drop unused variable from omap16xx_gpio_init()
  gpio: gpiolib: use seq_puts() for plain strings
  gpio: ts5500: remove obsolete driver
  gpio: add kunit test cases for the GPIO subsystem
  kunit: provide kunit_platform_device_unregister()
  kunit: provide kunit_platform_device_register_full()
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull gpio updates from Bartosz Golaszewski:
 "There's one new driver, one legacy driver removed, a kunit test-suite
  for the GPIO core, support for new models in existing drivers and a
  slew of various changes in many places though I can't think of
  anything controversial that would stand out - it's been a relatively
  calm cycle.

  GPIO core:
   - Add an initial set of kunit test cases for the GPIO subsystem
   - Use the devres owner as the GPIO chip's parent in absence of any
     other parent
   - Fix const-correctness of GPIO chip SRCU guards
   - Provide new GPIO consumer interfaces: gpiod_is_single_ended() and
     fwnode_gpiod_get()
   - Quarantine all legacy GPIO APIs in linux/gpio/legacy.h
   - Use __ro_after_init where applicable

  New drivers:
   - Add driver for the GPIO controller on Waveshare DSI TOUCH panels

  Removed drivers:
   - Remove the obsolete ts5500 GPIO driver

  Driver updates:
   - Modernize gpio-timberdale: remove platform data support and use
     generic device property accessors
   - Extend test build coverage by enabling COMPILE_TEST for more GPIO
     drivers
   - Add some missing dependencies in Kconfig
   - Add support for sparse fixed direction to gpio-regmap
   - Remove dead code from gpio-nomadik
   - use BIT() in gpio-mxc
   - use bitmap_complement() in gpio-xilinx and gpio-pca953x
   - Use more appropriate printing functions where applicable
   - Use named initializers for platform_device_id and i2c_device_id
     arrays
   - Convert gpio-altera to using the generic GPIO chip helper library
   - Add support for new models to gpio-dwapb, gpio-zynq, gpio-usbio and
     gpio-tegra186
   - Unify the naming convention for Qualcomm in GPIO drivers
   - Fix interrupt bank mapping to GPIO chips in gpio-mt7621
   - Add support for the lines-initial-states property to gpio-74x164
   - Switch to using dynamic GPIO base in gpio-ixp4xx
   - Move the handling of an OF quirk from ASoC to gpiolib-of.c where
     other such quirks live
   - Use handle_bad_irq() in gpio-ep93xx
   - Some other minor tweaks and refactorings

  Devicetree bindings:
   - Document the Waveshare GPIO controller for DSI TOUCH panels
   - Document new models: Tegra238 in gpio-tegra186 and EIO GPIO in
     gpio-zynq
   - Add new properties for gpio-dwapb and fairchild,74hc595
   - Fix whitespace issues
   - Sort compatibles alphabetically in gpio-zynq

  Documentation:
   - Fix kerneldoc warnings in gpio-realtek-otto

  Misc:
   - Attach software nodes representing GPIO chips to the actual struct
     device objects associated with them in some legacy platforms
     enabling real firmware node lookup instead of string matching
   - Drop unneeded dependencies on OF_GPIO from bus and staging drivers"

* tag 'gpio-updates-for-v7.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (62 commits)
  gpio: nomadik: remove dead DB8540 code from &lt;gpio/gpio-nomadik.h&gt;
  gpio: mt7621: fix interrupt banks mapping on gpio chips
  bus: ts-nbus: drop unneeded dependency on OF_GPIO
  staging: media: max96712: drop unneeded dependency on OF_GPIO
  gpiolib: Replace strcpy() with memcpy()
  gpio: remove obsolete UAF FIXMEs from lookup paths
  gpio: core: fix const-correctness of gpio_chip_guard
  gpio: mxc: use BIT() macro
  gpio: realtek-otto: fix kernel-doc warnings
  gpio: max77620: Unify usage of space and comma in platform_device_id array
  gpio: Use named initializers for platform_device_id arrays
  gpio: cros-ec: Drop unused assignment of platform_device_id driver data
  ARM: omap1: enable real software node lookup of GPIOs on Nokia 770
  ARM: omap1: use platform_device_register_full() for GPIO devices on OMAP 16xx
  ARM: omap1: drop unused variable from omap16xx_gpio_init()
  gpio: gpiolib: use seq_puts() for plain strings
  gpio: ts5500: remove obsolete driver
  gpio: add kunit test cases for the GPIO subsystem
  kunit: provide kunit_platform_device_unregister()
  kunit: provide kunit_platform_device_register_full()
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>kunit: provide kunit_platform_device_unregister()</title>
<updated>2026-05-26T09:19:54+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@oss.qualcomm.com</email>
</author>
<published>2026-05-22T13:42:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=136569e6bc7b2d62e6777ef47caf0a417d70bf4a'/>
<id>136569e6bc7b2d62e6777ef47caf0a417d70bf4a</id>
<content type='text'>
Tests may want to unregister a platform device as part of the test case
logic. Using the regular platform_device_register() with kunit
assertions may result in a platform device leak or otherwise requires
cumbersome error handling. Provide a function that unregisters a
kunit-managed platform device and drops the release action from the
test's list.

Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Reviewed-by: Linus Walleij &lt;linusw@kernel.org&gt;
Link: https://patch.msgid.link/20260522-gpiolib-kunit-v3-2-b15fe6987430@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@oss.qualcomm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tests may want to unregister a platform device as part of the test case
logic. Using the regular platform_device_register() with kunit
assertions may result in a platform device leak or otherwise requires
cumbersome error handling. Provide a function that unregisters a
kunit-managed platform device and drops the release action from the
test's list.

Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Reviewed-by: Linus Walleij &lt;linusw@kernel.org&gt;
Link: https://patch.msgid.link/20260522-gpiolib-kunit-v3-2-b15fe6987430@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@oss.qualcomm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kunit: provide kunit_platform_device_register_full()</title>
<updated>2026-05-26T09:19:54+00:00</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bartosz.golaszewski@oss.qualcomm.com</email>
</author>
<published>2026-05-22T13:42:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=4c237ab773c93959aa2a7750f9dba772b5f1baee'/>
<id>4c237ab773c93959aa2a7750f9dba772b5f1baee</id>
<content type='text'>
Provide a kunit-managed variant of platform_device_register_full().

Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Reviewed-by: Linus Walleij &lt;linusw@kernel.org&gt;
Link: https://patch.msgid.link/20260522-gpiolib-kunit-v3-1-b15fe6987430@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@oss.qualcomm.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide a kunit-managed variant of platform_device_register_full().

Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Reviewed-by: Linus Walleij &lt;linusw@kernel.org&gt;
Link: https://patch.msgid.link/20260522-gpiolib-kunit-v3-1-b15fe6987430@oss.qualcomm.com
Signed-off-by: Bartosz Golaszewski &lt;bartosz.golaszewski@oss.qualcomm.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kunit: fix use-after-free in debugfs when using kunit.filter</title>
<updated>2026-05-21T16:45:49+00:00</updated>
<author>
<name>Florian Schmaus</name>
<email>florian.schmaus@codasip.com</email>
</author>
<published>2026-05-07T08:48:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=fb6988b83b4cafe8db63999c1ddff1b7c66d2ff5'/>
<id>fb6988b83b4cafe8db63999c1ddff1b7c66d2ff5</id>
<content type='text'>
When the kernel is booted with a kunit filter (e.g.,
kunit.filter="speed!=slow"), the kunit executor dynamically allocates
copies of the filtered test suites using kmalloc/kmemdup.

During the initial boot execution, kunit_debugfs_create_suite() creates
debugfs files (such as /sys/kernel/debug/kunit/&lt;suite&gt;/run) and
permanently stores a pointer to the dynamically allocated suite in the
inode's i_private field.

Previously, the executor freed this dynamically allocated suite_set
immediately after executing the boot-time tests. Because the debugfs
nodes were not destroyed, any subsequent interaction with the debugfs
`run` file from userspace triggered a use-after-free (UAF). On systems
with architectural capabilities, like CHERI RISC-V, this resulted in
an immediate fatal hardware exception due to the invalidation of the
capability tags on the reclaimed memory. On other architectures, it
resulted in silent memory corruption.

Fix this UAF by properly coupling the lifetime of the filtered suite
memory allocation to the lifetime of the kunit subsystem and its
associated VFS nodes. Ownership of the boot-time suite_set is now
transferred to a global tracker ('kunit_boot_suites'), and the memory
is cleanly released in kunit_exit() during module teardown.

Link: https://lore.kernel.org/r/20260507084854.233984-1-florian.schmaus@codasip.com
Fixes: e2219db280e3 ("kunit: add debugfs /sys/kernel/debug/kunit/&lt;suite&gt;/results display")
Signed-off-by: Florian Schmaus &lt;florian.schmaus@codasip.com&gt;
Reviewed-by: Martin Kaiser &lt;martin@kaiser.cx&gt;
Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the kernel is booted with a kunit filter (e.g.,
kunit.filter="speed!=slow"), the kunit executor dynamically allocates
copies of the filtered test suites using kmalloc/kmemdup.

During the initial boot execution, kunit_debugfs_create_suite() creates
debugfs files (such as /sys/kernel/debug/kunit/&lt;suite&gt;/run) and
permanently stores a pointer to the dynamically allocated suite in the
inode's i_private field.

Previously, the executor freed this dynamically allocated suite_set
immediately after executing the boot-time tests. Because the debugfs
nodes were not destroyed, any subsequent interaction with the debugfs
`run` file from userspace triggered a use-after-free (UAF). On systems
with architectural capabilities, like CHERI RISC-V, this resulted in
an immediate fatal hardware exception due to the invalidation of the
capability tags on the reclaimed memory. On other architectures, it
resulted in silent memory corruption.

Fix this UAF by properly coupling the lifetime of the filtered suite
memory allocation to the lifetime of the kunit subsystem and its
associated VFS nodes. Ownership of the boot-time suite_set is now
transferred to a global tracker ('kunit_boot_suites'), and the memory
is cleanly released in kunit_exit() during module teardown.

Link: https://lore.kernel.org/r/20260507084854.233984-1-florian.schmaus@codasip.com
Fixes: e2219db280e3 ("kunit: add debugfs /sys/kernel/debug/kunit/&lt;suite&gt;/results display")
Signed-off-by: Florian Schmaus &lt;florian.schmaus@codasip.com&gt;
Reviewed-by: Martin Kaiser &lt;martin@kaiser.cx&gt;
Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kunit: Add backtrace suppression self-tests</title>
<updated>2026-05-14T16:50:00+00:00</updated>
<author>
<name>Guenter Roeck</name>
<email>linux@roeck-us.net</email>
</author>
<published>2026-05-14T11:06:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=bbc960d009a6315f484944506bbb13165069ccc8'/>
<id>bbc960d009a6315f484944506bbb13165069ccc8</id>
<content type='text'>
Add unit tests to verify that warning backtrace suppression works.

Tests cover both API forms:
- Scoped: kunit_warning_suppress() with in-block count verification
  and post-block inactivity check.
- Direct functions: kunit_start/end_suppress_warning() with
  sequential independent suppression blocks and per-block counts.

Furthermore, tests verify incremental warning counting, that
kunit_has_active_suppress_warning() transitions correctly around
suppression boundaries, and that suppression active in the test
kthread does not leak to a separate kthread.

If backtrace suppression does _not_ work, the unit tests will likely
trigger unsuppressed backtraces, which should actually help to get
the affected architectures / platforms fixed.

Link: https://lore.kernel.org/r/20260514-kunit_add_support-v11-2-b36a530a6d8f@redhat.com
Tested-by: Linux Kernel Functional Testing &lt;lkft@linaro.org&gt;
Acked-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Alessandro Carminati &lt;acarmina@redhat.com&gt;
Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Albert Esteve &lt;aesteve@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add unit tests to verify that warning backtrace suppression works.

Tests cover both API forms:
- Scoped: kunit_warning_suppress() with in-block count verification
  and post-block inactivity check.
- Direct functions: kunit_start/end_suppress_warning() with
  sequential independent suppression blocks and per-block counts.

Furthermore, tests verify incremental warning counting, that
kunit_has_active_suppress_warning() transitions correctly around
suppression boundaries, and that suppression active in the test
kthread does not leak to a separate kthread.

If backtrace suppression does _not_ work, the unit tests will likely
trigger unsuppressed backtraces, which should actually help to get
the affected architectures / platforms fixed.

Link: https://lore.kernel.org/r/20260514-kunit_add_support-v11-2-b36a530a6d8f@redhat.com
Tested-by: Linux Kernel Functional Testing &lt;lkft@linaro.org&gt;
Acked-by: Dan Carpenter &lt;dan.carpenter@linaro.org&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Alessandro Carminati &lt;acarmina@redhat.com&gt;
Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Albert Esteve &lt;aesteve@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>bug/kunit: Core support for suppressing warning backtraces</title>
<updated>2026-05-14T16:50:00+00:00</updated>
<author>
<name>Alessandro Carminati</name>
<email>acarmina@redhat.com</email>
</author>
<published>2026-05-14T11:06:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=85347718ab0dd7ede9c3e1dcff2d604c7073df05'/>
<id>85347718ab0dd7ede9c3e1dcff2d604c7073df05</id>
<content type='text'>
Some unit tests intentionally trigger warning backtraces by passing bad
parameters to kernel API functions. Such unit tests typically check the
return value from such calls, not the existence of the warning backtrace.

Such intentionally generated warning backtraces are neither desirable
nor useful for a number of reasons:
- They can result in overlooked real problems.
- A warning that suddenly starts to show up in unit tests needs to be
  investigated and has to be marked to be ignored, for example by
  adjusting filter scripts. Such filters are ad hoc because there is
  no real standard format for warnings. On top of that, such filter
  scripts would require constant maintenance.

Solve the problem by providing a means to suppress warning backtraces
originating from the current kthread while executing test code. Since
each KUnit test runs in its own kthread, this effectively scopes
suppression to the test that enabled it. Limit changes to generic code
to the absolute minimum.

Implementation details:
Suppression is integrated into the existing KUnit hooks infrastructure
in test-bug.h, reusing the kunit_running static branch for zero
overhead when no tests are running.

Suppression is checked at three points in the warning path:
- In warn_slowpath_fmt(), the check runs before any output, fully
  suppressing both message and backtrace. This covers architectures
  without __WARN_FLAGS.
- In __warn_printk(), the check suppresses the warning message text.
  This covers architectures that define __WARN_FLAGS but not their own
  __WARN_printf (arm64, loongarch, parisc, powerpc, riscv, sh), where
  the message is printed before the trap enters __report_bug().
- In __report_bug(), the check runs before __warn() is called,
  suppressing the backtrace and stack dump.

To avoid double-counting on architectures where both __warn_printk()
and __report_bug() run for the same warning, kunit_is_suppressed_warning()
takes a bool parameter: true to increment the suppression counter
(used in warn_slowpath_fmt and __report_bug), false to check only
(used in __warn_printk).

The suppression state is dynamically allocated via kunit_kzalloc() and
tied to the KUnit test lifecycle via kunit_add_action(), ensuring
automatic cleanup at test exit. Writer-side access to the global
suppression list is serialized with a spinlock; readers use RCU.

Two API forms are provided:
- kunit_warning_suppress(test) { ... }: scoped, uses __cleanup for
  automatic teardown on scope exit, kunit_add_action() as safety net
  for abnormal exits (e.g. kthread_exit from failed assertions).
  Suppression handle is only accessible inside the block.
- kunit_start/end_suppress_warning(test): direct functions returning
  an explicit handle, for retaining the handle within the test,
  or for cross-function usage.

Link: https://lore.kernel.org/r/20260514-kunit_add_support-v11-1-b36a530a6d8f@redhat.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Alessandro Carminati &lt;acarmina@redhat.com&gt;
Reviewed-by: Kees Cook &lt;kees@kernel.org&gt;
Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Albert Esteve &lt;aesteve@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some unit tests intentionally trigger warning backtraces by passing bad
parameters to kernel API functions. Such unit tests typically check the
return value from such calls, not the existence of the warning backtrace.

Such intentionally generated warning backtraces are neither desirable
nor useful for a number of reasons:
- They can result in overlooked real problems.
- A warning that suddenly starts to show up in unit tests needs to be
  investigated and has to be marked to be ignored, for example by
  adjusting filter scripts. Such filters are ad hoc because there is
  no real standard format for warnings. On top of that, such filter
  scripts would require constant maintenance.

Solve the problem by providing a means to suppress warning backtraces
originating from the current kthread while executing test code. Since
each KUnit test runs in its own kthread, this effectively scopes
suppression to the test that enabled it. Limit changes to generic code
to the absolute minimum.

Implementation details:
Suppression is integrated into the existing KUnit hooks infrastructure
in test-bug.h, reusing the kunit_running static branch for zero
overhead when no tests are running.

Suppression is checked at three points in the warning path:
- In warn_slowpath_fmt(), the check runs before any output, fully
  suppressing both message and backtrace. This covers architectures
  without __WARN_FLAGS.
- In __warn_printk(), the check suppresses the warning message text.
  This covers architectures that define __WARN_FLAGS but not their own
  __WARN_printf (arm64, loongarch, parisc, powerpc, riscv, sh), where
  the message is printed before the trap enters __report_bug().
- In __report_bug(), the check runs before __warn() is called,
  suppressing the backtrace and stack dump.

To avoid double-counting on architectures where both __warn_printk()
and __report_bug() run for the same warning, kunit_is_suppressed_warning()
takes a bool parameter: true to increment the suppression counter
(used in warn_slowpath_fmt and __report_bug), false to check only
(used in __warn_printk).

The suppression state is dynamically allocated via kunit_kzalloc() and
tied to the KUnit test lifecycle via kunit_add_action(), ensuring
automatic cleanup at test exit. Writer-side access to the global
suppression list is serialized with a spinlock; readers use RCU.

Two API forms are provided:
- kunit_warning_suppress(test) { ... }: scoped, uses __cleanup for
  automatic teardown on scope exit, kunit_add_action() as safety net
  for abnormal exits (e.g. kthread_exit from failed assertions).
  Suppression handle is only accessible inside the block.
- kunit_start/end_suppress_warning(test): direct functions returning
  an explicit handle, for retaining the handle within the test,
  or for cross-function usage.

Link: https://lore.kernel.org/r/20260514-kunit_add_support-v11-1-b36a530a6d8f@redhat.com
Signed-off-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Signed-off-by: Alessandro Carminati &lt;acarmina@redhat.com&gt;
Reviewed-by: Kees Cook &lt;kees@kernel.org&gt;
Reviewed-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Albert Esteve &lt;aesteve@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kunit: config: KUNIT_DEBUGFS should depend on DEBUG_FS</title>
<updated>2026-05-04T18:10:40+00:00</updated>
<author>
<name>David Gow</name>
<email>david@davidgow.net</email>
</author>
<published>2026-04-25T03:41:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=8f80b5b227ef9ea422080487715c841856339aed'/>
<id>8f80b5b227ef9ea422080487715c841856339aed</id>
<content type='text'>
CONFIG_KUNIT_DEBUGFS is totally useless without debugfs, so it should
depend on CONFIG_DEBUG_FS.

Link: https://lore.kernel.org/r/20260425034155.53913-2-david@davidgow.net
Fixes: e2219db280e3 ("kunit: add debugfs /sys/kernel/debug/kunit/&lt;suite&gt;/results display")
Signed-off-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CONFIG_KUNIT_DEBUGFS is totally useless without debugfs, so it should
depend on CONFIG_DEBUG_FS.

Link: https://lore.kernel.org/r/20260425034155.53913-2-david@davidgow.net
Fixes: e2219db280e3 ("kunit: add debugfs /sys/kernel/debug/kunit/&lt;suite&gt;/results display")
Signed-off-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kunit: config: Enable KUNIT_DEBUGFS by default</title>
<updated>2026-05-04T18:10:40+00:00</updated>
<author>
<name>David Gow</name>
<email>david@davidgow.net</email>
</author>
<published>2026-04-25T03:41:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=17e4c68ff35090d8cb743e3c82c09f92fda1ebda'/>
<id>17e4c68ff35090d8cb743e3c82c09f92fda1ebda</id>
<content type='text'>
The KUNIT_DEBUGFS option is currently enabled based on the value of
KUNIT_ALL_TESTS, but it really doesn't have anything to do with the set of
enabled tests, so just enable it by default anyway. In particular, this
shouldn't be only visible if KUNIT_ALL_TESTS is set, which is quite
confusing.

Link: https://lore.kernel.org/r/20260425034155.53913-1-david@davidgow.net
Fixes: beaed42c427d ("kunit: default KUNIT_* fragments to KUNIT_ALL_TESTS")
Signed-off-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The KUNIT_DEBUGFS option is currently enabled based on the value of
KUNIT_ALL_TESTS, but it really doesn't have anything to do with the set of
enabled tests, so just enable it by default anyway. In particular, this
shouldn't be only visible if KUNIT_ALL_TESTS is set, which is quite
confusing.

Link: https://lore.kernel.org/r/20260425034155.53913-1-david@davidgow.net
Fixes: beaed42c427d ("kunit: default KUNIT_* fragments to KUNIT_ALL_TESTS")
Signed-off-by: David Gow &lt;david@davidgow.net&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kunit: reduce stack usage in kunit_run_tests()</title>
<updated>2026-03-02T17:11:06+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2026-02-02T09:48:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux.git/commit/?id=b11b9b6751b2cd74960dccd91667c5117fce743c'/>
<id>b11b9b6751b2cd74960dccd91667c5117fce743c</id>
<content type='text'>
Some of the recent changes to the kunit framework caused the stack usage
for kunit_run_tests() to grow higher than most other kernel functions,
which triggers a warning when CONFIG_FRAME_WARN is set to a relatively
low value:

lib/kunit/test.c: In function 'kunit_run_tests':
lib/kunit/test.c:801:1: error: the frame size of 1312 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]

Split out the inner loop into a separate function to ensure that each
function remains under the limit, and pass the kunit_result_stats
structures by reference to avoid excessive copies.

Fixed checkpatch warnings at commit time:
Shuah Khan &lt;skhan@linuxfoundation.org&gt;

Cc: Carlos Llamas &lt;cmllamas@google.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some of the recent changes to the kunit framework caused the stack usage
for kunit_run_tests() to grow higher than most other kernel functions,
which triggers a warning when CONFIG_FRAME_WARN is set to a relatively
low value:

lib/kunit/test.c: In function 'kunit_run_tests':
lib/kunit/test.c:801:1: error: the frame size of 1312 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]

Split out the inner loop into a separate function to ensure that each
function remains under the limit, and pass the kunit_result_stats
structures by reference to avoid excessive copies.

Fixed checkpatch warnings at commit time:
Shuah Khan &lt;skhan@linuxfoundation.org&gt;

Cc: Carlos Llamas &lt;cmllamas@google.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
