Skip to contentSkip to conversation

IOMMU: add missing HVM check

PATCH In review Jan Beulich 4 participants 5 messages Oct 2, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IOMMU: add missing HVM check

Fix an unguarded d->arch.hvm access in assign_device().

---
Split from now withdrawn "x86/HVM: p2m_ram_ro is incompatible with device pass-through".

xen/drivers/passthrough/pci.c +2 -1
@@ -1488,7 +1488,8 @@ static int assign_device(struct domain *
 
     /* 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;

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#2 lore raw
Quoted 6 lines · Roger Pau Monné
Quoted 3 lines · Jan Beulich

Fix an unguarded d->arch.hvm access in assign_device().

Thanks.

Quoted 1 line

I'm also adding Juergen as I think this is suitable for 4.13.

As a previously posted fix I didn't think it needed a release ack just yet, i.e. before the freeze.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#3 lore raw
Quoted 6 lines · Jan Beulich
Quoted 5 lines · Roger Pau Monné
Quoted 3 lines · Jan Beulich

Fix an unguarded d->arch.hvm access in assign_device().

Quoted 8 lines
Quoted 1 line

Thanks.

Quoted 1 line

I'm also adding Juergen as I think this is suitable for 4.13.

As a previously posted fix I didn't think it needed a release ack just yet, i.e. before the freeze.

Right.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel