-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
intel_iommu: check and sync host IOMMU cap/ecap in scalable modern mode
When vIOMMU is configured in scalable modern mode, stage-1 page table is supported. We need to check and sync host side cap/ecap with vIOMMU cap/ecap. This happens when PCIe device (i.e., VFIO case) sets IOMMUFDDevice to vIOMMU. Some of the bits in cap/ecap is user controllable, then user setting is compared with host cap/ecap for compatibility, i.e., if intel_iommu is configured in scalable modern but VTD_ECAP_NEST isn't set in host ecap, that device will fail to attach. For other bits not controlled by user, i.e. VTD_CAP/ECAP_MASK bits, host cap/ecap is picked. Below is the sequence to initial and finalize vIOMMU cap/ecap: vtd_cap_init() initializes iommu->cap/ecap. ---- vtd_cap_init() iommu->host_cap/ecap is initialized as iommu->cap/ecap. ---- vtd_init() iommu->host_cap/ecap is updated some bits(VTD_CAP/ECAP_MASK) with host setting. ---- vtd_sync_hw_info() iommu->cap/ecap is finalized as iommu->host_cap/ecap. ---- vtd_machine_done_hook() iommu->host_cap/ecap is a temporary storage to hold intermediate value when synthesize host cap/ecap with vIOMMU's initial configured cap/ecap. Signed-off-by: Yi Liu <yi.l.liu@intel.com> Signed-off-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
- Loading branch information
1 parent
49b2362
commit 7f0bb59
Showing
2 changed files
with
85 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters