Hi Milky,

On Sat, Dec 27, 2025 at 9:23 AM Milky <[email protected]> wrote:
>
> System is T480s with i5-8250U and Libreboot, booting Qubes R4.2 with Xen 
> 4.17.5.
>
> I’ve tested the following configurations:
>
> 1. `GRUB_CMDLINE_XEN_DEFAULT="cpufreq=xen:performance"` as per [the xen 
> docs](https://xenbits.xen.org/docs/unstable/misc/xen-command-line.html#cpufreq)
> 2. `GRUB_CMDLINE_XEN_DEFAULT="cpufreq=dom0-kernel dom0_vcpus_pin"` as per 
> [the xen 
> wiki](http://wiki.xenproject.org/wiki/Xen_power_management#Domain0_based_cpufreq);
>  tho I suspect this option might be deprecated.
> 3. `GRUB_CMDLINE_XEN_DEFAULT="cpufreq=xen:hwp"`, which should have activated 
> [this patch from the Qubes 
> team](https://github.com/QubesOS/qubes-vmm-xen/pull/158).

The dom0-kernel option is a legacy configuration and doesn't really
work.  You don't want it.  From the logs below, #1 and #3 enable HWP.

>
> In all cases, `cat /proc/cpuinfo` reports the fixed value `cpu Mhz: 1800`, 
> confirmed also using `dmidecode`. `sysbench` in an AppVM with max vcpus 
> consistently reports about 1600 events per second, while the dom0 CPU stats 
> in the previous commands remain unchanged.

Xen domains don't see real-time updates of CPU frequency, so it's
working as intended.  xenpm is the way to query Xen for CPU info.

>`xenpm start 10 | grep 'Avg freq'` reports bizarre values, like `609350368 
>KHz`.

In my testing with HWP, CPU frequency was reported correctly by xenpm.
My 4.8GHz cpu shows 47xx MHz under load, but it would also throttle
down after a bit.

Ok, I previously wrote:
"""
The output of `xenpm get-cpufreq-average`
under HWP looks reasonable for scaling all the way up to 4800MHz
(which can only be hit briefly before throttling down) - I think I've
only seen ~4700MHz as a maximum in my use, and them it may drop to
~4200MHz for extended preiods.  Maybe try that command on your test
system?
"""

That is with the version of HWP upstreamed, which is a later version
than Qubes included in R4.2.

>
> The following commands were also checked:
>
> ```
> $ xenpm get-cpufreq-para
> [CPU0] failed to get cpufreq parameter
> <...>
>
> $ xenpm get-cpufreq-states
> <no output>
>
> $ lsmod | grep 'xen_acpi_processor'
> <no output>
>
> $ modprobe xen_acpi_processor
> modprobe: ERROR: could not insert 'xen_acpi_processor': No such device

Are you sure you are running these commands from dom0?  It looks like
xen_acpi_processor returns -ENODEV/No such device when modprobed from
a domU and not dom0.  You need dom0 to query Xen for this information.

> ```
>
> Based on (this Xen mailing list 
> message)[https://old-list-archives.xen.org/archives/html/xen-devel/2020-01/msg02588.html],
>  the `xen-acpi-processor` module is what enables dom0 to pass critical 
> information to Xen. Thus, it seems a big part of the problem is that 
> `xen-acpi-processor` is refusing to load.
>
> To rule out causes independent of Xen/Qubes, I booted using a Debian Live 
> image. `sysbench` consistently reported 4000 events per second, while 
> `/sys/cpuinfo` reliably showed a jump from 900Mhz to 3.4GHz.
>
> In conclusion, only under Qubes/Xen, something seems to block the scaling 
> drivers from working on this system.
>
> For each of the configurations above, I am pasting the complete output of `xl 
> dmesg`. Let me know if there is anything else I should do.
>
> ```
> ########################################################################
> # `cpufreq=xen:performance`
>
> (XEN) Built-in command line: ept=exec-sp spec-ctrl=unpriv-mmio
>  Xen 4.17.5
> (XEN) Xen version 4.17.5 (mockbuild@[unknown]) (gcc (GCC) 12.3.1 20230508 
> (Red Hat 12.3.1-1)) debug=n Fri Aug 22 16:12:56 CEST 2025

> (XEN) HWP: 1 notify: 1 act-window: 1 energy-perf: 1 pkg-level: 0 peci: 0
> (XEN) HWP: Hardware Duty Cycling (HDC) supported, enabled
> (XEN) HWP: HW_FEEDBACK not supported
> (XEN) Using HWP for cpufreq

HWP enabled

> ########################################################################
> # `cpufreq=dom0-kernel dom0_vcpus_pin`
>
> (XEN) Built-in command line: ept=exec-sp spec-ctrl=unpriv-mmio
>  Xen 4.17.5
> (XEN) Xen version 4.17.5 (mockbuild@[unknown]) (gcc (GCC) 12.3.1 20230508 
> (Red Hat 12.3.1-1)) debug=n Fri Aug 22 16:12:56 CEST 2025

No HWP line.

> ########################################################################
> # `cpufreq=xen:hwp`
>
> (XEN) Built-in command line: ept=exec-sp spec-ctrl=unpriv-mmio
>  Xen 4.17.5
> (XEN) Xen version 4.17.5 (mockbuild@[unknown]) (gcc (GCC) 12.3.1 20230508 
> (Red Hat 12.3.1-1)) debug=n Fri Aug 22 16:12:56 CEST 2025

> (XEN) Command line: placeholder cpufreq=xen:hwp,verbose loglvl=all 
> dom0_mem=min:1024M dom0_mem=max:4096M ucode=scan smt=off 
> gnttab_max_frames=2048 gnttab_max_maptrack_frames=4096 no-real-mode edd=off

> (XEN) HWP: 1 notify: 1 act-window: 1 energy-perf: 1 pkg-level: 0 peci: 0
> (XEN) HWP: Hardware Duty Cycling (HDC) supported, enabled
> (XEN) HWP: HW_FEEDBACK not supported
> (XEN) Using HWP for cpufreq

And HWP enabled again.

Regards,
Jason

Reply via email to