Re: [RFC] nmi watchdog in kvm

Joerg Roedel
2008-01-28T15:00:32Z

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.

> > > diff --git a/include/asm-x86/kvm_host.h b/include/asm-x86/kvm_host.h
> > > index 67ae307..f17248d 100644
> > > --- a/include/asm-x86/kvm_host.h
> > > +++ b/include/asm-x86/kvm_host.h
> > > @@ -387,6 +387,7 @@ struct kvm_x86_ops {
> > > void (*queue_exception)(struct kvm_vcpu *vcpu, unsigned nr,
> > > bool has_error_code, u32 error_code);
> > > bool (*exception_injected)(struct kvm_vcpu *vcpu);
> > > + void (*inject_nmi)(struct kvm_vcpu *vcpu);
> >
> > The implementation of this new callback for SVM is missing.
> I just wanted to get it running on my hardware first! :) Will implement it for
> SVM once I get the approach right.
> >
> > > void (*inject_pending_irq)(struct kvm_vcpu *vcpu);
> > > void (*inject_pending_vectors)(struct kvm_vcpu *vcpu,
> > > struct kvm_run *run);
> > > ---
>
> thank you for the comments,
>
> regards,
> balaji rao
>
>
>

--
| AMD Saxony Limited Liability Company & Co. KG
Operating | Wilschdorfer Landstr. 101, 01109 Dresden, Germany
System | Register Court Dresden: HRA 4896
Research | General Partner authorized to represent:
Center | AMD Saxony LLC (Wilmington, Delaware, US)
| General Manager of AMD Saxony LLC: Dr. Hans-R. Deppe, Thomas McCoy