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

Re: [Xen-devel] [PATCH v4 07/15] x86: implement set value flow for MBA



>>> On 05.10.17 at 10:39, <roger.pau@xxxxxxxxxx> wrote:
> On Thu, Oct 05, 2017 at 04:48:12AM +0000, Yi Sun wrote:
>> On 17-10-03 23:59:46, Jan Beulich wrote:
>> > >>> Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> 09/29/17 4:58 AM >>>
>> > >On 17-09-28 05:36:11, Jan Beulich wrote:
>> > >> >>> On 23.09.17 at 11:48, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
>> > >> > -            feat->cos_reg_val[cos * cos_num + i] = info->val[i];
>> > >> > -            props->write_msr(cos, info->val[i], props->type[i]);
>> > >> > +            if ( feat->cos_reg_val[cos * cos_num + j] != 
>> > >> > val_array[index + 
> j] )
>> > >> > +                feat->cos_reg_val[cos * cos_num + j] =
>> > >> > +                    props->write_msr(cos, val_array[index + j], 
> props->type[j]);
>> > >> 
>> > >> This renders partly useless the check: If hardware can alter the
>> > >> value, repeatedly requesting the same value to be written will
>> > >> no longer guarantee the MSR write to be skipped. If hardware
>> > >> behavior can't be predicted you may want to consider recording
>> > >> both the value in found by reading back the register written and
>> > >> the value that was written - a match with either would eliminate
>> > >> the need to do the write.
>> > >> 
>> > >The hardware behavior is explicitly defined by SDM and mentioned in
>> > >'xl-psr.markdown' and 'intel_psr_mba.pandoc'. User should know that HW
>> > >can alter MBA value if the value is not valid.
>> > 
>> > So if hardware behavior is fully defined, why don't you pre-adjust what is
>> > to be written to the value hardware would alter it to?
>> > 
>> In previous version of MBA patch set, I pre-adjust the value in 
> 'mba_check_thrtl'.
>> But Roger did not like that. So, the pre-adjust codes are removed.
> 
> IMHO it's quite pointless to do such adjustments when the hardware
> performs them already. Also, I fear that our adjustments might get
> out-of-sync in the future with what hardware actually does.
> 
> Maybe the result read back from the hardware (ie: adjusted) can be
> stored and used in order to check whether a new value should be
> written or not when switching? (I think this is the same that Jan
> suggested above).

Not exactly, no - I'd like to avoid the write for _any_ value
resulting in the one currently stored in the hardware register.
Hence my earlier question on whether the transformation
done by hardware is well defined (i.e. _not_ model dependent
or fully defined by CPUID output).

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