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:   Tue, 22 May 2018 10:12:34 +0100
From:   Sudeep Holla <sudeep.holla@....com>
To:     ilialin@...eaurora.org, mturquette@...libre.com, sboyd@...nel.org,
        robh@...nel.org, mark.rutland@....com, viresh.kumar@...aro.org,
        nm@...com, lgirdwood@...il.com, broonie@...nel.org,
        andy.gross@...aro.org, david.brown@...aro.org,
        catalin.marinas@....com, will.deacon@....com, rjw@...ysocki.net,
        linux-clk@...r.kernel.org
Cc:     Sudeep Holla <sudeep.holla@....com>, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
        linux-arm-msm@...r.kernel.org, linux-soc@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org, rnayak@...eaurora.org,
        amit.kucheria@...aro.org, nicolas.dechesne@...aro.org,
        celster@...eaurora.org, tfinkel@...eaurora.org
Subject: Re: [PATCH] cpufreq: Add Kryo CPU scaling driver



On 22/05/18 07:56, ilialin@...eaurora.org wrote:
> 
> 
>> -----Original Message-----
>> From: Sudeep Holla <sudeep.holla@....com>
>> Sent: Monday, May 21, 2018 16:05

[...]

>>
>>
>> That may be true and I am not that bothered about it. But assuming physical
>> ordering from the logical cpu number is *incorrect* and will break if kernel
>> decides to change the allocation algorithm. Kernel provides no guarantee on
>> that, so you need to depend on some physical ID or may be DT to achieve
>> what your want. But the current code as it stands is wrong.
> 
> Got your point. In fact CPUs are numbered 0-3 and ordered into 2 clusters in the DT:
> 
> cpus {
> 	#address-cells = <2>;
> 	#size-cells = <0>;
> 
> 	CPU0: cpu@0 {
> 		...
> 		reg = <0x0 0x0>;
> 		...
> 	};
> 
> 	CPU1: cpu@1 {
> 		...
> 		reg = <0x0 0x1>;
> 		...
> 	};
> 
> 	CPU2: cpu@100 {
> 		...
> 		reg = <0x0 0x100>;
> 		...
> 	};
> 
> 	CPU3: cpu@101 {
> 		...
> 		reg = <0x0 0x101>;
> 		...
> 	};
> 
> 	cpu-map {
> 		cluster0 {
> 			core0 {
> 				cpu = <&CPU0>;
> 			};
> 
> 			core1 {
> 				cpu = <&CPU1>;
> 			};
> 		};
> 
> 		cluster1 {
> 			core0 {
> 				cpu = <&CPU2>;
> 			};
> 
> 			core1 {
> 				cpu = <&CPU3>;
> 			};
> 		};
> 	};
> };
> 
> As far, as I understand, they are probed in the same order. 

Yes that's correct today, will that have to remain same for ever ?
No it's not user ABI and kernel can decide to change the allocation
order. What if for some reason one/more CPUs fails to boot or even
configured not to boot ?

> However, to be certain that the physical CPU is the one I intend to
> configure, I have to fetch the device structure pointer for the cpu-map ->
> clusterX -> core0 -> cpu path. Could you suggest a kernel API to do
> that?
> 

Let's rewind a bit. Do you supply OPPs only on CPU0 and CPU2 ?
If yes, that's again wrong. Simple solution is to parse all logical
CPUs and skip if the share OPPs with some other CPUs. I think that
logic already exists in OPP library IIRC.

-- 
Regards,
Sudeep

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ