Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Jun 2015 13:10:54 -0600
From:      Ian Lepore <ian@freebsd.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Maksim Yevmenkin <maksim.yevmenkin@gmail.com>, Andriy Gapon <avg@freebsd.org>, "current@freebsd.org" <current@freebsd.org>
Subject:   Re: obtaining a minidump from panic() called from NMI handler
Message-ID:  <1434136254.1415.47.camel@freebsd.org>
In-Reply-To: <20150612185521.GE2080@kib.kiev.ua>
References:  <CAFPOs6qsFZKMVzLEDL5X77H6s5LoTjsc4SkMWgR0D_P8RQG4YQ@mail.gmail.com> <557B1905.80307@FreeBSD.org> <CAFPOs6p5yTvdbJXPOKXuagZxj%2Bu-pE3kt5fsCWCpPVj4vktO%2Bg@mail.gmail.com> <20150612185521.GE2080@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 2015-06-12 at 21:55 +0300, Konstantin Belousov wrote:
> On Fri, Jun 12, 2015 at 11:49:01AM -0700, Maksim Yevmenkin wrote:
> > 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.
> 
> I believe I posted patches to serialize ddb entrance or panics due to nmi.
> I do not have references handy, you could search lists.
> _______________________________________________
> freebsd-current@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"

That was on freebsd-arch in July 2014.

-- Ian





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1434136254.1415.47.camel>