[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 08/36] target/i386: do not set LM for 32-bit emulation "-cpu host/
From: |
Paolo Bonzini |
Subject: |
[PULL 08/36] target/i386: do not set LM for 32-bit emulation "-cpu host/max" |
Date: |
Fri, 29 Jan 2021 12:17:46 +0100 |
32-bit targets by definition do not support long mode; therefore, the
bit must be masked in the features supported by the accelerator.
As a side effect, this avoids setting up the 0x80000008 CPUID leaf
for
qemu-system-i386 -cpu host
which since commit 5a140b255d ("x86/cpu: Use max host physical address
if -cpu max option is applied") would have printed this error:
qemu-system-i386: phys-bits should be between 32 and 36 (but is 48)
Reported-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
target/i386/cpu.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 72a79e6019..2b2c1c5389 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5081,6 +5081,11 @@ static uint64_t
x86_cpu_get_supported_feature_word(FeatureWord w,
} else {
return ~0;
}
+#ifndef TARGET_X86_64
+ if (w == FEAT_8000_0001_EDX) {
+ r &= ~CPUID_EXT2_LM;
+ }
+#endif
if (migratable_only) {
r &= x86_cpu_get_migratable_flags(w);
}
--
2.29.2
- [PULL 00/36] Misc patches (buildsys, i386, fuzzing) for 2021-01-29, Paolo Bonzini, 2021/01/29
- [PULL 01/36] fuzz: ignore address_space_map is_write flag, Paolo Bonzini, 2021/01/29
- [PULL 02/36] fuzz: refine the ide/ahci fuzzer configs, Paolo Bonzini, 2021/01/29
- [PULL 04/36] fuzz: log the arguments used to initialize QEMU, Paolo Bonzini, 2021/01/29
- [PULL 05/36] fuzz: enable dynamic args for generic-fuzz configs, Paolo Bonzini, 2021/01/29
- [PULL 08/36] target/i386: do not set LM for 32-bit emulation "-cpu host/max",
Paolo Bonzini <=
- [PULL 09/36] machine: add missing doc for memory-backend option, Paolo Bonzini, 2021/01/29
- [PULL 03/36] docs/fuzz: fix pre-meson path, Paolo Bonzini, 2021/01/29
- [PULL 06/36] docs/fuzz: add some information about OSS-Fuzz, Paolo Bonzini, 2021/01/29
- [PULL 07/36] fuzz: add virtio-9p configurations for fuzzing, Paolo Bonzini, 2021/01/29
- [PULL 10/36] meson: accept either shared or static libraries if --disable-static, Paolo Bonzini, 2021/01/29
- [PULL 12/36] x86/cpu: Populate SVM CPUID feature bits, Paolo Bonzini, 2021/01/29
- [PULL 16/36] event_notifier: handle initialization failure better, Paolo Bonzini, 2021/01/29
- [PULL 14/36] docs: don't install corresponding man page if guest agent is disabled, Paolo Bonzini, 2021/01/29
- [PULL 11/36] meson: honor --enable-rbd if cc.links test fails, Paolo Bonzini, 2021/01/29
- [PULL 17/36] target/i386: Fix decoding of certain BMI instructions, Paolo Bonzini, 2021/01/29