From patchwork Fri Feb 8 08:31:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Artem Senichev X-Patchwork-Id: 1038525 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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43wpPx0vZkz9sN8 for ; Fri, 8 Feb 2019 19:34:29 +1100 (AEDT) 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="R6Px5AvN"; 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 43wpPw6D2LzDqV9 for ; Fri, 8 Feb 2019 19:34:28 +1100 (AEDT) X-Original-To: pdbg@lists.ozlabs.org Delivered-To: pdbg@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::244; helo=mail-lj1-x244.google.com; envelope-from=artemsen@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="R6Px5AvN"; dkim-atps=neutral Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 43wpPn3WqxzDqTw for ; Fri, 8 Feb 2019 19:34:21 +1100 (AEDT) Received: by mail-lj1-x244.google.com with SMTP id c19-v6so2264246lja.5 for ; Fri, 08 Feb 2019 00:34:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=tI+4miwKa4SVpBmzigORcTvr+sa51pNXre2CeOtzog8=; b=R6Px5AvNShG4AU+Ts++PVyDMRZX6BNRdadS6EwuVV00RsZxKcn7DjNGTsX9FuufWvO WLAO6SMuPzuvbjJApCCRKA99Jhik4QXsTE8W6MUdhivk9hDsueImvkPEYBDiL6FRPujE CQqR0UZtlsD9M0R6BB8aCqAiQs5j3z1hpbkXu9VVxnEF0Sj7WQomckQ+WbjbBs+jAfK8 wNB8laArKI9Y2y2SSkO983SzR2tPyYmCAZTnkE6gwtIgCwMEmkoL7LxOTOgTgpLunQ+R uCm4FgSnY1OFLnhPa/QcMUwh+MUamO7pmjg24et5DHbqkowBvGi6VyvKgYSMKATg4Z4g IAYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=tI+4miwKa4SVpBmzigORcTvr+sa51pNXre2CeOtzog8=; b=l2u68zLbujJLHz97Gn6OZ2Zp3V2xk88gY9LAxPHiZlCdbEnK105h0Vk3Gn2t6v2g4n jMEHcoA+WFalTDa9x+J+DWyACgCGCvRV8ckFdVjCPGAgjCu0WVL/OIqx9ZP5uoNQyyD4 /tzhmAd0QM9qe4yVaOlq6faUh/0QI1q39SHGOIMyYbfuiYR2ApqTg8eWxFg9U3N83bfw uIia+2OpeCOdoGSlnx1E7nKJvopH4/f/YwTn3ZfplgS0AtoFYuRXNSnY3qHhSSHjIfp/ 9sWEEyvssjYB3PfZtRMGgObrzOh0MZv2HGzhzh9VknSqcNPWm5wZ4ZeGOUiZLZGYsZqe 7/dw== X-Gm-Message-State: AHQUAuYBLfzUjVajwGGM44ALodxy3v3o9ZgZ2rR8An9Gu1/waAgBq+sq /VKVaaAzAdA5W8ke+PBrSXDIOBpIs+Q= X-Google-Smtp-Source: AHgI3IbOhR2gRS6nYJqlph+5cKHuTC9dkLijtlQwFudB72pl6b6QA+2zyMEpkfvtb8oDaeaxkwUVuA== X-Received: by 2002:a2e:9bd5:: with SMTP id w21-v6mr1039484ljj.76.1549614857506; Fri, 08 Feb 2019 00:34:17 -0800 (PST) Received: from gmail.com ([89.207.88.249]) by smtp.gmail.com with ESMTPSA id p11sm253461lfc.72.2019.02.08.00.34.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 08 Feb 2019 00:34:16 -0800 (PST) From: Artem Senichev X-Google-Original-From: Artem Senichev Date: Fri, 8 Feb 2019 11:31:58 +0300 To: pdbg@lists.ozlabs.org Message-ID: <20190208083158.zfyy45lrdhco4bpn@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180716 Subject: [Pdbg] [PATCH v2] p8chip: Enable SRESET for P8 X-BeenThere: pdbg@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "mailing list for https://github.com/open-power/pdbg development" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin Errors-To: pdbg-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Pdbg" Add possibility to use NMI SRESET signal to initiate memory dumping with kdump. Despite broken implementation of SRESET handler in OPAL it's possible to use this signal in case of crash of the host OS. https://lists.ozlabs.org/pipermail/openpower-firmware/2018-April/000220.html Signed-off-by: Artem Senichev Acked-by: Nicholas Piggin --- libpdbg/p8chip.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libpdbg/p8chip.c b/libpdbg/p8chip.c index 914c335..6ddec3e 100644 --- a/libpdbg/p8chip.c +++ b/libpdbg/p8chip.c @@ -29,6 +29,7 @@ #define RAS_STATUS_TIMEOUT 100 #define DIRECT_CONTROLS_REG 0x0 +#define DIRECT_CONTROL_SP_SRESET PPC_BIT(60) #define DIRECT_CONTROL_SP_STEP PPC_BIT(61) #define DIRECT_CONTROL_SP_START PPC_BIT(62) #define DIRECT_CONTROL_SP_STOP PPC_BIT(63) @@ -339,8 +340,13 @@ static int p8_thread_start(struct thread *thread) static int p8_thread_sreset(struct thread *thread) { - /* Broken on p8 */ - return 1; + /* In some cases SRR1 register may end up being incorrect. + * This means we can not return from the interrupt and continue, but we + * should be able to go on to take a crash dump and restart the machine. */ + PR_WARNING("SRESET handler has limited implementation on POWER8 platforms\n"); + + CHECK_ERR(pib_write(&thread->target, DIRECT_CONTROLS_REG, DIRECT_CONTROL_SP_SRESET)); + return 0; } static int p8_ram_setup(struct thread *thread)