public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: Andre Przywara <andre.przywara@amd.com>,
	kvm@vger.kernel.org, mtosatti@redhat.com
Subject: Re: [PATCH 3/5] kvm/svm: enhance mov DR intercept handler
Date: Tue, 07 Dec 2010 15:14:42 +0200	[thread overview]
Message-ID: <4CFE3342.8050102@redhat.com> (raw)
In-Reply-To: <979C9704-9300-486F-B0C7-A7721842CFBE@suse.de>

On 12/07/2010 01:02 PM, Alexander Graf wrote:
> On 07.12.2010, at 11:59, Andre Przywara wrote:
>
> >  Newer SVM implementations provide the GPR number in the VMCB, so
> >  that the emulation path is no longer necesarry to handle debug
> >  register access intercepts. Implement the handling in svm.c and
> >  use it when the info is provided.
> >
> >  Signed-off-by: Andre Przywara<andre.przywara@amd.com>
> >  ---
> >  arch/x86/kvm/svm.c |   55 ++++++++++++++++++++++++++++++++++++---------------
> >  1 files changed, 39 insertions(+), 16 deletions(-)
> >
> >  diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> >  index b7233fd..369bd85 100644
> >  --- a/arch/x86/kvm/svm.c
> >  +++ b/arch/x86/kvm/svm.c
> >  @@ -2669,6 +2669,29 @@ static int cr0_write_interception(struct vcpu_svm *svm)
> >  	return r == EMULATE_DONE;
> >  }
> >
> >  +static int dr_interception(struct vcpu_svm *svm)
> >  +{
> >  +	int reg, dr;
> >  +	unsigned long val;
> >  +
> >  +	if (!boot_cpu_has(SVM_FEATURE_DECODE_ASSIST))
> >  +		return emulate_on_interception(svm);
>
> Wouldn't it be better to just change the entry in svm_exit_handlers if we detect that feature on init? No unnecessary branching then.
>

I'd rather make them const instead.  For something performance critical 
(unlike this) we can use static_cpu_has().

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2010-12-07 13:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 10:59 [PATCH 0/5] kvm/svm: implement new DecodeAssist features Andre Przywara
2010-12-07 10:59 ` [PATCH 1/5] kvm/svm: add new SVM feature bit names Andre Przywara
2010-12-07 10:59 ` [PATCH 2/5] kvm/svm: enhance MOV CR intercept handler Andre Przywara
2010-12-07 13:24   ` Avi Kivity
2010-12-07 14:30     ` Andre Przywara
2010-12-07 14:41       ` Avi Kivity
2010-12-07 10:59 ` [PATCH 3/5] kvm/svm: enhance mov DR " Andre Przywara
2010-12-07 11:02   ` Alexander Graf
2010-12-07 13:14     ` Avi Kivity [this message]
2010-12-07 13:25   ` Avi Kivity
2010-12-07 10:59 ` [PATCH 4/5] kvm/svm: implement enhanced INVLPG intercept Andre Przywara
2010-12-07 13:27   ` Avi Kivity
2010-12-07 10:59 ` [PATCH 5/5] kvm/svm: copy instruction bytes from VMCB Andre Przywara
2010-12-07 13:33   ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2010-12-10 13:51 [PATCH -v2 0/5] kvm/svm: implement new DecodeAssist features Andre Przywara
2010-12-10 13:51 ` [PATCH 3/5] kvm/svm: enhance mov DR intercept handler Andre Przywara
2010-12-13 12:14   ` Avi Kivity
2010-12-16 12:07     ` Andre Przywara
2010-12-16 12:48       ` 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=4CFE3342.8050102@redhat.com \
    --to=avi@redhat.com \
    --cc=agraf@suse.de \
    --cc=andre.przywara@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    /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