FreeBSDDesktop / kms-drm

the DRM part of the linuxkpi-based KMS
63 stars 26 forks source link

vce_v1_0_load_fw (radeon) needs explicit_bzero() for powerpc64 #161

Closed chmeeedalf closed 5 years ago

chmeeedalf commented 5 years ago

https://github.com/FreeBSDDesktop/kms-drm/blob/9dc2a2b5ab5693d401d2f1694f944c36f6a3b41c/drivers/gpu/drm/radeon/vce_v1_0.c#L196

The line referenced breaks on POWER9 with an alignment exception, built with gcc8. GCC ends up writing to &data[5] with a uint64_t (gotta love the memset optimization), but data[5] is at a misaligned offset (word aligned, not double-word aligned). This triggers a kernel panic. Replacing it with explicit_bzero() makes it work, and the module loads successfully on my Talos with a Radeon R7-240.