Advertisement
Guest User

iommu_xen

a guest
Jul 20th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. The question is in "d->need_iommu flag" in case of hardware domain. My answer (May 18, 2017, 5:41 p.m.) contains
  2. 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
  3. things (retain current bahavior) at least on x86.
  4.  
  5. It took some time for me to slightly understand these iommu command line options and how they interact with each other and how they
  6. affect IOMMU mapping.
  7. 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()
  8. due to overwriting with iommu_dom0_strict, etc.
  9.  
  10. I could come up with something like this, but I don't really like it because of necessity of checking "iommu_dom0_strict".
  11.  
  12. -int iommu_domain_init(struct domain *d)
  13. +int iommu_domain_init(struct domain *d, bool use_iommu)
  14. {
  15. struct domain_iommu *hd = dom_iommu(d);
  16. int ret = 0;
  17. @@ -142,7 +142,19 @@ int iommu_domain_init(struct domain *d)
  18. return 0;
  19.  
  20. hd->platform_ops = iommu_get_ops();
  21. - return hd->platform_ops->init(d);
  22. + ret = hd->platform_ops->init(d, use_iommu);
  23. + if ( ret )
  24. + return ret;
  25. +
  26. + if ( !is_hardware_domain(d) )
  27. + d->need_iommu = use_iommu;
  28. + else
  29. + {
  30. + if ( (paging_mode_translate(d) && !iommu_passthrough) || iommu_dom0_strict )
  31. + d->need_iommu = 1;
  32. + }
  33. +
  34. + return 0;
  35. }
  36.  
  37. 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