[PATCH V3 0/2] improve -overcommit cpu-pm=on|off

2024-06-03 Thread Zide Chen
x27;t set CPUID_EXT_MONITOR in kvm_cpu_realizefn() Zide Chen (2): vl: Allow multiple -overcommit commands target/i386: Advertise MWAIT iff host supports system/vl.c | 4 ++-- target/i386/host-cpu.c| 12 target/i386/kvm/kvm-cpu.c | 11 +-- 3 files changed,

[PATCH V3 1/2] vl: Allow multiple -overcommit commands

2024-06-03 Thread Zide Chen
n the following example, the cpu-pm command is quietly overwritten, and it's not easy to notice it without careful inspection. --overcommit mem-lock=on --overcommit cpu-pm=on Fixes: c8c9dc42b7ca ("Remove the deprecated -realtime option") Suggested-by: Thomas Huth Signed-off-by: Zi

[PATCH V3 2/2] target/i386: Advertise MWAIT iff host supports

2024-06-03 Thread Zide Chen
to kvm_cpu_realizefn(). Fixes: f5cc5a5c1686 ("i386: split cpu accelerators from cpu.c, using AccelCPUClass") Fixes: 662175b91ff2 ("i386: reorder call to cpu_exec_realizefn") Signed-off-by: Zide Chen --- V3: - don't set CPUID_EXT_MONITOR in kvm_cpu_realizefn(). - Change title t

[PATCH V2 0/3] improve -overcommit cpu-pm=on|off

2024-05-24 Thread Zide Chen
Currently, if running "-overcommit cpu-pm=on" on hosts that don't have MWAIT support, the MWAIT/MONITOR feature is advertised to the guest and executing MWAIT/MONITOR on the guest triggers #UD. V2: - [PATCH 1]: took Thomas' suggestion for more generic fix - [PATCH 2/3]: no c

[PATCH V2 3/3] target/i386: Move host_cpu_enable_cpu_pm into kvm_cpu_realizefn()

2024-05-24 Thread Zide Chen
u.c, using AccelCPUClass") Signed-off-by: Zide Chen --- target/i386/host-cpu.c| 12 target/i386/kvm/kvm-cpu.c | 11 +-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/target/i386/host-cpu.c b/target/i386/host-cpu.c index 280e427c017c..8b8bf5afeccf 1006

[PATCH V2 2/3] target/i386: call cpu_exec_realizefn before x86_cpu_filter_features

2024-05-24 Thread Zide Chen
y add CPUID_EXT_MONITOR. Thus, call cpu_exec_realizefn before x86_cpu_filter_features to ensure that it won't expose features not supported by the host. Fixes: 662175b91ff2 ("i386: reorder call to cpu_exec_realizefn") Suggested-by: Xiaoyao Li Signed-off-by: Zide Chen --- target/i38

[PATCH V2 1/3] vl: Allow multiple -overcommit commands

2024-05-24 Thread Zide Chen
n the following example, the cpu-pm command is quietly overwritten, and it's not easy to notice it without careful inspection. --overcommit mem-lock=on --overcommit cpu-pm=on Fixes: c8c9dc42b7ca ("Remove the deprecated -realtime option") Suggested-by: Thomas Huth Signed-off-by: Zide Ch

[PATCH 2/3] target/i386: call cpu_exec_realizefn before x86_cpu_filter_features

2024-05-20 Thread Zide Chen
y add CPUID_EXT_MONITOR. Thus, call cpu_exec_realizefn before x86_cpu_filter_features to ensure that it won't expose features not supported by the host. Fixes: 662175b91ff2 ("i386: reorder call to cpu_exec_realizefn") Suggested-by: Xiaoyao Li Signed-off-by: Zide Chen --- target/i38

[PATCH 0/3] improve -overcommit cpu-pm=on|off

2024-05-20 Thread Zide Chen
Currently, if running "-overcommit cpu-pm=on" on hosts that don't have MWAIT support, the MWAIT/MONITOR feature is advertised to the guest and executing MWAIT/MONITOR on the guest triggers #UD. Zide Chen (3): vl: Allow multiple -overcommit commands target/i386: call cpu_exec_r

[PATCH 1/3] vl: Allow multiple -overcommit commands

2024-05-20 Thread Zide Chen
n the following example, the cpu-pm command is quietly overwritten, and it's not easy to notice it without careful inspection. --overcommit mem-lock=on --overcommit cpu-pm=on Fixes: c8c9dc42b7ca ("Remove the deprecated -realtime option") Signed-off-by: Zide Chen --- system/vl.c

[PATCH 3/3] target/i386: Move host_cpu_enable_cpu_pm into kvm_cpu_realizefn()

2024-05-20 Thread Zide Chen
u.c, using AccelCPUClass") Signed-off-by: Zide Chen --- target/i386/host-cpu.c| 12 target/i386/kvm/kvm-cpu.c | 11 +-- 2 files changed, 9 insertions(+), 14 deletions(-) diff --git a/target/i386/host-cpu.c b/target/i386/host-cpu.c index 280e427c017c..8b8bf5afeccf 1006