ASSERT(!(sflags & PAGE_CACHE_ATTRS));
- /* compute the PAT index for shadow page entry when VT-d is enabled
- * and device assigned.
+ /*
+ * Compute the PAT index for shadow page entry when IOMMU is enabled.
* 1) direct MMIO: compute the PAT index with gMTRR=UC and gPAT.
* 2) if enables snoop control, compute the PAT index as WB.
* 3) if disables snoop control, compute the PAT index with
gfn_to_paddr(target_gfn),
mfn_to_maddr(target_mfn),
X86_MT_UC);
- else if ( iommu_snoop )
+ else if ( is_iommu_enabled(d) && iommu_snoop )
sflags |= pat_type_2_pte_flags(X86_MT_WB);
else
sflags |= get_pat_flags(v,
printk("I/O virtualisation %sabled\n", iommu_enabled ? "en" : "dis");
if ( !iommu_enabled )
{
-#ifndef iommu_snoop
- iommu_snoop = false;
-#endif
iommu_hwdom_passthrough = false;
iommu_hwdom_strict = false;
}
if ( !acpi_disabled )
{
ret = acpi_dmar_init();
+
+#ifndef iommu_snoop
+ /*
+ * As long as there's no per-domain snoop control, and as long as on
+ * AMD we uniformly force coherent accesses, a possible command line
+ * override should affect VT-d only.
+ */
+ if ( ret )
+ iommu_snoop = true;
+#endif
+
if ( ret == -ENODEV )
ret = acpi_ivrs_init();
}