Skip to contentSkip to conversation

Passthough/domctl: Use correct struct in union

PATCH In review Andrew Cooper 1 participant 2 messages Jan 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Passthough/domctl: Use correct struct in union

This appears to be a copy paste error from c/s 23861:ec7c81fbe0de.

It is safe, functionally speaking, as both the xen_domctl_assign_device and xen_domctl_get_device_group structure start with a 'uint32_t machine_sbdf'. We should however use the correct union structure.

xen/drivers/passthrough/iommu.c +3 -3
diff -r c4114a042410 -r 69ac79e96ddd xen/drivers/passthrough/iommu.c
@@ -591,7 +591,7 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        seg = domctl->u.get_device_group.machine_sbdf >> 16;
+        seg = domctl->u.assign_device.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.assign_device.machine_sbdf & 0xff;
 
@@ -615,7 +615,7 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        seg = domctl->u.get_device_group.machine_sbdf >> 16;
+        seg = domctl->u.assign_device.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.assign_device.machine_sbdf & 0xff;
 
@@ -634,7 +634,7 @@ int iommu_do_domctl(
         if ( ret )
             break;
 
-        seg = domctl->u.get_device_group.machine_sbdf >> 16;
+        seg = domctl->u.assign_device.machine_sbdf >> 16;
         bus = (domctl->u.assign_device.machine_sbdf >> 8) & 0xff;
         devfn = domctl->u.assign_device.machine_sbdf & 0xff;
#1 lore raw
Quoted 7 lines · Andrew Cooper

This appears to be a copy paste error from c/s 23861:ec7c81fbe0de.

It is safe, functionally speaking, as both the xen_domctl_assign_device and xen_domctl_get_device_group structure start with a 'uint32_t machine_sbdf'. We should however use the correct union structure.

I should also say that this affects Xen-4.2 as well, so I suggest it as a candidate for backport.

~Andrew

Quoted 36 lines

diff -r c4114a042410 -r 69ac79e96ddd xen/drivers/passthrough/iommu.c

xen/drivers/passthrough/iommu.c +3 -3
@@ -591,7 +591,7 @@ int iommu_do_domctl(
          if ( ret )
              break;
 
-        seg = domctl->u.get_device_group.machine_sbdf>>  16;
+        seg = domctl->u.assign_device.machine_sbdf>>  16;
          bus = (domctl->u.assign_device.machine_sbdf>>  8)&  0xff;
          devfn = domctl->u.assign_device.machine_sbdf&  0xff;
 
@@ -615,7 +615,7 @@ int iommu_do_domctl(
          if ( ret )
              break;
 
-        seg = domctl->u.get_device_group.machine_sbdf>>  16;
+        seg = domctl->u.assign_device.machine_sbdf>>  16;
          bus = (domctl->u.assign_device.machine_sbdf>>  8)&  0xff;
          devfn = domctl->u.assign_device.machine_sbdf&  0xff;
 
@@ -634,7 +634,7 @@ int iommu_do_domctl(
          if ( ret )
              break;
 
-        seg = domctl->u.get_device_group.machine_sbdf>>  16;
+        seg = domctl->u.assign_device.machine_sbdf>>  16;
          bus = (domctl->u.assign_device.machine_sbdf>>  8)&  0xff;
          devfn = domctl->u.assign_device.machine_sbdf&  0xff;
 

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel