From 559987fc01f16f010681fedff69ffe8fb2231d50 Mon Sep 17 00:00:00 2001 From: Mika Kuoppala Date: Tue, 24 Mar 2015 13:03:26 +0200 Subject: [PATCH] tools/intel_error_decode: Add gen8+ fault data encodings These two registers contains the 48bit fault address. Reviewed-by: Michel Thierry Signed-off-by: Mika Kuoppala --- tools/intel_error_decode.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c index 5fccefa9..c7102127 100644 --- a/tools/intel_error_decode.c +++ b/tools/intel_error_decode.c @@ -418,6 +418,19 @@ print_fault_reg(unsigned devid, uint32_t reg) printf(" Source ID %d\n", reg >> 3 & 0xff); } +static void +print_fault_data(unsigned devid, uint32_t data1, uint32_t data0) +{ + uint64_t address; + + if (intel_gen(devid) < 8) + return; + + address = ((uint64_t)(data0) << 12) | ((uint64_t)data1 & 0xf) << 44; + printf(" Address 0x%016" PRIx64 " %s\n", address, + data1 & (1 << 4) ? "GGTT" : "PPGTT"); +} + #define MAX_RINGS 10 /* I really hope this never... */ uint32_t head[MAX_RINGS]; int head_ndx = 0; @@ -499,7 +512,7 @@ read_data_file(FILE *file) matched = sscanf(line, "%08x : %08x", &offset, &value); if (matched != 2) { - unsigned int reg; + unsigned int reg, reg2; /* display reg section is after the ringbuffers, don't mix them */ decode(decode_ctx, is_batch, ring_name, gtt_offset, @@ -562,6 +575,10 @@ read_data_file(FILE *file) if (matched == 1 && reg) print_fault_reg(devid, reg); + matched = sscanf(line, " FAULT_TLB_DATA: 0x%08x 0x%08x\n", ®, ®2); + if (matched == 2) + print_fault_data(devid, reg, reg2); + continue; }