[vbox-dev] NMI watchdog on Linux guest
Knut St. Osmundsen
bird at sun.com
Mon Oct 13 09:52:39 PDT 2008
Ricardo M. Correia wrote:
> Any thoughts about this issue?
> I see there's a VBOX_WITH_NMI symbol in VB's code, but I'm not sure if
> this enables NMIs in the guest, nor am I sure how to enable this symbol.
> I don't mind compiling the code myself and I don't mind if this has a
> performance penalty, as long as the NMI watchdog works in the guest.
The VBOX_WITH_NMI is only a debug watchdog feature that was useful once
upon a time when dealing with some hangs. It will not cause guest NMIs
to work, only cause the host APIC to deliver an NMI if we stay too long
in the other world.
> On Dom, 2008-10-12 at 03:45 +0200, Ricardo M. Correia wrote:
>> I'm trying to set up a virtual machine for Linux kernel development.
>> One thing that I'd like to do is to use something equivalent to the NMI
>> watchdog feature to trigger a crash dump when the (guest) kernel suffers
>> a hard lockup.
>> However, the NMI watchdog seems to be non-functional on a Linux guest.
>> Is there a way to enable them?
>> Alternatively, is there another way I can trigger a panic or crash dump
>> on a Linux guest when it has disabled interrupts?
We haven't implemented NMI delivery when interrupts are disabled I'm
afraid. It hasn't been a very important feature yet. We'll get to it
eventually I guess, but it might take a long time.
I'm not sure why you would like to panic the guest but if your main
purpose is to see what the guest is doing... I was just gonna say, open
the virtualbox debugger console and take a peek. Only, we don't ship it
yet (next version), and it was removed from the public source tree a few
weeks back while finishing the qt4 port... You could perhaps be able to
find some heuristics, like HLT + CLI or create a timer that checks the
CPU state every so often and if EFL.IF == 0 for every time for 15-60
seconds or something you could inject an NMI or set cs:rip to some know
panic place or something. (Use TMR3TimerCreateInternal(TMCLOCK_VIRTUAL),
set it to trigger every x ms (10 ms for instance). Use
CPUMGetGuestEFlags to retrieve the flags.)
More information about the vbox-dev