From patchwork Wed Mar 25 13:42:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 6090971 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 4656ABF910 for ; Wed, 25 Mar 2015 13:42:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6762320357 for ; Wed, 25 Mar 2015 13:42:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 75E632034C for ; Wed, 25 Mar 2015 13:42:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C6033720EB; Wed, 25 Mar 2015 06:42:22 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id BCB686E858 for ; Wed, 25 Mar 2015 06:42:20 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP; 25 Mar 2015 06:42:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,465,1422950400"; d="scan'208";a="670392722" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.58]) by orsmga001.jf.intel.com with ESMTP; 25 Mar 2015 06:42:12 -0700 Received: by rosetta (Postfix, from userid 1000) id 03A0680085; Wed, 25 Mar 2015 15:42:14 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Wed, 25 Mar 2015 15:42:12 +0200 Message-Id: <1427290932-5156-3-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427290932-5156-1-git-send-email-mika.kuoppala@intel.com> References: <1427290932-5156-1-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH 3/3] tools/intel_error_decode: Add gen8+ fault data encodings X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These two registers contains the 48bit fault address. Signed-off-by: Mika Kuoppala Reviewed-by: Michel Thierry --- 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 553307f..7c32fc3 100644 --- a/tools/intel_error_decode.c +++ b/tools/intel_error_decode.c @@ -401,6 +401,19 @@ print_fault_reg(unsigned devid, uint32_t reg) printf(" Address 0x%08x\n", reg & ~((1 << 12)-1)); } +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; @@ -482,7 +495,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, @@ -545,6 +558,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; }