From patchwork Sat Dec 23 16:49:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 852671 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@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 3z3s282d0kz9s7B for ; Sun, 24 Dec 2017 03:55:28 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jvhjpgBB"; 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 3z3s280xvvzDrVf for ; Sun, 24 Dec 2017 03:55:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="jvhjpgBB"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c01::241; helo=mail-pl0-x241.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="jvhjpgBB"; dkim-atps=neutral Received: from mail-pl0-x241.google.com (mail-pl0-x241.google.com [IPv6:2607:f8b0:400e:c01::241]) (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 3z3rvW59ntzDsQM for ; Sun, 24 Dec 2017 03:49:43 +1100 (AEDT) Received: by mail-pl0-x241.google.com with SMTP id 62so13144614pld.7 for ; Sat, 23 Dec 2017 08:49:43 -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=+fppOA+6vv/Ufwv852E6JFYqisUjk+OhGthkkLSbrSA=; b=jvhjpgBB6TX+t/cL/HGonXNsnYqpvT4LCRNQiuNhPehdxc9FCsbV7BTiTe2Gw0jW4s pFHapCes7FrLGt0Lvwk0CBdjLGhmobfKa8gxfY11Xpp9GJLRYRFGnBPO5RNztk/nWx2c XlcISYcQAOUAfoL5/dKO7GxgMNNx5gKUfVyog36u/o2VxIZoOFapZpmdMVURl0D+sOiG iRRG5dm0JYEzQLMOdAsVLGMAomSeWpiQo09SupdD7tcDpPOm8BeGttrIOT051uHg6bC6 TKqkeleTC+3Y269mckM6cduBI2Igj7X22g5vYhu6Q/iQQ15vVl985+QmNTTJGnINrll3 p9uQ== 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=+fppOA+6vv/Ufwv852E6JFYqisUjk+OhGthkkLSbrSA=; b=Mq+s99M9waGyEsP2R6OVHI3Sbgob0P3lMap4JmWwIiLGzupV9JxHAmP7vG1LcUhaUA FTH4rrMkUP5Ll6QpDzwIo75wtELfpOsU2YPfOEYjZSLZ5NU67rxJowxlb0hJD4lgOUxe wnWCXU9ZlD9WFxduSV/nLSAucXZOMU8FVEZFyIROZdzQz/gFpu95sjj7yXR/59fGz4PN L1lEvnCuBcsaq/74rVSe7tjTAZis1c81mjFqy5ACfn8qIZEM+zdwPwxFC15og9y6CXSK p8sFVEZzULKmxZE0RTaS4ZHWsNCs1FiGEIwXx/lh5C/pqqIqGXJh3UXUw3ZKn2yafVsL k3Jw== X-Gm-Message-State: AKGB3mLeQ1KXoAadsEg879qlckeFfRofFuQ9PxsJlJvPEN3Y5rsU5g7D tZMR8YhThFsApcktDMEdgcarUw== X-Google-Smtp-Source: ACJfBos6m/2gO/ilFyvsUk6NhOm9GvwGytIK3DocKYAUKbLSmZww6vQyIeD5OzTLXnhLL6heuQpytw== X-Received: by 10.84.141.164 with SMTP id 33mr17857811plv.375.1514047781628; Sat, 23 Dec 2017 08:49:41 -0800 (PST) Received: from roar.ozlabs.ibm.com (27-33-241-195.tpgi.com.au. [27.33.241.195]) by smtp.gmail.com with ESMTPSA id h69sm49906204pfe.107.2017.12.23.08.49.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Dec 2017 08:49:40 -0800 (PST) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 1/2] powerpc: System reset avoid interleaving oops using die synchronisation Date: Sun, 24 Dec 2017 02:49:22 +1000 Message-Id: <20171223164923.10587-2-npiggin@gmail.com> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171223164923.10587-1-npiggin@gmail.com> References: <20171223164923.10587-1-npiggin@gmail.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nicholas Piggin , David Gibson Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" The die() oops path contains a serializing lock to prevent oops messages from being interleaved. In the case of a system reset initiated oops (e.g., qemu nmi command), __die was being called which lacks that synchronisation and oops reports could be interleaved across CPUs. A recent patch 4388c9b3a6ee7 ("powerpc: Do not send system reset request through the oops path") changed this to __die to avoid the debugger() call, but there is no real harm to calling it twice if the first time fell through. So go back to using die() here. This was observed to fix the problem. Fixes: 4388c9b3a6ee7 ("powerpc: Do not send system reset request through the oops path") Signed-off-by: Nicholas Piggin Reviewed-by: David Gibson --- arch/powerpc/kernel/traps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index f3eb61be0d30..109989676776 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -337,7 +337,7 @@ void system_reset_exception(struct pt_regs *regs) * No debugger or crash dump registered, print logs then * panic. */ - __die("System Reset", regs, SIGABRT); + die("System Reset", regs, SIGABRT); mdelay(2*MSEC_PER_SEC); /* Wait a little while for others to print */ add_taint(TAINT_DIE, LOCKDEP_NOW_UNRELIABLE);