[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL 08/46] target/i386: do not set LM for 32-bit emulation "-cpu host/

From: Paolo Bonzini
Subject: [PULL 08/46] target/i386: do not set LM for 32-bit emulation "-cpu host/max"
Date: Mon, 8 Feb 2021 19:22:53 +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

   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 ae89024d36..e775e9abb5 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5073,6 +5073,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;
+    }
     if (migratable_only) {
         r &= x86_cpu_get_migratable_flags(w);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]