History

drm/panthor: Add missing explicit padding in drm_panthor_gpu_info

drm_panthor_gpu_info::shader_present is currently automatically offset by 4 byte to meet Arm's 32-bit/64-bit field alignment rules, but those constraints don't stand on 32-bit x86 and cause a mismatch when running an x86 binary in a user emulated environment like FEX. It's also generally agreed that uAPIs should explicitly pad their struct fields, which we originally intended to do, but a mistake slipped through during the submission process, leading drm_panthor_gpu_info::shader_present to be misaligned. This uAPI change doesn't break any of the existing users of panthor which are either arm32 or arm64 where the 64-bit alignment of u64 fields is already enforced a the compiler level. Changes in v2: - Rename the garbage field into pad0 and adjust the comment accordingly - Add Liviu's A-b Changes in v3: - Add R-bs

Boris Brezillon committed 1 year ago

Commit 95cbab41 parent 3671f371 file · +3 −0Browse files

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

Unified · Split

include/uapi/drm/panthor_drm.h+3−0
@@ -296,6 +296,9 @@ struct drm_panthor_gpu_info { · 295 unmodified lines
296296 /** @as_present: Bitmask encoding the number of address-space exposed by the MMU. */
297297 __u32 as_present;
298298
299+ /** @pad0: MBZ. */
300+ __u32 pad0;
301+
299302 /** @shader_present: Bitmask encoding the shader cores exposed by the GPU. */
300303 __u64 shader_present;
301304

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