Commit 89733d9c authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜

Misc attempts at pinning down this address bug

parent 0c3a3bb4
...@@ -324,7 +324,7 @@ panwrap_replay_sfbd(uint64_t gpu_va, int job_no) ...@@ -324,7 +324,7 @@ panwrap_replay_sfbd(uint64_t gpu_va, int job_no)
panwrap_prop("unknown8 = 0x%" PRIx32, s->unknown8); panwrap_prop("unknown8 = 0x%" PRIx32, s->unknown8);
panwrap_prop("unknown9 = 0x%" PRIx32, s->unknown9); panwrap_prop("unknown9 = 0x%" PRIx32, s->unknown9);
panwrap_prop("tiler_jc_list = 0x%" PRIx64, s->tiler_jc_list); MEMORY_PROP(s, tiler_jc_list);
MEMORY_PROP(s, unknown_address_4); MEMORY_PROP(s, unknown_address_4);
......
...@@ -158,6 +158,8 @@ void panwrap_track_allocation(mali_ptr addr, int flags, int number, size_t lengt ...@@ -158,6 +158,8 @@ void panwrap_track_allocation(mali_ptr addr, int flags, int number, size_t lengt
mem->allocation_number = number; mem->allocation_number = number;
mem->length = length; mem->length = length;
panwrap_msg("%llx\n", addr);
list_add(&mem->node, &allocations); list_add(&mem->node, &allocations);
/* XXX: Hacky workaround for cz's board */ /* XXX: Hacky workaround for cz's board */
......
...@@ -46,6 +46,9 @@ struct panwrap_mapped_memory { ...@@ -46,6 +46,9 @@ struct panwrap_mapped_memory {
struct list node; struct list node;
}; };
/* Set this if you don't want your life to be hell while debugging */
#define DISABLE_CPU_CACHING 1
#define TOUCH_MEMSET(mem, addr, sz, offset) \ #define TOUCH_MEMSET(mem, addr, sz, offset) \
memset(mem->touched + ((addr - mem->gpu_va) / sizeof(uint32_t)), 1, (sz - offset) / sizeof(uint32_t)); \ memset(mem->touched + ((addr - mem->gpu_va) / sizeof(uint32_t)), 1, (sz - offset) / sizeof(uint32_t)); \
panwrap_log("\n"); panwrap_log("\n");
......
...@@ -1017,8 +1017,8 @@ int ioctl(int fd, int request, ...) ...@@ -1017,8 +1017,8 @@ int ioctl(int fd, int request, ...)
if (IOCTL_CASE(request) == IOCTL_CASE(MALI_IOCTL_DEBUGFS_MEM_PROFILE_ADD)) if (IOCTL_CASE(request) == IOCTL_CASE(MALI_IOCTL_DEBUGFS_MEM_PROFILE_ADD))
ignore = true; ignore = true;
/* Syncs -are-, but we disable caching */ /* Syncs -are-, but we sometimes disable caching */
#if 0 #ifdef DISABLE_CPU_CACHING
if (IOCTL_CASE(request) == IOCTL_CASE(MALI_IOCTL_SYNC)) if (IOCTL_CASE(request) == IOCTL_CASE(MALI_IOCTL_SYNC))
ignore = true; ignore = true;
#endif #endif
...@@ -1047,12 +1047,18 @@ int ioctl(int fd, int request, ...) ...@@ -1047,12 +1047,18 @@ int ioctl(int fd, int request, ...)
panwrap_log("u64 alloc_gpu_va_%d;\n", number); panwrap_log("u64 alloc_gpu_va_%d;\n", number);
int flags = args->flags;
#ifdef DISABLE_CPU_CACHING
flags &= ~MALI_MEM_CACHED_CPU;
#endif
if (args->va_pages == args->commit_pages && !args->extent) if (args->va_pages == args->commit_pages && !args->extent)
panwrap_log("pandev_standard_allocate(fd, %" PRId64 ", ", args->va_pages); panwrap_log("pandev_standard_allocate(fd, %" PRId64 ", ", args->va_pages);
else else
panwrap_log("pandev_general_allocate(fd, %" PRId64 ", %" PRId64", %" PRId64 ", ", args->va_pages, args->commit_pages, args->extent); panwrap_log("pandev_general_allocate(fd, %" PRId64 ", %" PRId64", %" PRId64 ", ", args->va_pages, args->commit_pages, args->extent);
panwrap_log_decoded_flags(mem_flag_info, args->flags); panwrap_log_decoded_flags(mem_flag_info, flags);
panwrap_log_cont(", &alloc_gpu_va_%d);\n", number); panwrap_log_cont(", &alloc_gpu_va_%d);\n", number);
ignore = true; ignore = true;
...@@ -1081,6 +1087,7 @@ int ioctl(int fd, int request, ...) ...@@ -1081,6 +1087,7 @@ int ioctl(int fd, int request, ...)
} }
/* Replay synced memory if that's an issue */ /* Replay synced memory if that's an issue */
#ifndef DISABLE_CPU_CACHING
if (IOCTL_CASE(request) == IOCTL_CASE(MALI_IOCTL_SYNC)) { if (IOCTL_CASE(request) == IOCTL_CASE(MALI_IOCTL_SYNC)) {
const struct mali_ioctl_sync *args = ptr; const struct mali_ioctl_sync *args = ptr;
...@@ -1093,6 +1100,7 @@ int ioctl(int fd, int request, ...) ...@@ -1093,6 +1100,7 @@ int ioctl(int fd, int request, ...)
panwrap_msg("Bad synced memory\n"); panwrap_msg("Bad synced memory\n");
} }
} }
#endif
/* Call the actual ioctl */ /* Call the actual ioctl */
if (!ignore) { if (!ignore) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment