Skip to content

lkl: Add MSI and MSI-X support - #642

Open
clingfei wants to merge 1 commit into
lkl:masterfrom
clingfei:pci-msi
Open

lkl: Add MSI and MSI-X support#642
clingfei wants to merge 1 commit into
lkl:masterfrom
clingfei:pci-msi

Conversation

@clingfei

@clingfei clingfei commented Aug 7, 2026

Copy link
Copy Markdown

Add PCI MSI/MSI-X interrupt support for LKL PCI devices.

Implement LKL arch MSI hooks so PCI drivers can allocate MSI and MSI-X vectors through the generic PCI MSI fallback path. MSI vectors are backed by contiguous LKL IRQ blocks, while MSI-X vectors preserve sparse hardware vector indexes. The setup path associates MSI descriptors with LKL IRQs, installs an MSI irq_chip, programs the MSI multiple-message enable value, and unwinds IRQ state on failures.

Extend the LKL PCI host ABI with MSI/MSI-X setup and teardown callbacks, and teach the VFIO PCI host backend to wire VFIO MSI/MSI-X eventfds to LKL IRQs. When MSI/MSI-X is enabled, the VFIO backend disables the INTx path, polls the MSI eventfds, triggers the matching LKL IRQs, and restores INTx when MSI/MSI-X is torn down.

Also fix LKL ioremap handling for BAR offsets and add KUnit coverage for MSI IRQ allocation, sparse MSI-X vector indexes, and failure unwind paths. Enable PCI_MSI in the LKL defconfig and include the MSI KUnit suite in the LKL test configuration.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

Test Results

106 files  ±0  106 suites  ±0   11m 17s ⏱️ + 1m 4s
206 tests +1  195 ✅ +1  11 💤 ±0  0 ❌ ±0 
790 runs  +1  734 ✅ +1  56 💤 ±0  0 ❌ ±0 

Results for commit 83bfffe. ± Comparison against base commit 6bce814.

♻️ This comment has been updated with latest results.

@clingfei
clingfei force-pushed the pci-msi branch 2 times, most recently from f486523 to 557a360 Compare August 7, 2026 08:58

@tavip tavip left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR @clingfei, overall looks good, I'll take a closer look tomorrow. Could you please take a look at the test failures?

@clingfei
clingfei force-pushed the pci-msi branch 2 times, most recently from 826d048 to 83bfffe Compare August 9, 2026 12:17
Add PCI MSI/MSI-X interrupt support for LKL PCI devices.

Implement LKL arch MSI hooks so PCI drivers can allocate MSI and MSI-X
vectors through the generic PCI MSI fallback path. MSI vectors are
backed by contiguous LKL IRQ blocks, while MSI-X vectors preserve sparse
hardware vector indexes. The setup path associates MSI descriptors with
LKL IRQs, installs an MSI irq_chip, programs the MSI multiple-message
enable value, and unwinds IRQ state on failures.

Extend the LKL PCI host ABI with MSI/MSI-X setup and teardown callbacks,
and teach the VFIO PCI host backend to wire VFIO MSI/MSI-X eventfds to LKL
IRQs. When MSI/MSI-X is enabled, the VFIO backend disables the INTx path,
polls the MSI eventfds, triggers the matching LKL IRQs, and restores INTx
when MSI/MSI-X is torn down.

Also fix LKL ioremap handling for BAR offsets and add KUnit coverage for
MSI IRQ allocation, sparse MSI-X vector indexes, and failure unwind paths.
Enable PCI_MSI in the LKL defconfig and include the MSI KUnit suite in the
LKL test configuration.

Signed-off-by: Cheng Lingfei <chenglingfei@foxmail.com>
@clingfei

clingfei commented Aug 9, 2026

Copy link
Copy Markdown
Author

Thanks. Test failures have been fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants