History

drm/xe/uapi: Fix various struct padding for 64b alignment

Let's respect Documentation/process/botching-up-ioctls.rst and add the proper padding for a 64b alignment with all as well as all the required checks and settings for the pads and the reserved entries. v2: Fix remaining holes and double check with pahole (Jose) Ensure with pahole that both 32b and 64b have exact same layout (Thomas) Do not set query's pad and reserved bits to zero since it is redundant and already done by kzalloc (Matt) v3: Fix alignment after rebase (José Roberto de Souza) v4: Fix pad check (Francois Dugast)

Rodrigo Vivi committed 2 years ago

Commit 7a56bd01 parent c3fca104 files · +23 −10Browse files

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

Unified · Split

include/uapi/drm/xe_drm.h+12−9
@@ -212,8 +212,6 @@ struct drm_xe_mem_region { · 211 unmodified lines
212 * a unique pair.212 * a unique pair.
213 */213 */
214 __u16 instance;214 __u16 instance;
215 /** @pad: MBZ */
216 __u32 pad;
217 /**215 /**
218 * @min_page_size: Min page-size in bytes for this region.216 * @min_page_size: Min page-size in bytes for this region.
219 *217 *
@@ -382,6 +380,8 @@ struct drm_xe_gt { · 162 unmodified lines
382 __u16 tile_id;380 __u16 tile_id;
383 /** @gt_id: Unique ID of this GT within the PCI Device */381 /** @gt_id: Unique ID of this GT within the PCI Device */
384 __u16 gt_id;382 __u16 gt_id;
383 /** @pad: MBZ */
384 __u16 pad[3];
385 /** @reference_clock: A clock frequency for timestamp */385 /** @reference_clock: A clock frequency for timestamp */
386 __u32 reference_clock;386 __u32 reference_clock;
387 /**387 /**
@@ -601,7 +601,7 @@ struct drm_xe_gem_create { · 213 unmodified lines
601#define DRM_XE_GEM_CPU_CACHING_WC 2601#define DRM_XE_GEM_CPU_CACHING_WC 2
602 __u16 cpu_caching;602 __u16 cpu_caching;
603 /** @pad: MBZ */603 /** @pad: MBZ */
604 __u16 pad;604 __u16 pad[3];
605 605
606 /** @reserved: Reserved */606 /** @reserved: Reserved */
607 __u64 reserved[2];607 __u64 reserved[2];
@@ -782,6 +782,9 @@ struct drm_xe_vm_bind_op { · 174 unmodified lines
782 */782 */
783 __u32 prefetch_mem_region_instance;783 __u32 prefetch_mem_region_instance;
784 784
785 /** @pad: MBZ */
786 __u32 pad2;
787
785 /** @reserved: Reserved */788 /** @reserved: Reserved */
786 __u64 reserved[3];789 __u64 reserved[3];
787};790};
@@ -800,12 +803,12 @@ struct drm_xe_vm_bind { · 12 unmodified lines
800 */803 */
801 __u32 exec_queue_id;804 __u32 exec_queue_id;
802 805
803 /** @num_binds: number of binds in this IOCTL */
804 __u32 num_binds;
805
806 /** @pad: MBZ */806 /** @pad: MBZ */
807 __u32 pad;807 __u32 pad;
808 808
809 /** @num_binds: number of binds in this IOCTL */
810 __u32 num_binds;
811
809 union {812 union {
810 /** @bind: used if num_binds == 1 */813 /** @bind: used if num_binds == 1 */
811 struct drm_xe_vm_bind_op bind;814 struct drm_xe_vm_bind_op bind;
@@ -817,12 +820,12 @@ struct drm_xe_vm_bind { · 5 unmodified lines
817 __u64 vector_of_binds;820 __u64 vector_of_binds;
818 };821 };
819 822
823 /** @pad: MBZ */
824 __u32 pad2;
825
820 /** @num_syncs: amount of syncs to wait on */826 /** @num_syncs: amount of syncs to wait on */
821 __u32 num_syncs;827 __u32 num_syncs;
822 828
823 /** @pad2: MBZ */
824 __u32 pad2;
825
826 /** @syncs: pointer to struct drm_xe_sync array */829 /** @syncs: pointer to struct drm_xe_sync array */
827 __u64 syncs;830 __u64 syncs;
828 831

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