Re: [RFC] nmi watchdog in kvm

Balaji Rao
2008-01-28T16:30:40Z

On Monday 28 January 2008 08:30:32 pm Joerg Roedel wrote:
> On Mon, Jan 28, 2008 at 08:12:26PM +0530, Balaji Rao wrote:
> > On Monday 28 January 2008 05:59:25 pm Joerg Roedel wrote:
> > > This patch kills the ability of KVM to migrate between AMD and Intel
> > > because the Intel performance counters are not available on AMD and
> > > vice verca.
> >
> > Yes. The way we should solve this is by emulating the MSRs. Am not sure
> > about the overhead involved. What are your thoughts on this ?
>
> I think you can't do this with performance counters in KVM (except you
> emulate the Intel PerfCtrs on AMD and the AMD PerfCtrs on Intel, which
> might not be possible, at least very painfull). I think the best
> solution to implement a watchdog for KVM is to implement another NMI
> source, e.g. emulating a watchdog PCI card in QEMU.
>
Yes, it would be painful to emulate non native perform counters..

But having a PCI device for generating NMIs would solve the problem of NMI
Watchdogs. But we still wouldn't be able to provide perfmon counters to the
guest.. But before that, we need to decide whether it is needed to provide
perfmon counters to the guest or not.

To make the guest use QEmu's PCI we need to pass another kernel param (say,
nmi_watchdog=3) which is not very nice.So, can't we implement NMI watchdog
using paravirt ?

Or the other option would be to probe for the NMI Watchdog PCI card before
trying to use other means of generating NMIs..

Could anyone please point me to any docs on writing a QEmu PCI device driver ?

regards,
balaji rao