All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Tamas K Lengyel <tamas@tklengyel.com>,
	Razvan Cojocaru <rcojocaru@bitdefender.com>
Cc: Kevin Tian <kevin.tian@intel.com>,
	"wei.liu2@citrix.com" <wei.liu2@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>,
	Jun Nakajima <jun.nakajima@intel.com>, Keir Fraser <keir@xen.org>
Subject: Re: [PATCH V3] vm_event: Allow subscribing to write events for specific MSR-s
Date: Fri, 15 Apr 2016 18:18:11 +0100	[thread overview]
Message-ID: <57112253.7040308@citrix.com> (raw)
In-Reply-To: <CABfawhnj_2Kopix=SO5zsqJh71bVzTSQ2ynXmAE+8f=pKCz3HQ@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3574 bytes --]

On 15/04/16 18:12, Tamas K Lengyel wrote:
>
>
> On Fri, Apr 15, 2016 at 3:02 AM, Razvan Cojocaru
> <rcojocaru@bitdefender.com <mailto:rcojocaru@bitdefender.com>> wrote:
>
>     Previously, subscribing to MSR write events was an all-or-none
>     approach, with special cases for introspection MSR-s. This patch
>     allows the vm_event consumer to specify exactly what MSR-s it is
>     interested in, and as a side-effect gets rid of the
>     vmx_introspection_force_enabled_msrs[] special case.
>     This replaces the previously posted "xen: Filter out MSR write
>     events" patch.
>
>     Signed-off-by: Razvan Cojocaru <rcojocaru@bitdefender.com
>     <mailto:rcojocaru@bitdefender.com>>
>
>     ---
>     Changes since V2:
>      - Bumped XEN_DOMCTL_INTERFACE_VERSION.
>      - Introduced struct monitor_msr_bitmap as recommended by Andrew
>        Cooper, which allowed removing some pointer arithmetic magic.
>      - Removed arch_ prefix from monitor functions, as recommended
>        by Tamas Lengyel.
>      - Replaced the page allocation code with xzalloc() / xfree() for
>        struct monitor_msr_bitmap.
>      - Now returning -ENXIO instead of -EINVAL from the monitor
>        functions, as recommended by Konrad Rzeszutek Wilk.
>     ---
>      tools/libxc/include/xenctrl.h      |  4 +-
>      tools/libxc/xc_monitor.c           |  6 +--
>      xen/arch/x86/hvm/event.c           |  3 +-
>      xen/arch/x86/hvm/hvm.c             |  3 +-
>      xen/arch/x86/hvm/vmx/vmcs.c        | 26 ++---------
>      xen/arch/x86/hvm/vmx/vmx.c         | 10 ++--
>      xen/arch/x86/monitor.c             | 95
>     +++++++++++++++++++++++++++++++++-----
>      xen/arch/x86/vm_event.c            |  9 ++++
>      xen/include/asm-x86/domain.h       |  4 +-
>      xen/include/asm-x86/hvm/hvm.h      |  8 ++--
>      xen/include/asm-x86/hvm/vmx/vmcs.h |  7 ---
>      xen/include/asm-x86/monitor.h      |  8 ++++
>      xen/include/public/domctl.h        |  5 +-
>      13 files changed, 121 insertions(+), 67 deletions(-)
>
>     diff --git a/tools/libxc/include/xenctrl.h
>     b/tools/libxc/include/xenctrl.h
>     index f5a034a..9698d46 100644
>     --- a/tools/libxc/include/xenctrl.h
>     +++ b/tools/libxc/include/xenctrl.h
>     @@ -2183,8 +2183,8 @@ int xc_monitor_get_capabilities(xc_interface
>     *xch, domid_t domain_id,
>      int xc_monitor_write_ctrlreg(xc_interface *xch, domid_t domain_id,
>                                   uint16_t index, bool enable, bool sync,
>                                   bool onchangeonly);
>     -int xc_monitor_mov_to_msr(xc_interface *xch, domid_t domain_id,
>     bool enable,
>     -                          bool extended_capture);
>     +int xc_monitor_mov_to_msr(xc_interface *xch, domid_t domain_id,
>     uint32_t msr,
>     +                          bool enable);
>
>  
> So my only concern with this approach here is that the MSR index
> definitions that are supposed to be passed are never exported via a
> public header, are only defined in asm-x86/msr-index.h. Should that
> also be moved to be a public header as part of this patch?

The MSRs are specified by the Intel/AMD manuals.  Furthermore, for the
non-architectural ones, it is quite possible that the same index maps to
different MSRs on different hardware.  It is definitely the case that
different hadware has the same MSR at different indices.  (The Intel
cpuid masking MSRs have this propery across different CPU generations).

I expect the monitoring application to know the current hardware, and
which MSRs are applicable.

~Andrew

[-- Attachment #1.2: Type: text/html, Size: 5746 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

  reply	other threads:[~2016-04-15 17:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15  9:02 [PATCH V3] vm_event: Allow subscribing to write events for specific MSR-s Razvan Cojocaru
2016-04-15  9:12 ` Wei Liu
2016-04-15 10:44 ` Razvan Cojocaru
2016-04-15 17:12 ` Tamas K Lengyel
2016-04-15 17:18   ` Andrew Cooper [this message]
2016-04-15 17:34     ` Tamas K Lengyel
2016-04-15 17:19   ` Razvan Cojocaru
2016-04-15 17:38     ` Tamas K Lengyel
2016-04-15 17:49       ` 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=57112253.7040308@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=keir@xen.org \
    --cc=kevin.tian@intel.com \
    --cc=rcojocaru@bitdefender.com \
    --cc=tamas@tklengyel.com \
    --cc=wei.liu2@citrix.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.