[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v8 08/24] x86: refactor psr: set value: implement framework.



>>> Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> 02/27/17 8:06 AM >>>
>On 17-02-26 17:41:43, Wei Liu wrote:
>> On Wed, Feb 15, 2017 at 04:49:23PM +0800, Yi Sun wrote:
>> > +    /*
>> > +     * Step 0:
>> > +     * old_cos means the COS ID current domain is using. By default, it 
>> > is 0.
>> > +     *
>> > +     * For every COS ID, there is a reference count to record how many 
>> > domains
>> > +     * are using the COS register corresponding to this COS ID.
>> > +     * - If ref[old_cos] is 0, that means this COS is not used by any 
>> > domain.
>> > +     * - If ref[old_cos] is 1, that means this COS is only used by current
>> > +     *   domain.
>> > +     * - If ref[old_cos] is more than 1, that mean multiple domains are 
>> > using
>> > +     *   this COS.
>> > +     */
>> > +    old_cos = d->arch.psr_cos_ids[socket];
>> > +    if ( old_cos > MAX_COS_REG_CNT )
>> 
>> How could this happen? This function is the setter of cos, it is a bug
>> if it ever sets a value larger than MAX_COS_REG_CNT.
>> 
>You are right. This should not happen. This check is just a protection. If you
>think it is not necessary, I will remove it.

In which case  - make in an ASSERT() instead of an if().

Jan


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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.