From owner-freebsd-current@FreeBSD.ORG Fri Jun 12 18:49:02 2015 Return-Path: Delivered-To: current@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 51B7BC73; Fri, 12 Jun 2015 18:49:02 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: from mail-ig0-x236.google.com (mail-ig0-x236.google.com [IPv6:2607:f8b0:4001:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1CAB7F6; Fri, 12 Jun 2015 18:49:02 +0000 (UTC) (envelope-from maksim.yevmenkin@gmail.com) Received: by igbzc4 with SMTP id zc4so17562577igb.0; Fri, 12 Jun 2015 11:49:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MGN+LR0hlOV2EVFEBeO4lkxkScWYhbeE4k6+a4fuzAY=; b=AwnmWQisl9/xEk3qVuFPRVWINPFFzI4tLS8ZIkeCz4GIELBiqJcSpYezoEvfTaYOeX SMfyKJF78U+Gv+Qw1SXBw2KJYp8PxwkHoeaZe2zx0p5KckjIx3HIfujzvMM+G5cNuMtq ERujA8kJV4Z9Dpp6XUIAUvHLFwRqTLVKryesYQeASFd9RboRg9UzBHb+5D653N2Mpg+T gQHd4cfF4ueA/OsBfBQJNViFehzXL06P4zWfceXQFRTe9izQfR/jIn1rKTX14KcI+w/W EcDbivnIvMRJuNHgcwCxR06eDYct+4tfbcaN/0KGm1KWwBB/KnaSlPGp9dqAW2HA51se 63zQ== MIME-Version: 1.0 X-Received: by 10.43.172.68 with SMTP id nx4mr17733801icc.48.1434134941559; Fri, 12 Jun 2015 11:49:01 -0700 (PDT) Received: by 10.36.66.17 with HTTP; Fri, 12 Jun 2015 11:49:01 -0700 (PDT) In-Reply-To: <557B1905.80307@FreeBSD.org> References: <557B1905.80307@FreeBSD.org> Date: Fri, 12 Jun 2015 11:49:01 -0700 Message-ID: Subject: Re: obtaining a minidump from panic() called from NMI handler From: Maksim Yevmenkin To: Andriy Gapon Cc: "current@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2015 18:49:02 -0000 Andriy, >> i have a question about obtaining minidump as result of panic() being >> called from nmi handler. basically, i have a way to trigger nmi, and, >> i would like to panic() system and obtain a minidump. >> >> i have modified isa_nmi() to appropriately inspect bits and return >> non-zero return code. i have turned off machdep.kdb_on_nmi knob (set >> it to zero). i have confirmed that amd64 trap() is called with correct >> T_NMI type. i've also confirmed that panic() is called from amd64's >> trap(). >> >> the issue i have is that system is rebooting too early. basically, it >> looks like minidump is started, but, for whatever reason, other cpus >> are not completely stopped (or may be they are panic()ing again) and >> system just reboots without having complete the minidump. >> >> the issue is not present when machdep.kdb_on_nmi is set to 1. in this >> case, system drops into ddb prompt and 'call doadump' works as >> expected. for various reasons i can not use ddb, and, would like to >> have system save nmi triggered minidump completely unattended. >> >> can someone please give me a clue as to what i should be looking into >> to make this work? > > could it be that more than one CPUs get the NMI at the same time? i guess, its possible. is there an easy way to check for that? > IF yes, then the current code wouldn't handle that well - each of the NMI-ed > CPUs will try to stop all others with another NMI and it will wait until each of > those CPUs sets an acknowledgement bit in its NMI handler. This scheme works > fine if there's only one CPU that wants to become the master, but results in a > deadlock otherwise. that makes sense. i don't observe deadlock, but, simple reboot. thanks, max