diff --git a/src/intel/decoder/intel_batch_decoder.c b/src/intel/decoder/intel_batch_decoder.c index 4754a926f7a..d62dbf57034 100644 --- a/src/intel/decoder/intel_batch_decoder.c +++ b/src/intel/decoder/intel_batch_decoder.c @@ -23,6 +23,7 @@ #include "intel_decoder.h" #include "intel_decoder_private.h" +#include "intel/common/intel_gem.h" #include "util/macros.h" #include "util/u_debug.h" @@ -134,7 +135,7 @@ ctx_get_bo(struct intel_batch_decode_ctx *ctx, bool ppgtt, uint64_t addr) * bits. In order to correctly handle those aub dumps, we need to mask * off the top 16 bits. */ - addr &= (~0ull >> 16); + addr = intel_48b_address(addr); } struct intel_batch_decode_bo bo = ctx->get_bo(ctx->user_data, ppgtt, addr); diff --git a/src/intel/tools/aubinator_error_decode_xe.c b/src/intel/tools/aubinator_error_decode_xe.c index 44a3b4c7aa0..33c3c956e34 100644 --- a/src/intel/tools/aubinator_error_decode_xe.c +++ b/src/intel/tools/aubinator_error_decode_xe.c @@ -13,6 +13,7 @@ #include "error_decode_lib.h" #include "error_decode_xe_lib.h" #include "intel/compiler/brw_isa_info.h" +#include "intel/common/intel_gem.h" #include "intel/dev/intel_device_info.h" static struct intel_batch_decode_bo @@ -213,7 +214,7 @@ read_xe_data_file(FILE *file, if (error_decode_xe_read_u64_hexacimal_parameter(line, "batch_addr[", &u64_value)) { batch_buffers.addrs = realloc(batch_buffers.addrs, sizeof(uint64_t) * (batch_buffers.len + 1)); - batch_buffers.addrs[batch_buffers.len] = u64_value; + batch_buffers.addrs[batch_buffers.len] = intel_48b_address(u64_value); batch_buffers.len++; } diff --git a/src/intel/tools/error2hangdump_xe.c b/src/intel/tools/error2hangdump_xe.c index e3e3886e832..ad46644df0e 100644 --- a/src/intel/tools/error2hangdump_xe.c +++ b/src/intel/tools/error2hangdump_xe.c @@ -12,6 +12,7 @@ #include "error_decode_xe_lib.h" #include "error2hangdump_lib.h" +#include "intel/common/intel_gem.h" #include "intel/dev/intel_device_info.h" #include "util/macros.h" @@ -42,7 +43,7 @@ read_xe_data_file(FILE *dump_file, FILE *hang_dump_file, bool verbose) if (error_decode_xe_read_u64_hexacimal_parameter(line, "batch_addr[", &u64_value)) { batch_buffers.addrs = realloc(batch_buffers.addrs, sizeof(uint64_t) * (batch_buffers.len + 1)); - batch_buffers.addrs[batch_buffers.len] = u64_value; + batch_buffers.addrs[batch_buffers.len] = intel_48b_address(u64_value); batch_buffers.len++; } diff --git a/src/intel/tools/error_decode_xe_lib.c b/src/intel/tools/error_decode_xe_lib.c index b7dd782e306..c0d840e6f56 100644 --- a/src/intel/tools/error_decode_xe_lib.c +++ b/src/intel/tools/error_decode_xe_lib.c @@ -9,6 +9,7 @@ #include #include "error_decode_lib.h" +#include "intel/common/intel_gem.h" #include "util/macros.h" static const char * @@ -210,7 +211,12 @@ static void xe_vm_entry_set(struct xe_vm_entry *entry, const uint64_t address, const uint32_t length, const uint32_t *data) { - entry->address = address; + /* Newer versions of Xe KMD will give us the canonical VMA address while + * older will give us 48b address. + * intel_batch_decoder.c convert addresses to 48b address before calling + * get_bo() so here converting all VMA addresses to 48b. + */ + entry->address = intel_48b_address(address); entry->length = length; entry->data = data; }