public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Joerg Roedel" <joerg.roedel-5C7GfCeVMHo@public.gmane.org>
To: "Balaji Rao" <balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [RFC] nmi watchdog in kvm
Date: Mon, 28 Jan 2008 13:29:25 +0100	[thread overview]
Message-ID: <20080128122925.GA11803@amd.com> (raw)
In-Reply-To: <200801281348.41010.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On Mon, Jan 28, 2008 at 01:48:40PM +0530, Balaji Rao wrote:
> Hello,
> 
> I was trying to enable the use of nmi watchdog within a linux guest running in kvm. I have done it 
> by allowing direct access to perfmon msrs using the MSR_BITMAP field in vmcs region.

Is there a proper virtualization of the performance counter MSRs on
Intel? If not this patch will destroy any host side performance
monitoring.

> Most of the times the NMI Watchdog Test in the guest fails, but with a finite number of NMI's 
> received  by the guest. But randomly it does work! Whenever it fails, i get this vmwrite error :
> 
> vmwrite error: reg 4016 value 80000202 (err 164061)
> 
> I have a few questions.
> 
> 1. How are NMI's supposed to be delivered to the guest ? I did this by adding a new op to
> kvm_x86_ops.
> 2. How am I supposed to handle perfmon MSRs ? Direct access may pose problems during migration. But 
> am not sure how costly emulation by abstraction would be..
> I have not yet considered saving the MSRS upon vmexits to allow multiple VMs use the MSRs. I think i 
> can do them easily when i get this working.

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.

> 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.

>  	void (*inject_pending_irq)(struct kvm_vcpu *vcpu);
>  	void (*inject_pending_vectors)(struct kvm_vcpu *vcpu,
>  				       struct kvm_run *run);
> ---

-- 
           |           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



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  parent reply	other threads:[~2008-01-28 12:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-28  8:18 [RFC] nmi watchdog in kvm Balaji Rao
     [not found] ` <200801281348.41010.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-28 10:57   ` Ingo Molnar
2008-01-28 12:29   ` Joerg Roedel [this message]
     [not found]     ` <20080128122925.GA11803-5C7GfCeVMHo@public.gmane.org>
2008-01-28 14:42       ` Balaji Rao
     [not found]         ` <200801282012.26225.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-28 15:00           ` Joerg Roedel
     [not found]             ` <20080128150032.GF6960-5C7GfCeVMHo@public.gmane.org>
2008-01-28 16:30               ` Balaji Rao
2008-01-30 10:43   ` Avi Kivity
     [not found]     ` <47A054EE.6010408-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-30 14:22       ` Balaji Rao
     [not found]         ` <200801301952.57604.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-30 14:39           ` Avi Kivity
     [not found]             ` <47A08C24.8040505-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2008-01-30 15:02               ` Balaji Rao
     [not found]                 ` <200801302032.01603.balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2008-01-30 15:13                   ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080128122925.GA11803@amd.com \
    --to=joerg.roedel-5c7gfcevmho@public.gmane.org \
    --cc=balajirrao-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox