From patchwork Wed Jan 17 12:08:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 862243 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 3zM5kg14VBz9sNV for ; Wed, 17 Jan 2018 23:19:55 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZJeTXwAB"; 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 3zM5kf5JvfzF0Sq for ; Wed, 17 Jan 2018 23:19:54 +1100 (AEDT) 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="ZJeTXwAB"; dkim-atps=neutral X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::243; helo=mail-pl0-x243.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZJeTXwAB"; dkim-atps=neutral Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (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 3zM5Tw5tFgzDr0S; Wed, 17 Jan 2018 23:08:52 +1100 (AEDT) Received: by mail-pl0-x243.google.com with SMTP id 66so8677068plc.13; Wed, 17 Jan 2018 04:08:52 -0800 (PST) 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=UIjJL927v3YFBczbuxZin7LcSR6Bx7AZpO5BcwHAnzw=; b=ZJeTXwABp/e+NBl20QrLmV+TGqV5Gs55kXvO6Scdx3ZUbT+XzGYU2wsq1idbMkEMlQ qPsY5FDBIvjryaRJIRLKjuCYI54O4Jw4s/Vc8Em/VNOZJLDgIKF1/vmUSRgBF8Dzyn+p MZWyfw+/5h6NqaJ3iup7yZD4ScMjhg50OiBC7dopGaXBg6iivaKRc21K+Yyw5pHUII7L RxVsluQEZNAc7I8rUWMRVCpb+YClASjQm/65Z/6KkeFvNDC6jxbEVnMHkiSo59qSTQ3h 4ZA+kuYdo72ibiGp/rBPQTxRinuMoB2BudX/wCWPoJ8VB12Mhlq90VgBC/Ov6wwmlJmv XEOg== 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=UIjJL927v3YFBczbuxZin7LcSR6Bx7AZpO5BcwHAnzw=; b=h64y37zV+9Re1SyiSuX39N7uIVjv1X4NjYeNgUZjmdnRdSwQZlIh9LxtbMa+rhEqNd xK2KoT1/fM/VvVWxQ9bAMQNcbEzWSa26CezcWSbZzlfEgqdYcaa86clEYChWltd2UWeF PElVnlCRW+B6O+sNV5+9Yppau62wJ92wJlhviMp/ss76ldrINVXjrBgFF7C0ciSfvKr8 qDNYvFHSQ9GHcQpT8rmZqQ9zD9kpRyHhBn88ehhSYtsXoFvl75J0/rQYRO6ntJ/Xy9Jo 0xvUxLWyWGGtquhqxrpLrRXrvZzkar99/BRG9g8lFbQf7WR5euvFI+3xDoILJlGlZpOL iJUA== X-Gm-Message-State: AKGB3mL2pivb4qpfkKeBcmYZTX74mxfXfbgFoO79iK22EDHOvvWlkiMG SMD0FqD3e0Cxz4tGcsSaTIppvA== X-Google-Smtp-Source: ACJfBosZqlzRIUui6Uti6Em6vUDaOYmMQoUZYTtT/fB/v36w+pminExwO28A+gVUZ2aRVAk0rr0JCg== X-Received: by 10.159.246.135 with SMTP id c7mr35405741pls.138.1516190930341; Wed, 17 Jan 2018 04:08:50 -0800 (PST) Received: from roar.au.ibm.com ([203.63.188.198]) by smtp.gmail.com with ESMTPSA id r14sm8501454pfa.136.2018.01.17.04.08.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jan 2018 04:08:49 -0800 (PST) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org, skiboot@lists.ozlabs.org Date: Wed, 17 Jan 2018 22:08:31 +1000 Message-Id: <20180117120831.22533-2-npiggin@gmail.com> X-Mailer: git-send-email 2.15.1 In-Reply-To: <20180117120831.22533-1-npiggin@gmail.com> References: <20180117120831.22533-1-npiggin@gmail.com> Subject: [Skiboot] [PATCH][RFC] opal: allow some opal calls to re-enter OPAL in case we take a NMI X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.24 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" I'm not sure if I like this, as said in the other mail. Seems a bit arbitrary. I wouldn't mind making a single special opal call, OPAL_MAYDAY, which is allowed through the reentrancy check, stops all other CPUs, prints some opal backtraces, then allows the remaining CPU to issue more OPAL calls, so we can print the Linux console out, reboot, etc. That would require kernel change, so maybe we can do something like this for older kernels. --- core/opal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/opal.c b/core/opal.c index fd69359c4..d0dd5b3b3 100644 --- a/core/opal.c +++ b/core/opal.c @@ -145,7 +145,8 @@ int64_t opal_entry_check(struct stack_frame *eframe) if (!opal_quiesce_state && cpu->in_opal_call) { printf("CPU ATTEMPT TO RE-ENTER FIRMWARE! PIR=%04lx cpu @%p -> pir=%04x token=%llu\n", mfspr(SPR_PIR), cpu, cpu->pir, token); - if (token != OPAL_CEC_REBOOT && + if (token != OPAL_QUIESCE && + token != OPAL_CEC_REBOOT && token != OPAL_CEC_POWER_DOWN && token != OPAL_CEC_REBOOT2 && token != OPAL_SIGNAL_SYSTEM_RESET)