Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The question is in "d->need_iommu flag" in case of hardware domain. My answer (May 18, 2017, 5:41 p.m.) contains
- code snipet how I imagined new iommu_domain_init() implementation. Jan asked me (May 19, 2017, 6:30 a.m.) to be careful with it and not to brake
- things (retain current bahavior) at least on x86.
- It took some time for me to slightly understand these iommu command line options and how they interact with each other and how they
- affect IOMMU mapping.
- So, during iommu_domain_init() execution for hardware domain we have to know to what value "need_iommu" should be set to be on the same page with the following iommu_hwdom_init()
- due to overwriting with iommu_dom0_strict, etc.
- I could come up with something like this, but I don't really like it because of necessity of checking "iommu_dom0_strict".
- -int iommu_domain_init(struct domain *d)
- +int iommu_domain_init(struct domain *d, bool use_iommu)
- {
- struct domain_iommu *hd = dom_iommu(d);
- int ret = 0;
- @@ -142,7 +142,19 @@ int iommu_domain_init(struct domain *d)
- return 0;
- hd->platform_ops = iommu_get_ops();
- - return hd->platform_ops->init(d);
- + ret = hd->platform_ops->init(d, use_iommu);
- + if ( ret )
- + return ret;
- +
- + if ( !is_hardware_domain(d) )
- + d->need_iommu = use_iommu;
- + else
- + {
- + if ( (paging_mode_translate(d) && !iommu_passthrough) || iommu_dom0_strict )
- + d->need_iommu = 1;
- + }
- +
- + return 0;
- }
- I know that iommu_dom0_strict is not intended to be used after hardware domain initialization time, but I have no glue how to bypass it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement