]> xenbits.xensource.com Git - xen.git/commitdiff
make logdirty and iommu mutually exclusive
authorRoger Pau Monné <roger.pau@citrix.com>
Thu, 5 Jun 2014 15:41:46 +0000 (17:41 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 5 Jun 2014 15:41:46 +0000 (17:41 +0200)
Prevent the usage of global logdirty if the domain is using the IOMMU,
and also prevent passthrough of devices if logdirty is enabled.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/paging.c
xen/drivers/passthrough/pci.c

index 9e9a11b561ff35122688d75127c772d7a0680a56..32764ba86d8908795a1ce258894ef34d8ad1cd7c 100644 (file)
@@ -168,6 +168,15 @@ int paging_log_dirty_enable(struct domain *d, bool_t log_global)
 {
     int ret;
 
+    if ( need_iommu(d) && log_global )
+    {
+        /*
+         * Refuse to turn on global log-dirty mode
+         * if the domain is using the IOMMU.
+         */
+        return -EINVAL;
+    }
+
     if ( paging_mode_log_dirty(d) )
         return -EINVAL;
 
index b7f6e8ac1abdf081411070eda8779b0646175071..43c1a81f914317eeb608621c822d6bd54eb17426 100644 (file)
@@ -1233,7 +1233,8 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn)
      * enabled for this domain */
     if ( unlikely(!need_iommu(d) &&
             (d->arch.hvm_domain.mem_sharing_enabled ||
-             d->mem_event->paging.ring_page)) )
+             d->mem_event->paging.ring_page ||
+             p2m_get_hostp2m(d)->global_logdirty)) )
         return -EXDEV;
 
     if ( !spin_trylock(&pcidevs_lock) )