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

Re: [Xen-devel] [PATCH v10 07/25] x86: refactor psr: L3 CAT: implement get hw info flow.



On 17-04-06 08:04:16, Jan Beulich wrote:
> >>> On 06.04.17 at 13:16, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> > On 17-04-06 02:36:19, Jan Beulich wrote:
> >> >>> On 06.04.17 at 08:05, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> >> > On 17-04-05 09:37:44, Jan Beulich wrote:
> >> >> >>> On 01.04.17 at 15:53, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> >> >> > @@ -183,6 +187,22 @@ static bool feat_init_done(const struct 
> > psr_socket_info *info)
> >> >> >      return false;
> >> >> >  }
> >> >> >  
> >> >> > +static enum psr_feat_type psr_cbm_type_to_feat_type(enum cbm_type 
> >> >> > type)
> >> >> > +{
> >> >> > +    enum psr_feat_type feat_type;
> >> >> > +
> >> >> > +    switch ( type )
> >> >> > +    {
> >> >> > +    case PSR_CBM_TYPE_L3:
> >> >> > +        feat_type = PSR_SOCKET_L3_CAT;
> >> >> > +        break;
> >> >> > +    default:
> >> >> > +        ASSERT_UNREACHABLE();
> >> >> > +    }
> >> >> > +
> >> >> > +    return feat_type;
> >> >> 
> >> >> I'm pretty certain this will (validly) produce an uninitialized variable
> >> >> warning at least in a non-debug build. Not how I did say "add
> >> >> ASSERT_UNREACHABLE()" in the v9 review.
> >> >> 
> >> > Do you mean to init feat_type to 'PSR_SOCKET_MAX_FEAT' and then check it
> >> > at the end of function using ASSERT?
> >> 
> >> That's a (less desirable) option, but what I really mean is take v9
> >> code and _add_ ASSERT_UNREACHABLE() first thing in the default
> >> case.
> > 
> > DYM we should initialize 'feat_type' to a valid value, e.g. 
> > PSR_SOCKET_L3_CAT
> > and keep ASSERT_UNREACHABLE() in default case?
> 
> Yi, please. Did you read my previous reply, where I think I did say
> very precisely what I mean? Why would you pick some random
> valid type here?
> 
Sorry, I mis-understood your intention before. In v9 codes, I defined
'PSR_SOCKET_UNKNOWN' which is returned in default case. I thought you
wanted me to remove it.

I will add ASSERT_UNREACHABLE() and keep 'feat_type = PSR_SOCKET_UNKNOWN;'
in default case.

BRs,
Sun Yi

_______________________________________________
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®.