Pad the uAPI definition so that it would align identically between 64-bit and 32-bit uarch, so consumers using this header will work correctly from 32-bit compat userspace on a 64-bit kernel. Do it in a minimally invasive way, so that 64-bit userspace will still work with the previous header, and so that no fields suddenly change sizes. Originally inspired by mlankhorst.
Unified · Split
| @@ -91,7 +91,7 @@ struct xe_user_extension { · 90 unmodified lines | ||
| 91 | 91 | */ |
| 92 | 92 | __u32 name; |
| 93 | 93 | /** |
| 94 | − * @flags: MBZ | |
| 94 | + * @pad: MBZ | |
| 95 | 95 | * |
| 96 | 96 | * All undefined bits must be zero. |
| 97 | 97 | */ |
| @@ -291,6 +291,9 @@ struct drm_xe_gem_create { · 193 unmodified lines | ||
| 291 | 291 | */ |
| 292 | 292 | __u32 handle; |
| 293 | 293 | |
| 294 | + /** @pad: MBZ */ | |
| 295 | + __u32 pad; | |
| 296 | + | |
| 294 | 297 | /** @reserved: Reserved */ |
| 295 | 298 | __u64 reserved[2]; |
| 296 | 299 | }; |
| @@ -335,6 +338,9 @@ struct drm_xe_ext_vm_set_property { · 38 unmodified lines | ||
| 335 | 338 | #define XE_VM_PROPERTY_BIND_OP_ERROR_CAPTURE_ADDRESS 0 |
| 336 | 339 | __u32 property; |
| 337 | 340 | |
| 341 | + /** @pad: MBZ */ | |
| 342 | + __u32 pad; | |
| 343 | + | |
| 338 | 344 | /** @value: property value */ |
| 339 | 345 | __u64 value; |
| 340 | 346 | |
| @@ -379,6 +385,9 @@ struct drm_xe_vm_bind_op { · 38 unmodified lines | ||
| 379 | 385 | */ |
| 380 | 386 | __u32 obj; |
| 381 | 387 | |
| 388 | + /** @pad: MBZ */ | |
| 389 | + __u32 pad; | |
| 390 | + | |
| 382 | 391 | union { |
| 383 | 392 | /** |
| 384 | 393 | * @obj_offset: Offset into the object, MBZ for CLEAR_RANGE, |
| @@ -469,6 +478,9 @@ struct drm_xe_vm_bind { · 84 unmodified lines | ||
| 469 | 478 | /** @num_binds: number of binds in this IOCTL */ |
| 470 | 479 | __u32 num_binds; |
| 471 | 480 | |
| 481 | + /** @pad: MBZ */ | |
| 482 | + __u32 pad; | |
| 483 | + | |
| 472 | 484 | union { |
| 473 | 485 | /** @bind: used if num_binds == 1 */ |
| 474 | 486 | struct drm_xe_vm_bind_op bind; |
| @@ -482,6 +494,9 @@ struct drm_xe_vm_bind { · 7 unmodified lines | ||
| 482 | 494 | /** @num_syncs: amount of syncs to wait on */ |
| 483 | 495 | __u32 num_syncs; |
| 484 | 496 | |
| 497 | + /** @pad2: MBZ */ | |
| 498 | + __u32 pad2; | |
| 499 | + | |
| 485 | 500 | /** @syncs: pointer to struct drm_xe_sync array */ |
| 486 | 501 | __u64 syncs; |
| 487 | 502 | |
| @@ -497,6 +512,9 @@ struct drm_xe_ext_engine_set_property { · 9 unmodified lines | ||
| 497 | 512 | /** @property: property to set */ |
| 498 | 513 | __u32 property; |
| 499 | 514 | |
| 515 | + /** @pad: MBZ */ | |
| 516 | + __u32 pad; | |
| 517 | + | |
| 500 | 518 | /** @value: property value */ |
| 501 | 519 | __u64 value; |
| 502 | 520 | }; |
| @@ -612,6 +630,9 @@ struct drm_xe_sync { · 109 unmodified lines | ||
| 612 | 630 | #define DRM_XE_SYNC_USER_FENCE 0x3 |
| 613 | 631 | #define DRM_XE_SYNC_SIGNAL 0x10 |
| 614 | 632 | |
| 633 | + /** @pad: MBZ */ | |
| 634 | + __u32 pad; | |
| 635 | + | |
| 615 | 636 | union { |
| 616 | 637 | __u32 handle; |
| 617 | 638 | /** |
| @@ -656,6 +677,9 @@ struct drm_xe_exec { · 38 unmodified lines | ||
| 656 | 677 | */ |
| 657 | 678 | __u16 num_batch_buffer; |
| 658 | 679 | |
| 680 | + /** @pad: MBZ */ | |
| 681 | + __u16 pad[3]; | |
| 682 | + | |
| 659 | 683 | /** @reserved: Reserved */ |
| 660 | 684 | __u64 reserved[2]; |
| 661 | 685 | }; |
| @@ -718,6 +742,8 @@ struct drm_xe_wait_user_fence { · 56 unmodified lines | ||
| 718 | 742 | #define DRM_XE_UFENCE_WAIT_ABSTIME (1 << 1) |
| 719 | 743 | #define DRM_XE_UFENCE_WAIT_VM_ERROR (1 << 2) |
| 720 | 744 | __u16 flags; |
| 745 | + /** @pad: MBZ */ | |
| 746 | + __u32 pad; | |
| 721 | 747 | /** @value: compare value */ |
| 722 | 748 | __u64 value; |
| 723 | 749 | /** @mask: comparison mask */ |
| @@ -750,6 +776,9 @@ struct drm_xe_vm_madvise { · 26 unmodified lines | ||
| 750 | 776 | /** @vm_id: The ID VM in which the VMA exists */ |
| 751 | 777 | __u32 vm_id; |
| 752 | 778 | |
| 779 | + /** @pad: MBZ */ | |
| 780 | + __u32 pad; | |
| 781 | + | |
| 753 | 782 | /** @range: Number of bytes in the VMA */ |
| 754 | 783 | __u64 range; |
| 755 | 784 | |
| @@ -794,6 +823,9 @@ struct drm_xe_vm_madvise { · 38 unmodified lines | ||
| 794 | 823 | /** @property: property to set */ |
| 795 | 824 | __u32 property; |
| 796 | 825 | |
| 826 | + /** @pad2: MBZ */ | |
| 827 | + __u32 pad2; | |
| 828 | + | |
| 797 | 829 | /** @value: property value */ |
| 798 | 830 | __u64 value; |
| 799 | 831 | |