From: Ying Fang <fangyi...@huawei.com> 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. Ying Fang (4): acpi: add aml_generic_register acpi/cppc: add ACPI CPPC registers arm_virt: add the cpufreq device model arm_virt: create the cpufreq device default-configs/aarch64-softmmu.mak | 1 + hw/acpi/Kconfig | 4 + hw/acpi/Makefile.objs | 1 + hw/acpi/aml-build.c | 22 +++ hw/acpi/cpufreq.c | 247 ++++++++++++++++++++++++++++ hw/arm/virt-acpi-build.c | 74 ++++++++- hw/arm/virt.c | 14 ++ include/hw/acpi/acpi-defs.h | 32 ++++ include/hw/acpi/aml-build.h | 3 + include/hw/arm/virt.h | 1 + 10 files changed, 397 insertions(+), 2 deletions(-) create mode 100644 hw/acpi/cpufreq.c -- 2.19.1