xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>, xen-devel@lists.xen.org
Cc: mdontu@bitdefender.com, tim@xen.org, JBeulich@suse.com
Subject: Re: [PATCH RFC V2 3/6] xen: Force-enable relevant MSR events; optimize the number of sent MSR events
Date: Fri, 11 Jul 2014 18:03:55 +0100	[thread overview]
Message-ID: <53C018FB.3080307@citrix.com> (raw)
In-Reply-To: <1405093418-23481-3-git-send-email-rcojocaru@bitdefender.com>

On 11/07/14 16:43, Razvan Cojocaru wrote:
> Vmx_disable_intercept_for_msr() will now refuse to disable interception of
> MSRs needed for memory introspection. It is not possible to gate this on
> mem_access being active for the domain, since by the time mem_access does
> become active the interception for the interesting MSRs has already been
> disabled (vmx_disable_intercept_for_msr() runs very early on).
>
> Changes since V1:
>  - Replaced printk() with gdprintk(XENLOG_DEBUG, ...).
>
> Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com>
> ---
>  xen/arch/x86/hvm/vmx/vmcs.c |   18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c
> index 8ffc562..35fcfcc 100644
> --- a/xen/arch/x86/hvm/vmx/vmcs.c
> +++ b/xen/arch/x86/hvm/vmx/vmcs.c
> @@ -700,6 +700,24 @@ void vmx_disable_intercept_for_msr(struct vcpu *v, u32 msr, int type)
>      if ( msr_bitmap == NULL )
>          return;
>  
> +    /* Filter out MSR-s needed for memory introspection */
> +    switch ( msr )

This absolutely must be gated on mem_events being enabled for the domain.

It is too much of a performance penalty to apply to domains which are
not being introspected.

> +    {
> +    case MSR_IA32_SYSENTER_EIP:
> +    case MSR_IA32_SYSENTER_ESP:
> +    case MSR_IA32_SYSENTER_CS:
> +    case MSR_IA32_MC0_CTL:
> +    case MSR_STAR:
> +    case MSR_LSTAR:
> +
> +        gdprintk(XENLOG_DEBUG, "MSR 0x%08x needed for "
> +            "memory introspection, still intercepted\n", msr);

I you are going to split this line then do it at the %08x so the string
is still grepable.

How often do these messages trigger?  It seems like it could be
contribute to a lot of logspam.

> +        return;
> +
> +    default:
> +        break;
> +    }
> +
>      /*
>       * See Intel PRM Vol. 3, 20.6.9 (MSR-Bitmap Address). Early manuals
>       * have the write-low and read-high bitmap offsets the wrong way round.

  reply	other threads:[~2014-07-11 17:03 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-11 15:43 [PATCH RFC V2 1/6] xen: Emulate with no writes Razvan Cojocaru
2014-07-11 15:43 ` [PATCH RFC V2 2/6] xen: Optimize introspection access to guest state Razvan Cojocaru
2014-07-11 16:54   ` Andrew Cooper
2014-07-11 16:57     ` Andrew Cooper
2014-07-11 18:03     ` Razvan Cojocaru
2014-07-11 18:09       ` Andrew Cooper
2014-07-11 15:43 ` [PATCH RFC V2 3/6] xen: Force-enable relevant MSR events; optimize the number of sent MSR events Razvan Cojocaru
2014-07-11 17:03   ` Andrew Cooper [this message]
2014-07-11 18:09     ` Razvan Cojocaru
     [not found]       ` <CAGU+ausrcu=L7Kf30gZJXRnnxrKe7EMYXTGByOY4agwoK0nXeA@mail.gmail.com>
2014-07-11 18:18         ` Aravindh Puthiyaparambil (aravindp)
2014-07-11 18:19       ` Andrew Cooper
2014-07-11 18:22         ` Razvan Cojocaru
2014-07-11 18:29           ` Andrew Cooper
2014-07-11 15:43 ` [PATCH RFC V2 4/6] xen: Support for VMCALL mem_events Razvan Cojocaru
2014-07-11 17:23   ` Andrew Cooper
2014-07-11 18:15     ` Razvan Cojocaru
2015-03-17 13:50     ` Razvan Cojocaru
2015-03-17 13:58       ` Jan Beulich
2015-03-17 14:07         ` Razvan Cojocaru
2015-03-17 14:20           ` Jan Beulich
2015-03-17 14:33             ` Razvan Cojocaru
2014-07-11 15:43 ` [PATCH RFC V2 5/6] xen, libxc: Request page fault injection via libxc Razvan Cojocaru
2014-07-11 18:06   ` Andrew Cooper
2014-07-17 11:53     ` Ian Campbell
2014-07-17 12:07       ` Razvan Cojocaru
2014-07-17 12:22     ` Razvan Cojocaru
2014-07-17 12:38       ` Andrew Cooper
2014-07-11 15:43 ` [PATCH RFC V2 6/6] xen: Handle resumed instruction based on previous mem_event reply Razvan Cojocaru
2014-07-11 18:36   ` Andrew Cooper
2014-07-11 18:41     ` Razvan Cojocaru
2014-07-11 19:12       ` Andrew Cooper
2014-07-11 16:23 ` [PATCH RFC V2 1/6] xen: Emulate with no writes Andrew Cooper
2014-07-11 18:00   ` Razvan Cojocaru
2014-07-14  8:37   ` Razvan Cojocaru

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=53C018FB.3080307@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=mdontu@bitdefender.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=tim@xen.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).