|
[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
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
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |