xref: /qemu/docs/tools/qemu-vmsr-helper.rst (revision 2eefd4fcec4b8fe41ceee2a8f00cdec1fe81b75c)
184369d76SAnthony Harivel==================================
284369d76SAnthony HarivelQEMU virtual RAPL MSR helper
384369d76SAnthony Harivel==================================
484369d76SAnthony Harivel
584369d76SAnthony HarivelSynopsis
684369d76SAnthony Harivel--------
784369d76SAnthony Harivel
884369d76SAnthony Harivel**qemu-vmsr-helper** [*OPTION*]
984369d76SAnthony Harivel
1084369d76SAnthony HarivelDescription
1184369d76SAnthony Harivel-----------
1284369d76SAnthony Harivel
1384369d76SAnthony HarivelImplements the virtual RAPL MSR helper for QEMU.
1484369d76SAnthony Harivel
1584369d76SAnthony HarivelAccessing the RAPL (Running Average Power Limit) MSR enables the RAPL powercap
1684369d76SAnthony Hariveldriver to advertise and monitor the power consumption or accumulated energy
1784369d76SAnthony Harivelconsumption of different power domains, such as CPU packages, DRAM, and other
1884369d76SAnthony Harivelcomponents when available.
1984369d76SAnthony Harivel
20*24c32ed3SStefan WeilHowever those registers are accessible under privileged access (CAP_SYS_RAWIO).
21*24c32ed3SStefan WeilQEMU can use an external helper to access those privileged registers.
2284369d76SAnthony Harivel
2384369d76SAnthony Harivel:program:`qemu-vmsr-helper` is that external helper; it creates a listener
2484369d76SAnthony Harivelsocket which will accept incoming connections for communication with QEMU.
2584369d76SAnthony Harivel
2684369d76SAnthony HarivelIf you want to run VMs in a setup like this, this helper should be started as a
2784369d76SAnthony Harivelsystem service, and you should read the QEMU manual section on "RAPL MSR
2884369d76SAnthony Harivelsupport" to find out how to configure QEMU to connect to the socket created by
2984369d76SAnthony Harivel:program:`qemu-vmsr-helper`.
3084369d76SAnthony Harivel
3184369d76SAnthony HarivelAfter connecting to the socket, :program:`qemu-vmsr-helper` can
3284369d76SAnthony Hariveloptionally drop root privileges, except for those capabilities that
3384369d76SAnthony Harivelare needed for its operation.
3484369d76SAnthony Harivel
3584369d76SAnthony Harivel:program:`qemu-vmsr-helper` can also use the systemd socket activation
3684369d76SAnthony Harivelprotocol.  In this case, the systemd socket unit should specify a
3784369d76SAnthony HarivelUnix stream socket, like this::
3884369d76SAnthony Harivel
3984369d76SAnthony Harivel    [Socket]
4084369d76SAnthony Harivel    ListenStream=/var/run/qemu-vmsr-helper.sock
4184369d76SAnthony Harivel
4284369d76SAnthony HarivelOptions
4384369d76SAnthony Harivel-------
4484369d76SAnthony Harivel
4584369d76SAnthony Harivel.. program:: qemu-vmsr-helper
4684369d76SAnthony Harivel
4784369d76SAnthony Harivel.. option:: -d, --daemon
4884369d76SAnthony Harivel
4984369d76SAnthony Harivel  run in the background (and create a PID file)
5084369d76SAnthony Harivel
5184369d76SAnthony Harivel.. option:: -q, --quiet
5284369d76SAnthony Harivel
5384369d76SAnthony Harivel  decrease verbosity
5484369d76SAnthony Harivel
5584369d76SAnthony Harivel.. option:: -v, --verbose
5684369d76SAnthony Harivel
5784369d76SAnthony Harivel  increase verbosity
5884369d76SAnthony Harivel
5984369d76SAnthony Harivel.. option:: -f, --pidfile=PATH
6084369d76SAnthony Harivel
6184369d76SAnthony Harivel  PID file when running as a daemon. By default the PID file
6284369d76SAnthony Harivel  is created in the system runtime state directory, for example
6384369d76SAnthony Harivel  :file:`/var/run/qemu-vmsr-helper.pid`.
6484369d76SAnthony Harivel
6584369d76SAnthony Harivel.. option:: -k, --socket=PATH
6684369d76SAnthony Harivel
6784369d76SAnthony Harivel  path to the socket. By default the socket is created in
6884369d76SAnthony Harivel  the system runtime state directory, for example
6984369d76SAnthony Harivel  :file:`/var/run/qemu-vmsr-helper.sock`.
7084369d76SAnthony Harivel
7184369d76SAnthony Harivel.. option:: -T, --trace [[enable=]PATTERN][,events=FILE][,file=FILE]
7284369d76SAnthony Harivel
7384369d76SAnthony Harivel  .. include:: ../qemu-option-trace.rst.inc
7484369d76SAnthony Harivel
7584369d76SAnthony Harivel.. option:: -u, --user=USER
7684369d76SAnthony Harivel
7784369d76SAnthony Harivel  user to drop privileges to
7884369d76SAnthony Harivel
7984369d76SAnthony Harivel.. option:: -g, --group=GROUP
8084369d76SAnthony Harivel
8184369d76SAnthony Harivel  group to drop privileges to
8284369d76SAnthony Harivel
8384369d76SAnthony Harivel.. option:: -h, --help
8484369d76SAnthony Harivel
8584369d76SAnthony Harivel  Display a help message and exit.
8684369d76SAnthony Harivel
8784369d76SAnthony Harivel.. option:: -V, --version
8884369d76SAnthony Harivel
8984369d76SAnthony Harivel  Display version information and exit.
90