From patchwork Wed Mar 25 16:13:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kuoppala X-Patchwork-Id: 6093531 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9E4909F667 for ; Wed, 25 Mar 2015 16:13:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0B672035E for ; Wed, 25 Mar 2015 16:13:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id F1E1520357 for ; Wed, 25 Mar 2015 16:13:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E56F6E8C0; Wed, 25 Mar 2015 09:13:47 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 966436E8C0 for ; Wed, 25 Mar 2015 09:13:45 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP; 25 Mar 2015 09:13:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,465,1422950400"; d="scan'208";a="704051120" Received: from rosetta.fi.intel.com (HELO rosetta) ([10.237.72.58]) by orsmga002.jf.intel.com with ESMTP; 25 Mar 2015 09:13:46 -0700 Received: by rosetta (Postfix, from userid 1000) id CD76080057; Wed, 25 Mar 2015 18:13:46 +0200 (EET) From: Mika Kuoppala To: intel-gfx@lists.freedesktop.org Date: Wed, 25 Mar 2015 18:13:45 +0200 Message-Id: <1427300025-27007-1-git-send-email-mika.kuoppala@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427290932-5156-2-git-send-email-mika.kuoppala@intel.com> References: <1427290932-5156-2-git-send-email-mika.kuoppala@intel.com> Subject: [Intel-gfx] [PATCH 2/3] tools/intel_error_decode: Add decodings for FAULT_REG 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 Add decodings for FAULT_REG v2: fix fault encodings and ignore addr type for gen8+ (Michel) fix engine mask Signed-off-by: Mika Kuoppala Reviewed-by: Michel Thierry --- tools/intel_error_decode.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c index fb4a2a4..5fccefa 100644 --- a/tools/intel_error_decode.c +++ b/tools/intel_error_decode.c @@ -380,6 +380,44 @@ print_fence(unsigned int devid, uint64_t fence) } } +static void +print_fault_reg(unsigned devid, uint32_t reg) +{ + const char *gen7_types[] = { "Page", + "Invalid PD", + "Unloaded PD", + "Invalid and Unloaded PD" }; + + const char *gen8_types[] = { "PTE", + "PDE", + "PDPE", + "PML4E" }; + + const char *engine[] = { "GFX", "MFX0", "MFX1", "VEBX", + "BLT", "Unknown", "Unknown", "Unknown" }; + + if (intel_gen(devid) < 7) + return; + + if (reg & (1 << 0)) + printf(" Valid\n"); + else + return; + + if (intel_gen(devid) < 8) + printf(" %s Fault (%s)\n", gen7_types[reg >> 1 & 0x3], + reg & (1 << 11) ? "GGTT" : "PPGTT"); + else + printf(" Invalid %s Fault\n", gen8_types[reg >> 1 & 0x3]); + + if (intel_gen(devid) < 8) + printf(" Address 0x%08x\n", reg & ~((1 << 12)-1)); + else + printf(" Engine %s\n", engine[reg >> 12 & 0x7]); + + printf(" Source ID %d\n", reg >> 3 & 0xff); +} + #define MAX_RINGS 10 /* I really hope this never... */ uint32_t head[MAX_RINGS]; int head_ndx = 0; @@ -520,6 +558,10 @@ read_data_file(FILE *file) if (matched == 2) print_fence(devid, fence); + matched = sscanf(line, " FAULT_REG: 0x%08x\n", ®); + if (matched == 1 && reg) + print_fault_reg(devid, reg); + continue; }