All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Tamas K Lengyel <tlengyel@novetta.com>
Cc: kevin.tian@intel.com, wei.liu2@citrix.com, jbeulich@suse.com,
	rcojocaru@bitdefender.com, stefano.stabellini@eu.citrix.com,
	eddie.dong@intel.com, ian.jackson@eu.citrix.com,
	xen-devel@lists.xen.org, jun.nakajima@intel.com,
	andrew.cooper3@citrix.com, keir@xen.org
Subject: Re: [PATCH v4 1/3] x86/monitor: add get_capabilities to monitor_op domctl
Date: Thu, 9 Jul 2015 10:05:46 +0100	[thread overview]
Message-ID: <1436432746.23508.81.camel@citrix.com> (raw)
In-Reply-To: <1436395978-11048-1-git-send-email-tlengyel@novetta.com>

On Wed, 2015-07-08 at 18:52 -0400, Tamas K Lengyel wrote:
> Add option to monitor_op domctl to determine the monitor capabilities of the
> system.
> 
> Signed-off-by: Tamas K Lengyel <tlengyel@novetta.com>
> ---
> v4: add inline function wrapper for is_singlestep_supported to hvm.h
> v3: move is_singlestep_supported into vmx
>     sanity check capabilities for each monitor_op enable/disable
>     fix comment typo
> v2: skipped
> ---
>  tools/libxc/include/xenctrl.h |  6 ++++++
>  tools/libxc/xc_monitor.c      | 21 +++++++++++++++++++++
>  xen/arch/x86/hvm/vmx/vmx.c    |  6 ++++++
>  xen/arch/x86/monitor.c        | 33 +++++++++++++++++++++++++++++++--
>  xen/common/domctl.c           |  2 ++
>  xen/include/asm-x86/hvm/hvm.h |  6 ++++++
>  xen/include/public/domctl.h   | 18 +++++++++++++++---
>  7 files changed, 87 insertions(+), 5 deletions(-)
> 
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index 71539a7..4fe347b 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -2364,6 +2364,12 @@ int xc_mem_access_disable_emulate(xc_interface *xch, domid_t domain_id);
>  void *xc_monitor_enable(xc_interface *xch, domid_t domain_id, uint32_t *port);
>  int xc_monitor_disable(xc_interface *xch, domid_t domain_id);
>  int xc_monitor_resume(xc_interface *xch, domid_t domain_id);
> +/*
> + * Get a bitmap of supported monitor events in the form
> + * (1 << XEN_DOMCTL_MONITOR_EVENT_*).
> + */
> +int xc_monitor_get_capabilities(xc_interface *xch, domid_t domain_id,
> +                                uint32_t *capabilities);
>  int xc_monitor_write_ctrlreg(xc_interface *xch, domid_t domain_id,
>                               uint16_t index, bool enable, bool sync,
>                               bool onchangeonly);
> diff --git a/tools/libxc/xc_monitor.c b/tools/libxc/xc_monitor.c
> index 63013de..3221bdd 100644
> --- a/tools/libxc/xc_monitor.c
> +++ b/tools/libxc/xc_monitor.c
> @@ -45,6 +45,27 @@ int xc_monitor_resume(xc_interface *xch, domid_t domain_id)
>                                 NULL);
>  }
>  
> +int xc_monitor_get_capabilities(xc_interface *xch, domid_t domain_id,
> +                                uint32_t *capabilities)
> +{
> +    int rc;
> +    DECLARE_DOMCTL;
> +
> +    if ( !capabilities )
> +        return -EINVAL;

Should be:
        errno = EINVAL;
        return -1;

Lots of libxc gets this wrong, but a) lets try not to make things worse
and b) do_domctl which was used below gets it right so this function is
effectively mixing error reporting schemes.

Other than that this looks like a valid wrapping of a hypercall, so with
the above fixed and if the hypervisor people are happy with the domctl
interface itself:
        Acked-by: Ian Campbell <ian.campbell@citrix.com>

>From glancing at the diffstats I think this is the only tools impact of
this whole series, please correct me if I'm wrong.

Ian.

  parent reply	other threads:[~2015-07-09  9:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 22:52 [PATCH v4 1/3] x86/monitor: add get_capabilities to monitor_op domctl Tamas K Lengyel
2015-07-08 22:52 ` [PATCH v4 2/3] x86/vm_event: toggle singlestep from vm_event response Tamas K Lengyel
2015-07-08 22:52 ` [PATCH v4 3/3] x86/monitor: don't use hvm_funcs directly Tamas K Lengyel
2015-07-09  6:15   ` Razvan Cojocaru
2015-07-09  8:15     ` Jan Beulich
2015-07-09 12:50       ` Lengyel, Tamas
2015-07-09 12:52     ` Lengyel, Tamas
2015-07-09 12:55       ` Razvan Cojocaru
2015-07-09  9:05 ` Ian Campbell [this message]
2015-07-09 12:37   ` [PATCH v4 1/3] x86/monitor: add get_capabilities to monitor_op domctl Lengyel, Tamas
2015-07-09 13:00 ` 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=1436432746.23508.81.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=eddie.dong@intel.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=stefano.stabellini@eu.citrix.com \
    --cc=tlengyel@novetta.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.