lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ded44edf-eeb7-420c-b8a8-d6543b955e6e@roeck-us.net>
Date: Sun, 10 Aug 2025 12:37:31 -0700
From: Guenter Roeck <linux@...ck-us.net>
To: Brian Norris <briannorris@...omium.org>
Cc: Thomas Gleixner <tglx@...utronix.de>,
	Tsai Sung-Fu <danielsftsai@...gle.com>,
	Douglas Anderson <dianders@...omium.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] genirq: Add kunit tests for depth counts

Hi Brian,

On Thu, May 22, 2025 at 02:08:01PM -0700, Brian Norris wrote:
> There have been a few bugs and/or misunderstandings about the reference
> counting, and startup/shutdown behaviors in the IRQ core and related CPU
> hotplug code. These 4 test cases try to capture a few interesting cases.
> 
> * irq_disable_depth_test: basic request/disable/enable sequence
> 
> * irq_free_disabled_test: request/disable/free/re-request sequence -
>   this catches errors on previous revisions of my work
> 
> * irq_cpuhotplug_test: exercises managed-affinity IRQ + CPU hotplug.
>   This captures a problematic test case that I've fixed.
>   This test requires CONFIG_SMP and a hotpluggable CPU#1.
> 
> * irq_shutdown_depth_test: exercises similar behavior from
>   irq_cpuhotplug_test, but directly using irq_*() APIs instead of going
>   through CPU hotplug. This still requires CONFIG_SMP, because
>   managed-affinity is stubbed out (and not all APIs are even present)
>   without it.
> 
> Note the use of 'imply SMP': ARCH=um doesn't support SMP, and kunit is
> often exercised there. Thus, 'imply' will force SMP on where possible
> (such as ARCH=x86_64), but leave it off where it's not.
> 
...
>  
> +config IRQ_KUNIT_TEST
> +	bool "KUnit tests for IRQ management APIs" if !KUNIT_ALL_TESTS
> +	depends on KUNIT=y
> +	default KUNIT_ALL_TESTS
> +	imply SMP
> +	help
> +	  This option enables KUnit tests for the IRQ subsystem API. These are
> +	  only for development and testing, not for regular kernel use cases.
> +
> +	  If unsure, say N.
> +

The new code calls irq_domain_alloc_descs(), making it dependent
on IRQ_DOMAIN. However, specifying that dependency directly is not
possible:

 config IRQ_KUNIT_TEST
        bool "KUnit tests for IRQ management APIs" if !KUNIT_ALL_TESTS
        depends on KUNIT=y
+       depends on IRQ_DOMAIN
        default KUNIT_ALL_TESTS
        imply SMP
        help

results in:

*** Default configuration is based on 'defconfig'
error: recursive dependency detected!
	symbol SMP is implied by IRQ_KUNIT_TEST
	symbol IRQ_KUNIT_TEST depends on IRQ_DOMAIN
	symbol IRQ_DOMAIN is selected by IRQ_DOMAIN_HIERARCHY
	symbol IRQ_DOMAIN_HIERARCHY is selected by GENERIC_IRQ_IPI
	symbol GENERIC_IRQ_IPI depends on SMP

This is seen with alpha configurations such as alpha:defconfig after
adding the IRQ_DOMAIN dependency.

I have no idea how to resolve this. For now I disabled IRQ_KUNIT_TEST
for my alpha test builds.

Guenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ