From: "Dr. David Alan Gilbert" <dgilb...@redhat.com> On 32 bit systems fix up phys_bits to be consistent with what we tell the guest; don't ever bother with using the phys_bits property.
Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> --- target-i386/cpu.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/target-i386/cpu.c b/target-i386/cpu.c index d45d2a6..e15abea 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -2609,11 +2609,7 @@ void cpu_x86_cpuid(CPUX86State *env, uint32_t index, uint32_t count, */ *eax = 0x00003000 + cpu->phys_bits; } else { - if (env->features[FEAT_1_EDX] & CPUID_PSE36) { - *eax = 0x00000024; /* 36 bits physical */ - } else { - *eax = 0x00000020; /* 32 bits physical */ - } + *eax = cpu->phys_bits; } *ebx = 0; *ecx = 0; @@ -2990,6 +2986,15 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp) cpu->phys_bits = host_phys_bits; } + } else { + /* For 32 bit systems don't use the user set value, but keep + * phys_bits consistent with what we tell the guest. + */ + if (env->features[FEAT_1_EDX] & CPUID_PSE36) { + cpu->phys_bits = 36; + } else { + cpu->phys_bits = 32; + } } cpu_exec_init(cs, &error_abort); -- 2.7.4