[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/32] target/i386/cpu: Fix CPUID_HT exposure
From: |
Paolo Bonzini |
Subject: |
[PULL 04/32] target/i386/cpu: Fix CPUID_HT exposure |
Date: |
Wed, 18 Oct 2023 10:27:24 +0200 |
From: Xiaoyao Li <xiaoyao.li@intel.com>
When explicitly booting a multiple vcpus vm with "-cpu +ht", it gets
warning of
warning: host doesn't support requested feature: CPUID.01H:EDX.ht [bit 28]
Make CPUID_HT as supported unconditionally can resolve the warning.
However it introduces another issue that it also expose CPUID_HT to
guest when "-cpu host/max" with only 1 vcpu. To fix this, need mark
CPUID_HT as the no_autoenable_flags.
Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20231010060539.210258-1-xiaoyao.li@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.c | 1 +
target/i386/kvm/kvm.c | 2 ++
2 files changed, 3 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 3aab05ddadc..bdca901dfaa 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -778,6 +778,7 @@ FeatureWordInfo feature_word_info[FEATURE_WORDS] = {
},
.cpuid = {.eax = 1, .reg = R_EDX, },
.tcg_features = TCG_FEATURES,
+ .no_autoenable_flags = CPUID_HT,
},
[FEAT_1_ECX] = {
.type = CPUID_FEATURE_WORD,
diff --git a/target/i386/kvm/kvm.c b/target/i386/kvm/kvm.c
index f6c7f7e2686..ab72bcdfad1 100644
--- a/target/i386/kvm/kvm.c
+++ b/target/i386/kvm/kvm.c
@@ -373,6 +373,8 @@ uint32_t kvm_arch_get_supported_cpuid(KVMState *s, uint32_t
function,
if (function == 1 && reg == R_EDX) {
/* KVM before 2.6.30 misreports the following features */
ret |= CPUID_MTRR | CPUID_PAT | CPUID_MCE | CPUID_MCA;
+ /* KVM never reports CPUID_HT but QEMU can support when vcpus > 1 */
+ ret |= CPUID_HT;
} else if (function == 1 && reg == R_ECX) {
/* We can set the hypervisor flag, even if KVM does not return it on
* GET_SUPPORTED_CPUID
--
2.41.0
- [PULL 00/32] x86 and build system changes for 2023-10-18, Paolo Bonzini, 2023/10/18
- [PULL 01/32] iotests: get rid of '..' in path environment output, Paolo Bonzini, 2023/10/18
- [PULL 03/32] Revert "configure: Add workaround for ccache and clang", Paolo Bonzini, 2023/10/18
- [PULL 05/32] target/i386: check intercept for XSETBV, Paolo Bonzini, 2023/10/18
- [PULL 06/32] tests/vm: netbsd: install dtc, Paolo Bonzini, 2023/10/18
- [PULL 02/32] iotests: use the correct python to run linters, Paolo Bonzini, 2023/10/18
- [PULL 07/32] scripts: Mark feature_to_c.py as non-executable to fix a build issue, Paolo Bonzini, 2023/10/18
- [PULL 08/32] scripts/get_maintainer.pl: don't print parentheses, Paolo Bonzini, 2023/10/18
- [PULL 09/32] tests/docker: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 04/32] target/i386/cpu: Fix CPUID_HT exposure,
Paolo Bonzini <=
- [PULL 10/32] docs/sphinx: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 11/32] target/hexagon: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 12/32] tests/avocado: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 13/32] tests/vm: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 17/32] meson, cutils: allow non-relocatable installs, Paolo Bonzini, 2023/10/18
- [PULL 14/32] tracetool: avoid invalid escape in Python string, Paolo Bonzini, 2023/10/18
- [PULL 16/32] meson: do not use set10, Paolo Bonzini, 2023/10/18
- [PULL 15/32] meson: do not build shaders by default, Paolo Bonzini, 2023/10/18
- [PULL 19/32] hw/xen: cleanup sourcesets, Paolo Bonzini, 2023/10/18