Commit 4254247b authored by David Dai's avatar David Dai Committed by Treehugger Robot
Browse files

BACKPORT: FROMGIT: cpufreq: add virtual-cpufreq driver

Introduce a virtualized cpufreq driver for guest kernels to improve
performance and power of workloads within VMs.

This driver does two main things:

1. Sends the frequency of vCPUs as a hint to the host. The host uses the
hint to schedule the vCPU threads and decide physical CPU frequency.

2. If a VM does not support a virtualized FIE(like AMUs), it queries the
host CPU frequency by reading a MMIO region of a virtual cpufreq device
to update the guest's frequency scaling factor periodically. This enables
accurate Per-Entity Load Tracking for tasks running in the guest.

Bug: 284367589
Test: Boot up with compatible VMM backend emulation
Link: https://lore.kernel.org/all/20240919000837.1004642-3-davidai@google.com/
(cherry picked from commit 4fd06a53
 git://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git

 cpufreq/arm/linux-next)
[davidai: fixed up mismatches in the cpufreq's exit/remove function prototypes]
Change-Id: I1d212b4ddb56cc35678d5347a11c0c9e24a4d052
Co-developed-by: default avatarSaravana Kannan <saravanak@google.com>
Signed-off-by: default avatarSaravana Kannan <saravanak@google.com>
Signed-off-by: default avatarDavid Dai <davidai@google.com>
Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
parent 843ca406
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment