Commit
f7b87b0745b4 ("enable per-VCPU parameter for RTDS") introduced
a bug: it made it possible, in Credit and Credit2, when doing domain
or vcpu parameters' manipulation, to leave the hypervisor with a
spinlock held and interrupts disabled.
Fix it.
Signed-off-by: Chong Li <chong.li@wustl.edu>
Acked-by: Dario Faggioli <dario.faggioli@citrix.com>
struct csched_dom * const sdom = CSCHED_DOM(d);
struct csched_private *prv = CSCHED_PRIV(ops);
unsigned long flags;
+ int rc = 0;
/* Protect both get and put branches with the pluggable scheduler
* lock. Runq lock not needed anywhere in here. */
sdom->cap = op->u.credit.cap;
break;
default:
- return -EINVAL;
+ rc = -EINVAL;
+ break;
}
spin_unlock_irqrestore(&prv->lock, flags);
- return 0;
+ return rc;
}
static inline void
struct csched2_dom * const sdom = CSCHED2_DOM(d);
struct csched2_private *prv = CSCHED2_PRIV(ops);
unsigned long flags;
+ int rc = 0;
/* Must hold csched2_priv lock to read and update sdom,
* runq lock to update csvcs. */
}
break;
default:
- return -EINVAL;
+ rc = -EINVAL;
+ break;
}
spin_unlock_irqrestore(&prv->lock, flags);
- return 0;
+ return rc;
}
static void *