]> Gentwo Git Trees - linux/.git/commitdiff
um: Support SPARSE_IRQ
authorSinan Nalkaya <sardok@gmail.com>
Wed, 27 Aug 2025 22:04:18 +0000 (15:04 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 10 Sep 2025 12:23:30 +0000 (14:23 +0200)
Motivation: IRQ KUnit tests are going to require CONFIG_SPARSE_IRQ [1] in
order to:
(a) reliably allocate additional (fake) IRQs and
(b) ensure we can test managed affinity, which is only supported with
    SPARSE_IRQ.

It seems that the only thing necessary for ARCH=um is to tell the genirq
core to skip over our preallocated NR_IRQS.

Tested with:

  $ ./tools/testing/kunit/kunit.py run
  [...]
  [13:55:58] Testing complete. Ran 676 tests: passed: 646, skipped: 30
  [...]

This compares with pre-patch results:

    Ran 672 tests: passed: 644, skipped: 28

i.e., we no longer skip tests that 'depend on SPARSE_IRQ', and existing
tests all pass.

[1]
[PATCH v2 4/6] genirq/test: Depend on SPARSE_IRQ
https://lore.kernel.org/all/CABVgOSngoD0fh1WEkUCEwSdk0Joypo3dA_Y_SjW+K=nVDnZs3Q@mail.gmail.com/

Signed-off-by: Sinan Nalkaya <sardok@gmail.com>
[Brian: Adapted Sinan's patch; rewrote commit message]
Signed-off-by: Brian Norris <briannorris@chromium.org>
Tested-by: David Gow <davidgow@google.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
arch/um/Kconfig
arch/um/kernel/irq.c

index 9083bfdb77350d799e3c5e036e41a8dff553280a..8161cc5ae6f7e4f647e37a8f6b260f30355820ad 100644 (file)
@@ -38,6 +38,7 @@ config UML
        select HAVE_ARCH_TRACEHOOK
        select HAVE_SYSCALL_TRACEPOINTS
        select THREAD_INFO_IN_TASK
+       select SPARSE_IRQ
 
 config MMU
        bool
index 0dfaf96bb7da3b52b0643ade09b83dc5a31d2bb1..d69d137a0334aca25762ecb5219cf87f5e525db4 100644 (file)
@@ -691,6 +691,11 @@ void __init init_IRQ(void)
        os_setup_epoll();
 }
 
+int __init arch_probe_nr_irqs(void)
+{
+       return NR_IRQS;
+}
+
 void sigchld_handler(int sig, struct siginfo *unused_si,
                     struct uml_pt_regs *regs, void *mc)
 {