Skip to content

Conversation

@eriknordmark
Copy link
Contributor

Description

Allow the kernel's IOMMU groups be different than the assigngrp received from the controller, but log warnings when a IOMMU group has larger scope than an assigngrp.

Also, do not expand the assigngrp based on the IOMMU groups for the purposes of determining which network adapters need to be kept in the host.

Testing all TBD.

How to test and validate this PR

TBD

Changelog notes

TBD this makes it possible to remove the ACS override patch.

Checklist

  • I've provided a proper description
  • I've added the proper documentation
  • I've tested my PR on amd64 device
  • I've tested my PR on arm64 device
  • I've written the test verification instructions
  • I've set the proper labels to this PR

And the last but not least:

  • I've checked the boxes above, or I've provided a good reason why I didn't
    check them.

Please, check the boxes above after submitting the PR in interactive mode.

This runtime check will get in the way if we remove the ACS override
patch.

Signed-off-by: eriknordmark <erik@zededa.com>
This will log warnings if the running kernel's IOMMU groups
include more PCI devices that the IoBundleList from the hardware
model.

Signed-off-by: eriknordmark <erik@zededa.com>
Trusting the controller to send the correct assigngrp in the EVE API.

Signed-off-by: eriknordmark <erik@zededa.com>
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 28.08%. Comparing base (2281599) to head (fb7e57f).
⚠️ Report is 154 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5488      +/-   ##
==========================================
+ Coverage   19.52%   28.08%   +8.55%     
==========================================
  Files          19       19              
  Lines        3021     2314     -707     
==========================================
+ Hits          590      650      +60     
+ Misses       2310     1520     -790     
- Partials      121      144      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

XXX squash with previous commits

Signed-off-by: eriknordmark <erik@zededa.com>
Signed-off-by: eriknordmark <erik@zededa.com>
// expand list to include other PCI functions on the same PCI controller
// since they need to be treated as part of the same bundle even if the
// EVE controller doesn't know it
list = aa.ExpandControllers(log, list, hyper.PCISameController)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand exactly why are you removing this check.... on systems without the ACS patch, we might have an I/O adapter in a certain IOMMU group which has more elements, we can allow the passthrough of the single adapter, but QEMU will fail to initialize the VM anyways (if there are more devices not attached to the vfio-driver in the same IOMMU group)....

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The question we need to answer is whether we can have all systems run without the ACS override patch and only rely on the controller indicating the groups.
If you are correct that QEMU will fail to boot if not all devices in the IOMMU group are assigned to the booted VM then clearly this will not work, but my memory from years back was that the failures were more subtle meaning that there wasn't such an explicit check in QEMU/kvm at boot time.

Copy link
Contributor

Choose a reason for hiding this comment

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

I've seen at least an error like the following in a recent past:

  1. USB Controller + thermal device under the same IOMMU group
  2. USB Controller assigned to vfio-pci driver
  3. USB Controller passedthrough to the Edge App VM
  4. Thermal device assigned to its own driver (no passing through)

With this configuration, QEMU fails to initialize the VM....

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