* Should -overcommit cpu-pm=on|off be converted to some machine sugar property?
@ 2022-12-19 16:11 Philippe Mathieu-Daudé
2022-12-19 16:23 ` Michael S. Tsirkin
2022-12-20 8:16 ` Paolo Bonzini
0 siblings, 2 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-19 16:11 UTC (permalink / raw)
To: Paolo Bonzini, Michael S. Tsirkin; +Cc: QEMU Developers
Hi Paolo,
I just noticed 'enable_cpu_pm' which seems architecture specific
option that ended into common code:
$ git grep -E 'cpu[_-]pm'
accel/tcg/user-exec-stub.c:5:bool enable_cpu_pm = false;
include/sysemu/sysemu.h:49:extern bool enable_cpu_pm;
Binary file pc-bios/skiboot.lid matches
qemu-options.hx:4196: "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n"
qemu-options.hx:4199: " cpu-pm=on|off controls cpu
power management (default: off)\n",
qemu-options.hx:4204:``-overcommit cpu-pm=on|off``
qemu-options.hx:4214: guest) can be enabled via ``cpu-pm=on``
(disabled by default). This
softmmu/globals.c:38:bool enable_cpu_pm;
softmmu/vl.c:350: .name = "cpu-pm",
softmmu/vl.c:3440: enable_cpu_pm =
qemu_opt_get_bool(opts, "cpu-pm", false);
target/i386/host-cpu.c:44:static void host_cpu_enable_cpu_pm(X86CPU *cpu)
target/i386/host-cpu.c:88: if (cpu->max_features && enable_cpu_pm) {
target/i386/host-cpu.c:89: host_cpu_enable_cpu_pm(cpu);
target/i386/kvm/kvm-cpu.c:43: if (enable_cpu_pm &&
kvm_has_waitpkg()) {
target/i386/kvm/kvm.c:390: if (enable_cpu_pm) {
target/i386/kvm/kvm.c:2576: if (enable_cpu_pm) {
Do we want to maintain this as a generic property or
can it be deprecated / converted to a machine-specific one?
Thanks,
Phil.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Should -overcommit cpu-pm=on|off be converted to some machine sugar property?
2022-12-19 16:11 Should -overcommit cpu-pm=on|off be converted to some machine sugar property? Philippe Mathieu-Daudé
@ 2022-12-19 16:23 ` Michael S. Tsirkin
2022-12-20 8:16 ` Paolo Bonzini
1 sibling, 0 replies; 4+ messages in thread
From: Michael S. Tsirkin @ 2022-12-19 16:23 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: Paolo Bonzini, QEMU Developers
On Mon, Dec 19, 2022 at 05:11:11PM +0100, Philippe Mathieu-Daudé wrote:
> Hi Paolo,
>
> I just noticed 'enable_cpu_pm' which seems architecture specific
> option that ended into common code:
>
> $ git grep -E 'cpu[_-]pm'
> accel/tcg/user-exec-stub.c:5:bool enable_cpu_pm = false;
> include/sysemu/sysemu.h:49:extern bool enable_cpu_pm;
> Binary file pc-bios/skiboot.lid matches
> qemu-options.hx:4196: "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n"
> qemu-options.hx:4199: " cpu-pm=on|off controls cpu power
> management (default: off)\n",
> qemu-options.hx:4204:``-overcommit cpu-pm=on|off``
> qemu-options.hx:4214: guest) can be enabled via ``cpu-pm=on`` (disabled
> by default). This
> softmmu/globals.c:38:bool enable_cpu_pm;
> softmmu/vl.c:350: .name = "cpu-pm",
> softmmu/vl.c:3440: enable_cpu_pm = qemu_opt_get_bool(opts,
> "cpu-pm", false);
> target/i386/host-cpu.c:44:static void host_cpu_enable_cpu_pm(X86CPU *cpu)
> target/i386/host-cpu.c:88: if (cpu->max_features && enable_cpu_pm) {
> target/i386/host-cpu.c:89: host_cpu_enable_cpu_pm(cpu);
> target/i386/kvm/kvm-cpu.c:43: if (enable_cpu_pm && kvm_has_waitpkg())
> {
> target/i386/kvm/kvm.c:390: if (enable_cpu_pm) {
> target/i386/kvm/kvm.c:2576: if (enable_cpu_pm) {
>
> Do we want to maintain this as a generic property or
> can it be deprecated / converted to a machine-specific one?
>
> Thanks,
>
> Phil.
I don't care much.
ATM it only works well if you have a dedicated host CPU and memory, this
is why we put it in -overcommit.
--
MST
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Should -overcommit cpu-pm=on|off be converted to some machine sugar property?
2022-12-19 16:11 Should -overcommit cpu-pm=on|off be converted to some machine sugar property? Philippe Mathieu-Daudé
2022-12-19 16:23 ` Michael S. Tsirkin
@ 2022-12-20 8:16 ` Paolo Bonzini
2022-12-20 14:16 ` Philippe Mathieu-Daudé
1 sibling, 1 reply; 4+ messages in thread
From: Paolo Bonzini @ 2022-12-20 8:16 UTC (permalink / raw)
To: Philippe Mathieu-Daudé; +Cc: Michael S. Tsirkin, QEMU Developers
[-- Attachment #1: Type: text/plain, Size: 1676 bytes --]
It's implemented only for x86, but it is not architecture-dependent. For
example on ARM you would implement it by mapping guest WFx to the host
instructions.
Paolo
Il lun 19 dic 2022, 17:11 Philippe Mathieu-Daudé <philmd@linaro.org> ha
scritto:
> Hi Paolo,
>
> I just noticed 'enable_cpu_pm' which seems architecture specific
> option that ended into common code:
>
> $ git grep -E 'cpu[_-]pm'
> accel/tcg/user-exec-stub.c:5:bool enable_cpu_pm = false;
> include/sysemu/sysemu.h:49:extern bool enable_cpu_pm;
> Binary file pc-bios/skiboot.lid matches
> qemu-options.hx:4196: "-overcommit [mem-lock=on|off][cpu-pm=on|off]\n"
> qemu-options.hx:4199: " cpu-pm=on|off controls cpu
> power management (default: off)\n",
> qemu-options.hx:4204:``-overcommit cpu-pm=on|off``
> qemu-options.hx:4214: guest) can be enabled via ``cpu-pm=on``
> (disabled by default). This
> softmmu/globals.c:38:bool enable_cpu_pm;
> softmmu/vl.c:350: .name = "cpu-pm",
> softmmu/vl.c:3440: enable_cpu_pm =
> qemu_opt_get_bool(opts, "cpu-pm", false);
> target/i386/host-cpu.c:44:static void host_cpu_enable_cpu_pm(X86CPU *cpu)
> target/i386/host-cpu.c:88: if (cpu->max_features && enable_cpu_pm) {
> target/i386/host-cpu.c:89: host_cpu_enable_cpu_pm(cpu);
> target/i386/kvm/kvm-cpu.c:43: if (enable_cpu_pm &&
> kvm_has_waitpkg()) {
> target/i386/kvm/kvm.c:390: if (enable_cpu_pm) {
> target/i386/kvm/kvm.c:2576: if (enable_cpu_pm) {
>
> Do we want to maintain this as a generic property or
> can it be deprecated / converted to a machine-specific one?
>
> Thanks,
>
> Phil.
>
>
[-- Attachment #2: Type: text/html, Size: 2170 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Should -overcommit cpu-pm=on|off be converted to some machine sugar property?
2022-12-20 8:16 ` Paolo Bonzini
@ 2022-12-20 14:16 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2022-12-20 14:16 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: Michael S. Tsirkin, QEMU Developers
On 20/12/22 09:16, Paolo Bonzini wrote:
> It's implemented only for x86, but it is not architecture-dependent. For
> example on ARM you would implement it by mapping guest WFx to the host
> instructions.
OK, thanks for clarifying!
> Hi Paolo,
>
> I just noticed 'enable_cpu_pm' which seems architecture specific
> option that ended into common code:
>
> $ git grep -E 'cpu[_-]pm'
> accel/tcg/user-exec-stub.c:5:bool enable_cpu_pm = false;
> include/sysemu/sysemu.h:49:extern bool enable_cpu_pm;
> Binary file pc-bios/skiboot.lid matches
> qemu-options.hx:4196: "-overcommit
> [mem-lock=on|off][cpu-pm=on|off]\n"
> qemu-options.hx:4199: " cpu-pm=on|off controls cpu
> power management (default: off)\n",
> qemu-options.hx:4204:``-overcommit cpu-pm=on|off``
> qemu-options.hx:4214: guest) can be enabled via ``cpu-pm=on``
> (disabled by default). This
> softmmu/globals.c:38:bool enable_cpu_pm;
> softmmu/vl.c:350: .name = "cpu-pm",
> softmmu/vl.c:3440: enable_cpu_pm =
> qemu_opt_get_bool(opts, "cpu-pm", false);
> target/i386/host-cpu.c:44:static void host_cpu_enable_cpu_pm(X86CPU
> *cpu)
> target/i386/host-cpu.c:88: if (cpu->max_features && enable_cpu_pm) {
> target/i386/host-cpu.c:89: host_cpu_enable_cpu_pm(cpu);
> target/i386/kvm/kvm-cpu.c:43: if (enable_cpu_pm &&
> kvm_has_waitpkg()) {
> target/i386/kvm/kvm.c:390: if (enable_cpu_pm) {
> target/i386/kvm/kvm.c:2576: if (enable_cpu_pm) {
>
> Do we want to maintain this as a generic property or
> can it be deprecated / converted to a machine-specific one?
>
> Thanks,
>
> Phil.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-20 14:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-19 16:11 Should -overcommit cpu-pm=on|off be converted to some machine sugar property? Philippe Mathieu-Daudé
2022-12-19 16:23 ` Michael S. Tsirkin
2022-12-20 8:16 ` Paolo Bonzini
2022-12-20 14:16 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).