All of lore.kernel.org
 help / color / mirror / Atom feed
From: Razvan Cojocaru <rcojocaru@bitdefender.com>
To: Tamas K Lengyel <tamas.lengyel@zentific.com>,
	xen-devel@lists.xenproject.org
Cc: Kevin Tian <kevin.tian@intel.com>, Wei Liu <wei.liu2@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Jun Nakajima <jun.nakajima@intel.com>
Subject: Re: [PATCH] vmx/monitor: CPUID events
Date: Fri, 8 Jul 2016 10:03:19 +0300	[thread overview]
Message-ID: <987a4aa6-5dfb-bc89-472b-3eb6ac7d4d86@bitdefender.com> (raw)
In-Reply-To: <1467945111-11399-1-git-send-email-tamas.lengyel@zentific.com>

On 07/08/16 05:31, Tamas K Lengyel wrote:
> This patch implements sending notification to a monitor subscriber when an
> x86/vmx guest executes the CPUID instruction.
> 
> Signed-off-by: Tamas K Lengyel <tamas.lengyel@zentific.com>
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Razvan Cojocaru <rcojocaru@bitdefender.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: Jun Nakajima <jun.nakajima@intel.com>
> Cc: Kevin Tian <kevin.tian@intel.com>
> ---
>  tools/libxc/include/xenctrl.h       |  1 +
>  tools/libxc/xc_monitor.c            | 13 +++++++++++++
>  tools/tests/xen-access/xen-access.c | 33 ++++++++++++++++++++++++++++++++-
>  xen/arch/x86/hvm/monitor.c          | 16 ++++++++++++++++
>  xen/arch/x86/hvm/vmx/vmx.c          | 23 +++++++++++++++++++----
>  xen/arch/x86/monitor.c              | 13 +++++++++++++
>  xen/include/asm-x86/domain.h        |  1 +
>  xen/include/asm-x86/hvm/monitor.h   |  1 +
>  xen/include/asm-x86/monitor.h       |  3 ++-
>  xen/include/public/domctl.h         |  1 +
>  xen/include/public/vm_event.h       |  8 ++++++++
>  11 files changed, 107 insertions(+), 6 deletions(-)
> 
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index 4a85b4a..e904bd5 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -2167,6 +2167,7 @@ int xc_monitor_guest_request(xc_interface *xch, domid_t domain_id,
>                               bool enable, bool sync);
>  int xc_monitor_debug_exceptions(xc_interface *xch, domid_t domain_id,
>                                  bool enable, bool sync);
> +int xc_monitor_cpuid(xc_interface *xch, domid_t domain_id, bool enable);
>  /**
>   * This function enables / disables emulation for each REP for a
>   * REP-compatible instruction.
> diff --git a/tools/libxc/xc_monitor.c b/tools/libxc/xc_monitor.c
> index 264992c..4298813 100644
> --- a/tools/libxc/xc_monitor.c
> +++ b/tools/libxc/xc_monitor.c
> @@ -172,6 +172,19 @@ int xc_monitor_debug_exceptions(xc_interface *xch, domid_t domain_id,
>      return do_domctl(xch, &domctl);
>  }
>  
> +int xc_monitor_cpuid(xc_interface *xch, domid_t domain_id, bool enable)
> +{
> +    DECLARE_DOMCTL;
> +
> +    domctl.cmd = XEN_DOMCTL_monitor_op;
> +    domctl.domain = domain_id;
> +    domctl.u.monitor_op.op = enable ? XEN_DOMCTL_MONITOR_OP_ENABLE
> +                                    : XEN_DOMCTL_MONITOR_OP_DISABLE;
> +    domctl.u.monitor_op.event = XEN_DOMCTL_MONITOR_EVENT_CPUID;
> +
> +    return do_domctl(xch, &domctl);
> +}
> +
>  /*
>   * Local variables:
>   * mode: C
> diff --git a/tools/tests/xen-access/xen-access.c b/tools/tests/xen-access/xen-access.c
> index 02655d5..d525b82 100644
> --- a/tools/tests/xen-access/xen-access.c
> +++ b/tools/tests/xen-access/xen-access.c
> @@ -337,7 +337,7 @@ void usage(char* progname)
>  {
>      fprintf(stderr, "Usage: %s [-m] <domain_id> write|exec", progname);
>  #if defined(__i386__) || defined(__x86_64__)
> -            fprintf(stderr, "|breakpoint|altp2m_write|altp2m_exec|debug");
> +            fprintf(stderr, "|breakpoint|altp2m_write|altp2m_exec|debug|cpuid");
>  #endif
>              fprintf(stderr,
>              "\n"
> @@ -364,6 +364,7 @@ int main(int argc, char *argv[])
>      int shutting_down = 0;
>      int altp2m = 0;
>      int debug = 0;
> +    int cpuid = 1;

Should this be on by default? All the rest of the options are 0, and ...

>      uint16_t altp2m_view_id = 0;
>  
>      char* progname = argv[0];
> @@ -426,6 +427,10 @@ int main(int argc, char *argv[])
>      {
>          debug = 1;
>      }
> +    else if ( !strcmp(argv[0], "cpuid") )
> +    {
> +        cpuid = 1;
> +    }
>  #endif

... you also set it to 1 here.


Thanks,
Razvan

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

  reply	other threads:[~2016-07-08  7:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-08  2:31 [PATCH] vmx/monitor: CPUID events Tamas K Lengyel
2016-07-08  7:03 ` Razvan Cojocaru [this message]
2016-07-08 15:36   ` Tamas K Lengyel
2016-07-08  9:33 ` Andrew Cooper
2016-07-08 15:44   ` Tamas K Lengyel
2016-07-08 16:49     ` Andrew Cooper
2016-07-08 16:59       ` Tamas K Lengyel
2016-07-08 17:37         ` Andrew Cooper
2016-07-11  3:00 ` Tian, Kevin
2016-07-12 16:30   ` Tamas K Lengyel

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=987a4aa6-5dfb-bc89-472b-3eb6ac7d4d86@bitdefender.com \
    --to=rcojocaru@bitdefender.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=jun.nakajima@intel.com \
    --cc=kevin.tian@intel.com \
    --cc=tamas.lengyel@zentific.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.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.