From patchwork Thu Jul 26 02:18:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver O'Halloran X-Patchwork-Id: 949422 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41bbPx6PHPz9ryl for ; Thu, 26 Jul 2018 12:19:17 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YSoFJ7sH"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 41bbPx4x1kzF0hg for ; Thu, 26 Jul 2018 12:19:17 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YSoFJ7sH"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="YSoFJ7sH"; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 41bbPT2XzBzF0PZ for ; Thu, 26 Jul 2018 12:18:53 +1000 (AEST) Received: by mail-pg1-x541.google.com with SMTP id r5-v6so132982pgv.0 for ; Wed, 25 Jul 2018 19:18:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Bz2MFYY3gbxy7HMlsrPidgozaMLwK17VmK6Vj+luHxQ=; b=YSoFJ7sHz2r3jZn8vGA/7tw4+KwAiRbrTc2VzXbjTZiOpmfzk8s4/BhP1TT4lI5NYK 8TAfsggQP+CsTrHC9bnN1iAqPyj+znjlnOxpplgbq5vSmN0C4L0x8uzabIppabhWQHDx nT05eSh75dLl10FG1nD/OLaUXEfxbB8UtpjvL26MK6sCNjuLnUaw+0BeKlN4LF/KRU7o OWZLH2vP/aRdd/RdFoHfqNXrEdBmoz2gF8TjagyYMkBxxztplLMxfPTfxFy+aqD3cO9o AhUPJqI8TZn6wkiUYfb1NFdwIGJy/lIedHIjEtyQeSb0CI63tErXVfZMJqYTg7JXVwMH o2Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Bz2MFYY3gbxy7HMlsrPidgozaMLwK17VmK6Vj+luHxQ=; b=s9wL7W8XgcdclG4TuXOe5qJdvac+8EOdcXvgSg7WIKlIEmpuKqItYNB2607Ejqbfpn QGgb/Nw8cYEkqmrL8RM0wM1Vzf6LNDhCBJBnPdoXE71vSfRf6wfbcxh1z8cnrNV6AQ+p dUc+VmY0Ua9NtvQwM6K/jGBt6+E+tfeuyRakulxAXfxetkDCvoeWrt6xZYv/dVZFlMku lKSlnsUbxrnQMH+qRVES6+31r/mrlFVFCJJeIE/Mw8RFRHBPNCaJckrE+QeKX0aQXMmo z0FImT0m9WE5roPFSyIyS94ZwcOipaQaeKmToXycWoZjiyYAHg8rYGAN9bHTR36jhHel Z4ZQ== X-Gm-Message-State: AOUpUlGUPjMI/+Ja1QDwEsrq9ua84aYyfx/TUKcOH+HC8G4lkHGlboXI fturYcTcaLcelxL//DFBfyNqWgo3 X-Google-Smtp-Source: AAOMgpep2YjMWjbORk/NWjVuBJptzLQM1Gpi4Vjpa9HsK6ca5EvgRPBwkVPCt5C6mJlEiBfKncSpXg== X-Received: by 2002:a63:cf10:: with SMTP id j16-v6mr76076pgg.238.1532571530970; Wed, 25 Jul 2018 19:18:50 -0700 (PDT) Received: from flat-canetoad.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id l85-v6sm110914pfk.34.2018.07.25.19.18.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Jul 2018 19:18:50 -0700 (PDT) From: Oliver O'Halloran To: skiboot@lists.ozlabs.org Date: Thu, 26 Jul 2018 12:18:37 +1000 Message-Id: <20180726021838.20999-2-oohall@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20180726021838.20999-1-oohall@gmail.com> References: <20180726021838.20999-1-oohall@gmail.com> Subject: [Skiboot] [PATCH 2/3] hw/phb4: Add a helper to dump the PELT-V X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" The "Partitionable Endpoint Lookup Table (Vector)" is used by the PHB when processing EEH events. The PELT-V defines which PEs should be additionally frozen in the event of an error being flagged on a given PE. Knowing the state of the PELT-V is sometimes useful for debugging PHB issues so this patch adds a helper to dump it. Signed-off-by: Oliver O'Halloran --- hw/phb4.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/hw/phb4.c b/hw/phb4.c index ff0f3f5ad5b2..965f3b5af8af 100644 --- a/hw/phb4.c +++ b/hw/phb4.c @@ -1942,6 +1942,46 @@ static void phb4_read_phb_status(struct phb4 *p, } } +static void __unused phb4_dump_peltv(struct phb4 *p) +{ + int stride = p->max_num_pes / 64; + uint64_t *tbl = (void *) p->tbl_peltv; + unsigned int pe; + + PHBERR(p, "PELT-V: base addr: %p size: %llx (%d PEs, stride = %d)\n", + tbl, p->tbl_peltv_size, p->max_num_pes, stride); + + for (pe = 0; pe < p->max_num_pes; pe++) { + unsigned int i, j; + uint64_t sum = 0; + + i = pe * stride; + + /* + * Only print an entry if there's bits set in the PE's + * PELT-V entry. There's a few hundred possible PEs and + * generally only a handful will be in use. + */ + + for (j = 0; j < stride; j++) + sum |= tbl[i + j]; + if (!sum) + continue; /* unused PE, skip it */ + + if (p->max_num_pes == 512) { + PHBERR(p, "PELT-V[%03x] = " + "%016llx %016llx %016llx %016llx" + "%016llx %016llx %016llx %016llx\n", pe, + tbl[i + 0], tbl[i + 1], tbl[i + 2], tbl[i + 3], + tbl[i + 4], tbl[i + 5], tbl[i + 6], tbl[i + 7]); + } else if (p->max_num_pes == 256) { + PHBERR(p, "PELT-V[%03x] = " + "%016llx %016llx %016llx %016llx\n", pe, + tbl[i + 0], tbl[i + 1], tbl[i + 2], tbl[i + 3]); + } + } +} + static void phb4_eeh_dump_regs(struct phb4 *p) { struct OpalIoPhb4ErrorData *s;