Skip to contentSkip to conversation

iommu: need_iommu set early

RFC PATCH In review Elena Ufimtseva 3 participants 4 messages Feb 13, 2015 – Feb 17, 2015

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/5 iommu: need_iommu set early

Set need_iommu for dom0 early so pvh specific functions in construct_dom0 can pass this check.
See example in p2m-ept.c ept_set_entry.

---
 xen/arch/x86/domain_build.c |    1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/domain_build.c +1 -0
index 4380b57..a7bc2a4 100644
@@ -1525,6 +1525,7 @@ int __init construct_dom0(
 
     if ( is_pvh_domain(d) )
     {
+        d->need_iommu = 1;
         /* finally, fixup the page table, replacing mfns with pfns */
         pvh_fixup_page_tables_for_hap(v, v_start, v_end);
 
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/5
#1 lore raw
Quoted 5 lines · Elena Ufimtseva

Set need_iommu for dom0 early so pvh specific functions in construct_dom0 can pass this check.
See example in p2m-ept.c ept_set_entry.

Quoted 16 lines
---
 xen/arch/x86/domain_build.c |    1 +
 1 file changed, 1 insertion(+)
xen/arch/x86/domain_build.c +1 -0
index 4380b57..a7bc2a4 100644
@@ -1525,6 +1525,7 @@ int __init construct_dom0(
 
     if ( is_pvh_domain(d) )
     {
+        d->need_iommu = 1;
         /* finally, fixup the page table, replacing mfns with pfns */
         pvh_fixup_page_tables_for_hap(v, v_start, v_end);
 
#2 lore raw
In reply to Elena Ufimtseva
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 13.02.15 at 19:51, <[email protected]> wrote:

Set need_iommu for dom0 early so pvh specific functions in construct_dom0 can pass this check.
See example in p2m-ept.c ept_set_entry.

Having gone through the rest of this series, I can't see the relation and I also can't see why this would be needed all of the sudden. I was considering to apply this on its own, but without a proper explanation of why it's needed I don't think I should.

Jan

#3 lore raw
Quoted 11 lines · Jan Beulich
Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 13.02.15 at 19:51, <[email protected]> wrote:

Set need_iommu for dom0 early so pvh specific functions in construct_dom0 can pass this check.
See example in p2m-ept.c ept_set_entry.

Having gone through the rest of this series, I can't see the relation and I also can't see why this would be needed all of the sudden. I was considering to apply this on its own, but without a proper explanation of why it's needed I don't think I should.

After analysing once more I can see that this change is needed only with this patchset. If the command-line defined extra RMRRs are being mapped in hwdom_iommu_init, at that point the entries will be mapped with iommu as need_iommu will be set to 1.

I will work on the changes regarding extr RMRRs and get rid of this patch.

Quoted 2 lines

Jan