This RFC adds a Xen-specific virtio-cpufreq device model so a guest
frontend can query the host pCPU frequency of the pCPU that currently
runs a given vCPU.
The guest protocol uses virtio device ID 42, which is not assigned by
the virtio specification or by Linux. Patch 1 defines that ID in
QEMU's imported virtio_ids.h. checkpatch warns that this file is
normally updated via scripts/update-linux-headers.sh; that script
cannot produce ID 42 until the ID exists upstream, so the define is
added by hand for this RFC.
The backend requires each vCPU to be pinned to a unique pCPU. The PCI
device uses two MSI-X vectors so virtio_notify() reaches the Android
frontend we tested against.
This is a port of an AMD qemu-xen device. A companion Linux guest
driver RFC was sent to linux-pm.
Based on work by Meng Zhang.
Baorui.Liu (3):
standard-headers: add experimental VIRTIO_ID_CPUFREQ
hw/virtio: add virtio-cpufreq Xen backend
hw/virtio: give virtio-cpufreq two MSI-X vectors
MAINTAINERS | 7 +
hw/virtio/Kconfig | 5 +
hw/virtio/meson.build | 2 +
hw/virtio/virtio-cpufreq-pci.c | 88 +++++++
hw/virtio/virtio-cpufreq.c | 242 ++++++++++++++++++++
hw/virtio/virtio-pci.c | 3 +
hw/virtio/virtio-qmp.c | 1 +
hw/virtio/virtio.c | 1 +
include/hw/virtio/virtio-cpufreq.h | 23 ++
include/standard-headers/linux/virtio_ids.h | 1 +
10 files changed, 373 insertions(+)
create mode 100644 hw/virtio/virtio-cpufreq-pci.c
create mode 100644 hw/virtio/virtio-cpufreq.c
create mode 100644 include/hw/virtio/virtio-cpufreq.h
--
2.34.1