Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 6:51 PM, Tamas K Lengyel wrote: On Mon, Feb 15, 2016 at 9:44 AM, Jan Beulich > wrote: >>> On 15.02.16 at 17:28, > wrote: > On 2/15/2016 4:08 PM, Jan Beulich wrote: >>

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Tamas K Lengyel
On Mon, Feb 15, 2016 at 9:44 AM, Jan Beulich wrote: > >>> On 15.02.16 at 17:28, wrote: > > On 2/15/2016 4:08 PM, Jan Beulich wrote: > >> > >>> After changing 1 to 1U though, I don't understand why we should also > >>> range-check mop->event. > >>> I'm

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Jan Beulich
>>> On 15.02.16 at 17:28, wrote: > On 2/15/2016 4:08 PM, Jan Beulich wrote: >> >>> After changing 1 to 1U though, I don't understand why we should also >>> range-check mop->event. >>> I'm imagining when (mop->event > 31): >>> * (1U << mop->event) = 0 or >= (0x1 +

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 4:08 PM, Jan Beulich wrote: After changing 1 to 1U though, I don't understand why we should also range-check mop->event. I'm imagining when (mop->event > 31): * (1U << mop->event) = 0 or >= (0x1 + 0x) (?) No, it's plain undefined. Weirdo C, didn't know that! I've just

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Tamas K Lengyel
On Mon, Feb 15, 2016 at 7:08 AM, Jan Beulich wrote: > >>> On 15.02.16 at 14:29, wrote: > > On 2/15/2016 2:44 PM, Jan Beulich wrote: > >> > >>> switch ( mop->op ) > >>> { > >>> case XEN_DOMCTL_MONITOR_OP_ENABLE: > >>> case

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Jan Beulich
>>> On 15.02.16 at 14:29, wrote: > On 2/15/2016 2:44 PM, Jan Beulich wrote: >> >>> switch ( mop->op ) >>> { >>> case XEN_DOMCTL_MONITOR_OP_ENABLE: >>> case XEN_DOMCTL_MONITOR_OP_DISABLE: >>> /* Check if event type is available. */ >>>

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 2:44 PM, Jan Beulich wrote: switch ( mop->op ) { case XEN_DOMCTL_MONITOR_OP_ENABLE: case XEN_DOMCTL_MONITOR_OP_DISABLE: /* Check if event type is available. */ if ( unlikely(!(arch_monitor_get_capabilities(d) & (1 << mop->event))) )

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Jan Beulich
>>> On 15.02.16 at 13:14, wrote: > On 2/15/2016 1:41 PM, Jan Beulich wrote: > On 15.02.16 at 07:37, wrote: >>> default: >>> -return -EOPNOTSUPP; >>> +/* >>> + * Should not be reached unless

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 2:25 PM, Stefano Stabellini wrote: On Mon, 15 Feb 2016, Jan Beulich wrote: On 15.02.16 at 07:37, wrote: default: -return -EOPNOTSUPP; +/* + * Should not be reached unless arch_monitor_get_capabilities() is not + *

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Stefano Stabellini
On Mon, 15 Feb 2016, Jan Beulich wrote: > >>> On 15.02.16 at 07:37, wrote: > > default: > > -return -EOPNOTSUPP; > > +/* > > + * Should not be reached unless arch_monitor_get_capabilities() is > > not > > + * properly implemented. In

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 1:41 PM, Jan Beulich wrote: +++ b/xen/include/xen/monitor.h @@ -0,0 +1,30 @@ +/* + * include/xen/monitor.h + * + * Common monitor_op domctl handler. + * + * Copyright (c) 2015 Tamas K Lengyel (ta...@tklengyel.com) + * Copyright (c) 2016, Bitdefender S.R.L. + * + * This program is

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 1:41 PM, Jan Beulich wrote: On 15.02.16 at 07:37, wrote: default: -return -EOPNOTSUPP; +/* + * Should not be reached unless arch_monitor_get_capabilities() is not + * properly implemented. In that case, since reaching

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Jan Beulich
>>> On 15.02.16 at 07:37, wrote: > default: > -return -EOPNOTSUPP; > +/* > + * Should not be reached unless arch_monitor_get_capabilities() is > not > + * properly implemented. In that case, since reaching this point does > + *

Re: [Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-15 Thread Corneliu ZUZU
On 2/15/2016 8:37 AM, Corneliu ZUZU wrote: diff --git a/xen/common/monitor.c b/xen/common/monitor.c new file mode 100644 index 000..b708cab --- /dev/null +++ b/xen/common/monitor.c +int rc; +bool_t requested_status = 0; + +if ( unlikely(current->domain == d) ) /* no

[Xen-devel] [PATCH v3 2/2] xen/vm-events: Move parts of monitor_domctl code to common-side.

2016-02-14 Thread Corneliu ZUZU
This patch moves monitor_domctl to common-side. Purpose: move what's common to common, prepare for implementation of such vm-events on ARM. * move get_capabilities to arch-side => arch_monitor_get_capabilities. * add arch-side monitor op handling function => arch_monitor_domctl_op. e.g.