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

Re: [Xen-devel] [PATCH v12 13/23] x86: refactor psr: CDP: implement CPU init flow.



>>> On 04.07.17 at 03:40, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> On 17-06-30 03:18:53, Jan Beulich wrote:
>> >>> Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> 06/30/17 10:05 AM >>>
>> >On 17-06-30 01:33:02, Jan Beulich wrote:
>> >> >>> Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> 06/30/17 9:01 AM >>>
>> >> >This accords to spec:
>> >> >"For CDP operations, COS_MAX_CDP is equal to (CPUID.(EAX=10H, 
>> >> >ECX=1):EDX.COS_MAX_CAT >>1)."
>> >> >
>> >> >HW should make sure it is even number.
>> >> 
>> >> And how about someone using the command line option to shrink the to be 
>> >> used set?
>> >> 
>> >Good question. The command line option saved in 'opt_cos_max', even it is
>> >not even number and less than 'EDX.COS_MAX_CAT' so that the 'cos_max' here 
>> >is
>> >same as it, the right shift operation does not cause any issue I think.
>> >
>> >The description in docs/misc/xen-command-line.markdown is clear that "the 
>> >cos_max
>> >in use will automatically reduce to half when CDP is enabled". E.g. 
>> >'opt_cos_max'
>> >is 5, then we get 2 for CDP. I think user should be aware of this by 
>> >reading the
>> >markdown file.
>> 
>> I don't really follow all this argumentation - what's the problem of simply 
>> subtracting
>> 1 before doing the shift? Talking of which - isn't the general cos_max > 1 
>> also
> 
> There will be problem if we substract 1 before doing the shift for the even
> number. E.g. the original cos_max is 2, (2-1)>>1 will be 0. That is not we
> want. For the odd number, direct right shift is good too. E.g. the original
> cos_max is 3, 3 >> 1 is 1 which is what we want.

What we want is

        raw     CDP
        0       unusable
        1       0
        2       0
        3       1
        4       1
        5       2
        6       2

Other than what you say, for original cos_max = 2 we indeed need
to convert it to 0, or else CDP would use indexes 2 ( = 1 * 2 + 0)
and 3 ( = 1 * 2 + 1), exceeding the mandated upper bound.

>> insufficient for the CDP case?
> 
> We do not need check if cos_max > 1 because the 'cos_max = 0' works for us.
> That means only COS ID 0 can be used. You can see, we use "cos <= cos_max" to
> find COS ID. Of course, the ID 0 saves the default value which cannot be
> overwritten.

Please see the (current) check in init_psr_cat(), which your series
moves into init_psr(). Logically in the CDP case we should require
cos_max >= 3 to have at least one usable COS ID.

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