lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 18 Dec 2017 10:41:12 +0530
From:   Abhishek <huntbag@...ux.vnet.ibm.com>
To:     Viresh Kumar <viresh.kumar@...aro.org>, ego@...ux.vnet.ibm.com
Cc:     rjw@...ysocki.net, benh@...nel.crashing.org, paulus@...ba.org,
        mpe@...erman.id.au, linux-pm@...r.kernel.org,
        linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cpufreq: powernv: Add support of frequency domain

On 12/14/2017 10:12 AM, Viresh Kumar wrote:
> + Gautham,
>
> @Gautham: Can you please help reviewing this one ?
>
> On 13-12-17, 13:49, Abhishek Goel wrote:
>> @@ -693,6 +746,8 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
>>   {
>>   	struct powernv_smp_call_data freq_data;
>>   	unsigned int cur_msec, gpstate_idx;
>> +	cpumask_t temp;
>> +	u32 cpu;
>>   	struct global_pstate_info *gpstates = policy->driver_data;
>>   
>>   	if (unlikely(rebooting) && new_index != get_nominal_index())
>> @@ -761,24 +816,48 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy,
>>   	spin_unlock(&gpstates->gpstate_lock);
>>   
>>   	/*
>> -	 * Use smp_call_function to send IPI and execute the
>> -	 * mtspr on target CPU.  We could do that without IPI
>> -	 * if current CPU is within policy->cpus (core)
>> +	 * Use smp_call_function to send IPI and execute the mtspr on CPU.
>> +	 * This needs to be done on every core of the policy
> Why on each CPU ?
We need to do it in this way as the current implementation takes the max 
of the PMSR of the cores. Thus, when the frequency is required to be 
ramped up, it suffices to write to just the local PMSR, but when the 
frequency is to be ramped down, if we don't send the IPI it breaks the 
compatibility with P8.
>
>>   	 */
>> -	smp_call_function_any(policy->cpus, set_pstate, &freq_data, 1);
>> +	cpumask_copy(&temp, policy->cpus);
>> +
>> +	while (!cpumask_empty(&temp)) {
>> +		cpu = cpumask_first(&temp);
>> +		smp_call_function_any(cpu_sibling_mask(cpu),
>> +					set_pstate, &freq_data, 1);
>> +		cpumask_andnot(&temp, &temp, cpu_sibling_mask(cpu));
>> +	}
>> +
>>   	return 0;
>>   }

Powered by blists - more mailing lists