All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: andrew.cooper3@citrix.com, keir@xen.org, jbeulich@suse.com,
	xen-devel@lists.xen.org
Subject: Re: [PATCH] xen: Filter out MSR write events
Date: Mon, 11 Apr 2016 15:18:24 -0400	[thread overview]
Message-ID: <20160411191824.GA5630@char.us.oracle.com> (raw)
In-Reply-To: <1460392914-26033-1-git-send-email-rcojocaru@bitdefender.com>

On Mon, Apr 11, 2016 at 07:41:54PM +0300, Razvan Cojocaru wrote:
> This patch only allows introspection-related MSR write events to
> be sent out, improving performance. Should additional events be
> required, they can then simply be added to the list of
> vmx_introspection_force_enabled_msrs[].
> 
> Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Thought should there be some .. dynamic mechanism to update
the MSR list? Or remove entries (or temporarily blacklist
the built-one ins), etc?

> ---
>  xen/arch/x86/hvm/hvm.c | 14 +++++++++++++-
>  1 file changed, 13 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index f24126d..21ba611 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -3688,6 +3688,17 @@ int hvm_msr_read_intercept(unsigned int msr, uint64_t *msr_content)
>      goto out;
>  }
>  
> +static bool_t is_introspection_msr(unsigned int msr)
> +{
> +    unsigned int i;
> +
> +    for ( i = 0; i < vmx_introspection_force_enabled_msrs_size; i++ )
> +        if ( msr == vmx_introspection_force_enabled_msrs[i] )
> +            return 1;
> +
> +    return 0;
> +}
> +
>  int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content,
>                              bool_t may_defer)
>  {
> @@ -3703,7 +3714,8 @@ int hvm_msr_write_intercept(unsigned int msr, uint64_t msr_content,
>      hvm_cpuid(1, NULL, NULL, NULL, &edx);
>      mtrr = !!(edx & cpufeat_mask(X86_FEATURE_MTRR));
>  
> -    if ( may_defer && unlikely(currad->monitor.mov_to_msr_enabled) )
> +    if ( may_defer && unlikely(currad->monitor.mov_to_msr_enabled) &&
> +         is_introspection_msr(msr) )
>      {
>          ASSERT(v->arch.vm_event);
>  
> -- 
> 2.8.0
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-04-11 19:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-11 16:41 [PATCH] xen: Filter out MSR write events Razvan Cojocaru
2016-04-11 19:18 ` Konrad Rzeszutek Wilk [this message]
2016-04-12  4:26   ` Razvan Cojocaru
2016-04-12  9:38     ` Andrew Cooper
2016-04-12 10:17       ` Razvan Cojocaru
2016-04-12 10:19         ` Andrew Cooper

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=20160411191824.GA5630@char.us.oracle.com \
    --to=konrad.wilk@oracle.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=rcojocaru@bitdefender.com \
    --cc=xen-devel@lists.xen.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.