[lkml]   [2020]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: [PATCH v2 1/2] devfreq: qcom: Add L2 Krait Cache devfreq scaling driver
> Subject: Re: [PATCH v2 1/2] devfreq: qcom: Add L2 Krait Cache devfreq
> scaling driver
> On Tue, Sep 29, 2020 at 06:29:24PM +0200, Ansuel Smith wrote:
> > Qcom L2 Krait CPUs use the generic cpufreq-dt driver and doesn't
> > scale the Cache frequency when the CPU frequency is changed. This
> > devfreq driver register with the cpu notifier and scale the Cache
> > based on the max Freq across all core as the CPU cache is shared across
> > all of them. If provided this also scale the voltage of the regulator
> > attached to the CPU cache. The scaling logic is based on the CPU freq
> > and the 3 scaling interval are set by the device dts.
> >
> I have raised this concern before. I am worried this kind of independent
> CPU and cache frequency controls make way for clkscrew kind of attacks.
> Why can't the clocks be made parent/child or secondary and automatically
> updated when CPU clocks are changed.
> --
> Regards,
> Sudeep

I don't think I understand this fully. Anyway about the clkscrew attack, the
range are set on the dts so unless someone actually wants to have a
system, the range can't be changes at runtime. The devfreq governor is set
immutable and can't be changes AFAIK.

About 'automatically updated when CPU changes', the cache is shared across 2
core and they scale independently. We can be in situation where one cpu is
max and one at idle freq and the cache is set to idle. To fix this at every
the clk should find the max value and I think this would make all the clk
very slow. If you have any suggestion on how I can implement this better,
more than happy to address them. For now, the lack of this kind of cache
make the system really slow since by default the init of the cpu and cache
put them at the lowest frequency and nobody changes that. (we have cpufreq
scaling support but the cache is never actually scaled)

 \ /
  Last update: 2020-09-30 13:57    [W:0.054 / U:8.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site