]> xenbits.xensource.com Git - people/dwmw2/xen.git/commitdiff
IOMMU: add missing HVM check
authorJan Beulich <jbeulich@suse.com>
Fri, 25 Oct 2019 10:00:41 +0000 (12:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 25 Oct 2019 10:00:41 +0000 (12:00 +0200)
Fix an unguarded d->arch.hvm access in assign_device().

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
master commit: 41fd1009cd7416b73d745a77c24b4e8d1a296fe6
master date: 2019-10-02 13:36:59 +0200

xen/drivers/passthrough/pci.c

index f51cae7f4e6ce4c71f59a1b9bab136d0a1d8326c..037aba7c9451df9cb21732ef458b646af3195667 100644 (file)
@@ -1416,7 +1416,8 @@ static int assign_device(struct domain *d, u16 seg, u8 bus, u8 devfn, u32 flag)
     /* Prevent device assign if mem paging or mem sharing have been 
      * enabled for this domain */
     if ( unlikely(!need_iommu(d) &&
-            (d->arch.hvm_domain.mem_sharing_enabled ||
+            ((is_hvm_domain(d) &&
+              d->arch.hvm_domain.mem_sharing_enabled) ||
              vm_event_check_ring(d->vm_event_paging) ||
              p2m_get_hostp2m(d)->global_logdirty)) )
         return -EXDEV;