The code can check for vm faults having happened. If we only do it
on a hang we don't know when the faults happened. This changes the
behavior to when the first VM faults is found, even without a hang.
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
struct radv_device *device = queue->device;
uint64_t addr;
struct radv_device *device = queue->device;
uint64_t addr;
- if (!radv_gpu_hang_occured(queue))
+ bool hang_occurred = radv_gpu_hang_occured(queue);
+ bool vm_fault_occurred = false;
+ if (queue->device->instance->debug_flags & RADV_DEBUG_VM_FAULTS)
+ vm_fault_occurred = ac_vm_fault_occured(device->physical_device->rad_info.chip_class,
+ &device->dmesg_timestamp, &addr);
+ if (!hang_occurred && !vm_fault_occurred)
- if (ac_vm_fault_occured(device->physical_device->rad_info.chip_class,
- &device->dmesg_timestamp, &addr)) {
+ if (vm_fault_occurred) {
fprintf(stderr, "VM fault report.\n\n");
fprintf(stderr, "Failing VM page: 0x%08"PRIx64"\n\n", addr);
}
fprintf(stderr, "VM fault report.\n\n");
fprintf(stderr, "Failing VM page: 0x%08"PRIx64"\n\n", addr);
}
RADV_DEBUG_ALL_BOS = 0x100,
RADV_DEBUG_NO_IBS = 0x200,
RADV_DEBUG_DUMP_SPIRV = 0x400,
RADV_DEBUG_ALL_BOS = 0x100,
RADV_DEBUG_NO_IBS = 0x200,
RADV_DEBUG_DUMP_SPIRV = 0x400,
+ RADV_DEBUG_VM_FAULTS = 0x800,
{"allbos", RADV_DEBUG_ALL_BOS},
{"noibs", RADV_DEBUG_NO_IBS},
{"spirv", RADV_DEBUG_DUMP_SPIRV},
{"allbos", RADV_DEBUG_ALL_BOS},
{"noibs", RADV_DEBUG_NO_IBS},
{"spirv", RADV_DEBUG_DUMP_SPIRV},
+ {"vmfaults", RADV_DEBUG_VM_FAULTS},