Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IOMMU support #338

Merged
merged 2 commits into from
Dec 4, 2024
Merged

Add IOMMU support #338

merged 2 commits into from
Dec 4, 2024

Conversation

joelsmithTT
Copy link
Contributor

This implementation is not going to work very well for large allocations. The problem is detailed in a comment in the code. This is something we will have to address before we can deploy (i.e. enable system IOMMU in our infra).

Issue

#257

Description

Adds support for using a normal (i.e. not backed by 1G page) buffer for sysmem. This requires a system with IOMMU enabled and not in passthrough mode, and also a recent (>= 1.29.0) KMD.

List of the changes

  • Adds IOMMU detection logic to pci_device.cpp
  • KMD version check if IOMMU is enabled
  • Adds API for initializing per-device sysmem without hugepages
  • Defaults to not using hugepages if the system IOMMU is enabled

Testing

Manual testing on my development machine.

API Changes

There are no API changes in this PR.

device/pcie/pci_device.hpp Outdated Show resolved Hide resolved
device/pcie/pci_device.cpp Show resolved Hide resolved
device/pcie/pci_device.cpp Show resolved Hide resolved
device/pcie/pci_device.cpp Outdated Show resolved Hide resolved
device/pcie/pci_device.hpp Outdated Show resolved Hide resolved
@pjanevskiTT
Copy link
Contributor

I think it would be nice to add a README somewhere in the repo which explains how IOMMU can be setup, if additional setup from the default Linux setup is necessary

@joelsmithTT joelsmithTT force-pushed the joelsmith/joelsmith/iommu-support branch from 5832c26 to 90c09f1 Compare December 4, 2024 16:10
@joelsmithTT
Copy link
Contributor Author

RE: README - I created #370 to track further work on this, which includes documenting it.

@joelsmithTT joelsmithTT force-pushed the joelsmith/joelsmith/iommu-support branch from 90c09f1 to 3f908eb Compare December 4, 2024 19:50
This implementation is not going to work very well for large
allocations.  The problem is detailed in a comment in the code.
@joelsmithTT joelsmithTT force-pushed the joelsmith/joelsmith/iommu-support branch from 3f908eb to b827063 Compare December 4, 2024 19:51
@joelsmithTT joelsmithTT merged commit dc5e371 into main Dec 4, 2024
18 of 22 checks passed
@joelsmithTT joelsmithTT deleted the joelsmith/joelsmith/iommu-support branch December 4, 2024 20:30
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.

4 participants