[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] x86/monitor: add get_capabilities to monitor_op domctl


  • To: Tamas K Lengyel <tlengyel@xxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxx
  • From: Razvan Cojocaru <rcojocaru@xxxxxxxxxxxxxxx>
  • Date: Tue, 7 Jul 2015 09:03:00 +0300
  • Cc: wei.liu2@xxxxxxxxxx, ian.campbell@xxxxxxxxxx, stefano.stabellini@xxxxxxxxxxxxx, andrew.cooper3@xxxxxxxxxx, ian.jackson@xxxxxxxxxxxxx, jbeulich@xxxxxxxx, keir@xxxxxxx
  • Comment: DomainKeys? See http://domainkeys.sourceforge.net/
  • Delivery-date: Tue, 07 Jul 2015 06:03:19 +0000
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=bitdefender.com; b=jb9H+ztRiVbDo1hHjQwwTxLZUWs74DrSCgPMIO62IKWhvabukZQirEmNGroq3Yux6OVb8tOyVmhnrEPW7he9c0wIWFUzuT8O19EMIKzoy9wFe73Bzp4Lzz3/Nez0Ltz1XIqG4n7E6p4xdSC9mLB9qwRbqkedr4DT1jE8I7Yl5UmMXfJoNjJ6/OVhvwgwguALwp2sV4OOYIR0RRRL5LbyCzX2+aOOlZf0xeqcBwr7cnO661bL5us4PM311OBFEZTaT5bQcJXqVfgn8iqbB8oRw+ITnFgP613yl5zDUG5yZh/RlSCg6cmxKLBDMdel9XMmbUi+MtNNIIELCLCzA8nLaA==; h=Received:Received:Received:Received:Received:Subject:To:References:Cc:From:X-Enigmail-Draft-Status:Message-ID:Date:User-Agent:MIME-Version:In-Reply-To:Content-Type:Content-Transfer-Encoding:X-BitDefender-Scanner:X-BitDefender-Spam:X-BitDefender-SpamStamp:X-BitDefender-CF-Stamp;
  • List-id: Xen developer discussion <xen-devel.lists.xen.org>

On 07/07/2015 03:43 AM, 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@xxxxxxxxxxx>
> ---
>  tools/libxc/include/xenctrl.h |  6 ++++++
>  tools/libxc/xc_monitor.c      | 21 +++++++++++++++++++++
>  xen/arch/x86/hvm/hvm.c        |  5 +++++
>  xen/arch/x86/monitor.c        | 25 +++++++++++++++++++++++++
>  xen/common/domctl.c           |  1 +
>  xen/include/asm-x86/hvm/hvm.h |  2 ++
>  xen/include/public/domctl.h   | 18 +++++++++++++++---
>  7 files changed, 75 insertions(+), 3 deletions(-)
> 
> diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h
> index d1d2ab3..d930f02 100644
> --- a/tools/libxc/include/xenctrl.h
> +++ b/tools/libxc/include/xenctrl.h
> @@ -2376,6 +2376,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;
> +
> +    domctl.cmd = XEN_DOMCTL_monitor_op;
> +    domctl.domain = domain_id;
> +    domctl.u.monitor_op.op = XEN_DOMCTL_MONITOR_OP_GET_CAPABILITIES;
> +
> +    rc = do_domctl(xch, &domctl);
> +    if ( rc )
> +        return rc;
> +
> +    *capabilities = domctl.u.monitor_op.event;
> +    return 0;
> +}
> +
>  int xc_monitor_write_ctrlreg(xc_interface *xch, domid_t domain_id,
>                               uint16_t index, bool enable, bool sync,
>                               bool onchangeonly)
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index 535d622..d981f98 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -6431,6 +6431,11 @@ int hvm_debug_op(struct vcpu *v, int32_t op)
>      return rc;
>  }
>  
> +bool_t hvm_is_singlestep_supported(void)
> +{
> +    return cpu_has_monitor_trap_flag;
> +}
> +
>  int nhvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
>  {
>      if (hvm_funcs.nhvm_vcpu_hostrestore)
> diff --git a/xen/arch/x86/monitor.c b/xen/arch/x86/monitor.c
> index 896acf7..c41efb1 100644
> --- a/xen/arch/x86/monitor.c
> +++ b/xen/arch/x86/monitor.c
> @@ -42,6 +42,22 @@ int status_check(struct xen_domctl_monitor_op *mop, bool_t 
> status)
>      return 0;
>  }
>  
> +static inline
> +void get_capabilities(struct domain *d, struct xen_domctl_monitor_op *mop)
> +{
> +    mop->event = 0;
> +
> +    if ( !is_hvm_domain(d) || !cpu_has_vmx )
> +        return;

We've tested the guest-requested vm_event with a PV domain on ARM (ARM
patch to come after the release of 4.6), so should we keep these HVM /
VMX checks until the first patch that changes the situation?


Regards,
Razvan

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.