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
212212 * a unique pair.
213213 */
214214 __u16 instance;
215− /** @pad: MBZ */
216− __u32 pad;
217215 /**
218216 * @min_page_size: Min page-size in bytes for this region.
219217 *
@@ -382,6 +380,8 @@ struct drm_xe_gt { · 162 unmodified lines
382380 __u16 tile_id;
383381 /** @gt_id: Unique ID of this GT within the PCI Device */
384382 __u16 gt_id;
383+ /** @pad: MBZ */
384+ __u16 pad[3];
385385 /** @reference_clock: A clock frequency for timestamp */
386386 __u32 reference_clock;
387387 /**
@@ -601,7 +601,7 @@ struct drm_xe_gem_create { · 213 unmodified lines
601601 #define DRM_XE_GEM_CPU_CACHING_WC 2
602602 __u16 cpu_caching;
603603 /** @pad: MBZ */
604− __u16 pad;
604+ __u16 pad[3];
605605
606606 /** @reserved: Reserved */
607607 __u64 reserved[2];
@@ -782,6 +782,9 @@ struct drm_xe_vm_bind_op { · 174 unmodified lines
782782 */
783783 __u32 prefetch_mem_region_instance;
784784
785+ /** @pad: MBZ */
786+ __u32 pad2;
787+
785788 /** @reserved: Reserved */
786789 __u64 reserved[3];
787790 };
@@ -800,12 +803,12 @@ struct drm_xe_vm_bind { · 12 unmodified lines
800803 */
801804 __u32 exec_queue_id;
802805
803− /** @num_binds: number of binds in this IOCTL */
804− __u32 num_binds;
805−
806806 /** @pad: MBZ */
807807 __u32 pad;
808808
809+ /** @num_binds: number of binds in this IOCTL */
810+ __u32 num_binds;
811+
809812 union {
810813 /** @bind: used if num_binds == 1 */
811814 struct drm_xe_vm_bind_op bind;
@@ -817,12 +820,12 @@ struct drm_xe_vm_bind { · 5 unmodified lines
817820 __u64 vector_of_binds;
818821 };
819822
823+ /** @pad: MBZ */
824+ __u32 pad2;
825+
820826 /** @num_syncs: amount of syncs to wait on */
821827 __u32 num_syncs;
822828
823− /** @pad2: MBZ */
824− __u32 pad2;
825−
826829 /** @syncs: pointer to struct drm_xe_sync array */
827830 __u64 syncs;
828831

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