hk: fill sparse.write with nonzero values

fuzz for bugs.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34585>
This commit is contained in:
Alyssa Rosenzweig 2025-04-15 10:53:19 -04:00 committed by Marge Bot
parent ffac153bcf
commit e5006dc6ae

View file

@ -65,6 +65,11 @@ hk_upload_rodata(struct hk_device *dev)
if (!dev->rodata.bo || !dev->sparse.write)
return VK_ERROR_OUT_OF_HOST_MEMORY;
/* The contents of sparse.write are undefined, but making them nonzero helps
* fuzz for bugs where we incorrectly read from the write section.
*/
memset(agx_bo_map(dev->sparse.write), 0xCA, AIL_PAGESIZE);
uint8_t *map = agx_bo_map(dev->rodata.bo);
uint32_t offs = 0;