]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
IOMMU: add missing HVM check
authorJan Beulich <jbeulich@suse.com>
Wed, 2 Oct 2019 11:36:59 +0000 (13:36 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 2 Oct 2019 11:36:59 +0000 (13:36 +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>
xen/drivers/passthrough/pci.c

index 7deef2f12bb316888ccd03b2ef319702792eb514..90ccb8370b644ae8e7a8409464075ac3fe035e5d 100644 (file)
@@ -1488,7 +1488,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(d->arch.hvm.mem_sharing_enabled ||
+    if ( unlikely((is_hvm_domain(d) &&
+                   d->arch.hvm.mem_sharing_enabled) ||
                   vm_event_check_ring(d->vm_event_paging) ||
                   p2m_get_hostp2m(d)->global_logdirty) )
         return -EXDEV;