History

drm/xe: Add explicit padding to uAPI definition

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.

Christopher Snowhill committed 3 years ago

Commit e2bd81a1 parent 1b1d3711 file · +33 −1Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/drm/xe_drm.h+33−1
@@ -91,7 +91,7 @@ struct xe_user_extension { · 90 unmodified lines
9191 */
9292 __u32 name;
9393 /**
94− * @flags: MBZ
94+ * @pad: MBZ
9595 *
9696 * All undefined bits must be zero.
9797 */
@@ -291,6 +291,9 @@ struct drm_xe_gem_create { · 193 unmodified lines
291291 */
292292 __u32 handle;
293293
294+ /** @pad: MBZ */
295+ __u32 pad;
296+
294297 /** @reserved: Reserved */
295298 __u64 reserved[2];
296299 };
@@ -335,6 +338,9 @@ struct drm_xe_ext_vm_set_property { · 38 unmodified lines
335338 #define XE_VM_PROPERTY_BIND_OP_ERROR_CAPTURE_ADDRESS 0
336339 __u32 property;
337340
341+ /** @pad: MBZ */
342+ __u32 pad;
343+
338344 /** @value: property value */
339345 __u64 value;
340346
@@ -379,6 +385,9 @@ struct drm_xe_vm_bind_op { · 38 unmodified lines
379385 */
380386 __u32 obj;
381387
388+ /** @pad: MBZ */
389+ __u32 pad;
390+
382391 union {
383392 /**
384393 * @obj_offset: Offset into the object, MBZ for CLEAR_RANGE,
@@ -469,6 +478,9 @@ struct drm_xe_vm_bind { · 84 unmodified lines
469478 /** @num_binds: number of binds in this IOCTL */
470479 __u32 num_binds;
471480
481+ /** @pad: MBZ */
482+ __u32 pad;
483+
472484 union {
473485 /** @bind: used if num_binds == 1 */
474486 struct drm_xe_vm_bind_op bind;
@@ -482,6 +494,9 @@ struct drm_xe_vm_bind { · 7 unmodified lines
482494 /** @num_syncs: amount of syncs to wait on */
483495 __u32 num_syncs;
484496
497+ /** @pad2: MBZ */
498+ __u32 pad2;
499+
485500 /** @syncs: pointer to struct drm_xe_sync array */
486501 __u64 syncs;
487502
@@ -497,6 +512,9 @@ struct drm_xe_ext_engine_set_property { · 9 unmodified lines
497512 /** @property: property to set */
498513 __u32 property;
499514
515+ /** @pad: MBZ */
516+ __u32 pad;
517+
500518 /** @value: property value */
501519 __u64 value;
502520 };
@@ -612,6 +630,9 @@ struct drm_xe_sync { · 109 unmodified lines
612630 #define DRM_XE_SYNC_USER_FENCE 0x3
613631 #define DRM_XE_SYNC_SIGNAL 0x10
614632
633+ /** @pad: MBZ */
634+ __u32 pad;
635+
615636 union {
616637 __u32 handle;
617638 /**
@@ -656,6 +677,9 @@ struct drm_xe_exec { · 38 unmodified lines
656677 */
657678 __u16 num_batch_buffer;
658679
680+ /** @pad: MBZ */
681+ __u16 pad[3];
682+
659683 /** @reserved: Reserved */
660684 __u64 reserved[2];
661685 };
@@ -718,6 +742,8 @@ struct drm_xe_wait_user_fence { · 56 unmodified lines
718742 #define DRM_XE_UFENCE_WAIT_ABSTIME (1 << 1)
719743 #define DRM_XE_UFENCE_WAIT_VM_ERROR (1 << 2)
720744 __u16 flags;
745+ /** @pad: MBZ */
746+ __u32 pad;
721747 /** @value: compare value */
722748 __u64 value;
723749 /** @mask: comparison mask */
@@ -750,6 +776,9 @@ struct drm_xe_vm_madvise { · 26 unmodified lines
750776 /** @vm_id: The ID VM in which the VMA exists */
751777 __u32 vm_id;
752778
779+ /** @pad: MBZ */
780+ __u32 pad;
781+
753782 /** @range: Number of bytes in the VMA */
754783 __u64 range;
755784
@@ -794,6 +823,9 @@ struct drm_xe_vm_madvise { · 38 unmodified lines
794823 /** @property: property to set */
795824 __u32 property;
796825
826+ /** @pad2: MBZ */
827+ __u32 pad2;
828+
797829 /** @value: property value */
798830 __u64 value;
799831

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t