All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@arm.com>
To: Razvan Cojocaru <rcojocaru@bitdefender.com>, xen-devel@lists.xen.org
Cc: kevin.tian@intel.com, tamas@tklengyel.com, wei.liu2@citrix.com,
	jbeulich@suse.com, andrew.cooper3@citrix.com,
	ian.jackson@eu.citrix.com, sstabellini@kernel.org,
	jun.nakajima@intel.com
Subject: Re: [PATCH V5] vm_event: Allow subscribing to write events for specific MSR-s
Date: Tue, 26 Apr 2016 10:26:39 +0100	[thread overview]
Message-ID: <571F344F.20503@arm.com> (raw)
In-Reply-To: <1461660563-4577-1-git-send-email-rcojocaru@bitdefender.com>

Hi Razvan,

On 26/04/2016 09:49, Razvan Cojocaru wrote:
> diff --git a/xen/common/vm_event.c b/xen/common/vm_event.c
> index 2906407..1ba12cb 100644
> --- a/xen/common/vm_event.c
> +++ b/xen/common/vm_event.c
> @@ -27,6 +27,7 @@
>   #include <xen/mem_access.h>
>   #include <asm/p2m.h>
>   #include <asm/altp2m.h>
> +#include <asm/monitor.h>
>   #include <asm/vm_event.h>
>   #include <xsm/xsm.h>
>
> @@ -665,6 +666,9 @@ int vm_event_domctl(struct domain *d, xen_domctl_vm_event_op_t *vec,
>           {
>           case XEN_VM_EVENT_ENABLE:
>               /* domain_pause() not required here, see XSA-99 */
> +            rc = arch_monitor_init_domain(d);

For x86, this function will allocate memory unconditionally. I cannot 
find anything which could prevent someone to call XEN_VM_EVENT_ENABLE 
twice. So Xen would leak memory for the previous allocation.

> +            if ( rc )
> +                break;
>               rc = vm_event_enable(d, vec, ved, _VPF_mem_access,
>                                    HVM_PARAM_MONITOR_RING_PFN,
>                                    monitor_notification);
> @@ -675,6 +679,7 @@ int vm_event_domctl(struct domain *d, xen_domctl_vm_event_op_t *vec,
>               {
>                   domain_pause(d);
>                   rc = vm_event_disable(d, ved);
> +                arch_monitor_cleanup_domain(d);
>                   domain_unpause(d);
>               }
>               break;
> diff --git a/xen/include/asm-arm/monitor.h b/xen/include/asm-arm/monitor.h
> index 6e36e99..57a9d91 100644
> --- a/xen/include/asm-arm/monitor.h
> +++ b/xen/include/asm-arm/monitor.h
> @@ -46,4 +46,17 @@ int arch_monitor_domctl_event(struct domain *d,
>       return -EOPNOTSUPP;
>   }
>
> +static inline
> +int arch_monitor_init_domain(struct domain *d)
> +{
> +    /* No arch-specific domain initialization on ARM. */
> +    return -EOPNOTSUPP;

Shouldn't we return 0 in this case?

> +}
> +
> +static inline
> +void arch_monitor_cleanup_domain(struct domain *d)
> +{
> +    /* No arch-specific domain cleanup on ARM. */
> +}
> +
>   #endif /* __ASM_ARM_MONITOR_H__ */

Regards,

-- 
Julien Grall

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

  parent reply	other threads:[~2016-04-26  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-26  8:49 [PATCH V5] vm_event: Allow subscribing to write events for specific MSR-s Razvan Cojocaru
2016-04-26  9:10 ` Razvan Cojocaru
2016-04-26 15:28   ` Tamas K Lengyel
2016-04-27  7:21     ` Razvan Cojocaru
2016-04-26  9:26 ` Julien Grall [this message]
2016-04-26  9:34   ` 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=571F344F.20503@arm.com \
    --to=julien.grall@arm.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=rcojocaru@bitdefender.com \
    --cc=sstabellini@kernel.org \
    --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.