>>> On 26.02.19 at 14:25, <andrew.coop...@citrix.com> wrote:
> On 26/02/2019 13:12, Igor Druzhinin wrote:
> 
>> @@ -323,6 +327,10 @@ static void setup_p6_watchdog(unsigned counter)
>>      unsigned int evntsel;
>>  
>>      nmi_perfctr_msr = MSR_P6_PERFCTR(0);
>> +    if ( current_cpu_data.cpuid_level >= 0xa )
>> +        nmi_p6_event_width = MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK);
>> +    if ( !nmi_p6_event_width )
>> +        nmi_p6_event_width = P6_EVENT_WIDTH_DEFAULT;
> 
> This is called on each cpu, but writes to a shared variable.  This
> entire block wants to be something like:
> 
> if ( !nmi_p6_event_width )
>     nmi_p6_event_width = (current_cpu_data.cpuid_level >= 0xa) ?
> MASK_EXTR(cpuid_eax(0xa), P6_EVENT_WIDTH_MASK) : P6_EVENT_WIDTH_DEFAULT;
> 
> (suitably wrapped) so it gets filled only once.

Plus the low and high capping of the value read, as requested in
reply to v1.

Jan



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reply via email to