[Top][All Lists]

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

Re: [PATCH v2 0/4] arm64: Add the cpufreq device to show cpufreq info to

From: fangying
Subject: Re: [PATCH v2 0/4] arm64: Add the cpufreq device to show cpufreq info to guest
Date: Thu, 13 Feb 2020 22:37:48 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 2020/2/13 16:18, Andrew Jones wrote:
On Thu, Feb 13, 2020 at 03:36:26PM +0800, Ying Fang wrote:
On ARM64 platform, cpu frequency is retrieved via ACPI CPPC.
A virtual cpufreq device based on ACPI CPPC is created to
present cpu frequency info to the guest.

The default frequency is set to host cpu nominal frequency,
which is obtained from the host CPPC sysfs. Other performance
data are set to the same value, since we don't support guest
performance scaling here.

Performance counters are also not emulated and they simply
return 1 if read, and guest should fallback to use desired
performance value as the current performance.

Guest kernel version above 4.18 is required to make it work.

This is v2 of the series, but I don't see a changelog.

Hi Andrew, please forgive my carelessness, I forget to add the changelog here.
Actually v2 is slightly modified with a few fixes for compilation
warning and a commit message.

Can you please describe the motivation for this? If I understand
correctly, all of this is just to inform the guest of the host's
CPU0 nominal or max (if nominal isn't present?) frequency. Why
do that?

Yes, you are right.

The motivation is that there seems no other formal way than the CPPC
feature for arm64 to present cpu frequency info to the OS. However on
x86 platform we have the CPUID method to do that. Some of our VM customers
and cloud developers want that information to do something. So we come up
with the virtual cpufreq device way.

What happens if the guest migrates somewhere where the
frequency is different?

If the guest is migrated to any host where the frequency is different,
a next read on the CPPC related register may return the new cpufreq info.

If this is for a special use case, then
why not come up with a different channel (guest agent?) to pass
this information?

Maybe some userspace apps need it to do perf tuning or they
want to know the accurate cpu nominal frequency by using tools
like lshw.

We use the CPPC cpufreq way because we think this is a much more
standard way to do that.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]