All of lore.kernel.org
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@eu.citrix.com>
To: Meng Xu <mengxu@cis.upenn.edu>, xen-devel@lists.xen.org
Cc: ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com,
	dario.faggioli@citrix.com, ian.jackson@eu.citrix.com,
	xumengpanda@gmail.com, JBeulich@suse.com
Subject: Re: [PATCH for Xen 4.5 v2 1/2] xen: sanity check input and serialization in sched_rt.c
Date: Mon, 10 Nov 2014 12:54:18 +0000	[thread overview]
Message-ID: <5460B57A.5050601@eu.citrix.com> (raw)
In-Reply-To: <1414246599-3914-2-git-send-email-mengxu@cis.upenn.edu>

On 10/25/2014 03:16 PM, Meng Xu wrote:
> Sanity check input params in rt_dom_cntl();
> Serialize rt_dom_cntl() against the global lock.
>
> Signed-off-by: Meng Xu <mengxu@cis.upenn.edu>

Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>

Thanks,
  -George

> ---
>   xen/common/sched_rt.c |    9 +++++++++
>   1 file changed, 9 insertions(+)
>
> diff --git a/xen/common/sched_rt.c b/xen/common/sched_rt.c
> index 6c8faeb..b87c95b 100644
> --- a/xen/common/sched_rt.c
> +++ b/xen/common/sched_rt.c
> @@ -1042,9 +1042,11 @@ rt_dom_cntl(
>       struct domain *d,
>       struct xen_domctl_scheduler_op *op)
>   {
> +    struct rt_private *prv = rt_priv(ops);
>       struct rt_dom * const sdom = rt_dom(d);
>       struct rt_vcpu *svc;
>       struct list_head *iter;
> +    unsigned long flags;
>       int rc = 0;
>   
>       switch ( op->cmd )
> @@ -1055,12 +1057,19 @@ rt_dom_cntl(
>           op->u.rtds.budget = svc->budget / MICROSECS(1);
>           break;
>       case XEN_DOMCTL_SCHEDOP_putinfo:
> +        if ( op->u.rtds.period == 0 || op->u.rtds.budget == 0 )
> +        {
> +            rc = -EINVAL;
> +            break;
> +        }
> +        spin_lock_irqsave(&prv->lock, flags);
>           list_for_each( iter, &sdom->vcpu )
>           {
>               struct rt_vcpu * svc = list_entry(iter, struct rt_vcpu, sdom_elem);
>               svc->period = MICROSECS(op->u.rtds.period); /* transfer to nanosec */
>               svc->budget = MICROSECS(op->u.rtds.budget);
>           }
> +        spin_unlock_irqrestore(&prv->lock, flags);
>           break;
>       }
>   

  parent reply	other threads:[~2014-11-10 12:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-25 14:16 Sanity check input and serialize vcpu data in sched_rt.c Meng Xu
2014-10-25 14:16 ` [PATCH for Xen 4.5 v2 1/2] xen: sanity check input and serialization " Meng Xu
2014-10-29  9:41   ` Dario Faggioli
2014-10-29 14:27     ` Meng Xu
2014-11-10 12:54   ` George Dunlap [this message]
2014-10-25 14:16 ` [PATCH for Xen 4.5 v2 2/2] xen: serialize vcpu data " Meng Xu
2014-10-29  9:26   ` Dario Faggioli
2014-11-10 12:53   ` George Dunlap
2014-11-10 15:29     ` Meng Xu
2014-11-10 15:36       ` Dario Faggioli
2014-11-10 15:38         ` George Dunlap
2014-11-10 15:40       ` George Dunlap
2014-11-10 16:04         ` Meng Xu
2014-11-10 16:15           ` George Dunlap
2014-10-29 10:06 ` Sanity check input and " Dario Faggioli
2014-10-29 14:23   ` Meng Xu
2014-10-29 17:52     ` Konrad Rzeszutek Wilk

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=5460B57A.5050601@eu.citrix.com \
    --to=george.dunlap@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=dario.faggioli@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=mengxu@cis.upenn.edu \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xen.org \
    --cc=xumengpanda@gmail.com \
    /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.