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

Added some details on checking IOMMU for PCI passthrough #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alfh
Copy link

@alfh alfh commented Mar 18, 2023

Add info on how to check if IOMMU is enabled on the current running kernel, and how to add the kernel parameters. Also add some info related to iommu_groups, and hint on iommu=pt for performance.

I used this to enable PCI passthrough of USB controller, which worked, even if I did not have anything in the /sys/kernel/iommu_groups.

Before submitting the pull request, you must agree with the following statements by checking both boxes with a 'x'.

  • [ x] "I accept that my contribution is placed under the CC BY-SA 2.0 license [1]."
  • [ x] "My contribution complies with the Developer Certificate of Origin [2]."

[1] https://creativecommons.org/licenses/by-sa/2.0/
[2] https://xcp-ng.org/docs/contributing.html#developer-certificate-of-origin-dco

Add info on how to check if IOMMU is enabled on the current running kernel, and how to add the kernel parameters.
Also add some info related to iommu_groups, and hint on iommu=pt for performance.

I used this to enable PCI passthrough of USB controller, which worked, even if I did not have anything in the /sys/kernel/iommu_groups.

Signed-off-by: Alf Høgemark <[email protected]>
Copy link

@andSmv andSmv left a comment

Choose a reason for hiding this comment

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

The dom0 kernel doesn't have to access the platform IOMMU(s). The IOMMU need to be enabled on the platform in the firmware (BIOS/UEFI), but it is managed by XEN and in totally transparent manner to the VMs. So this is true for PCI passthrough needs. However, there are some patches in XCP-ng, which under some circumstances enable such an access for the VMs. But this can be veiwed as a very basic paravartualized IOMMU (and which is not pluged to Linux kernel IOMMU framework) . This pv IOMMU is not discovered through Intel DMAR (or AMD IVRS) ACPI tables. To be honest, this facility is almost never used. So, in any circumstances, you don't have to manipulate dom0 kernel command line IOMMU-related parameters.

Copy link
Member

@stormi stormi left a comment

Choose a reason for hiding this comment

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

Marking as "changes requested" so that we don't merge by mistake.

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.

3 participants