[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 5/6] x86: fix up 32 bit phys_bits case
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[Qemu-devel] [PATCH v2 5/6] x86: fix up 32 bit phys_bits case |
Date: |
Mon, 4 Jul 2016 20:16:08 +0100 |
From: "Dr. David Alan Gilbert" <address@hidden>
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 <address@hidden>
---
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
- Re: [Qemu-devel] [PATCH v2 2/6] x86: Mask mtrr mask based on CPU physical address limits, (continued)
[Qemu-devel] [PATCH v2 6/6] x86: Add sanity checks on phys_bits, Dr. David Alan Gilbert (git), 2016/07/04
Re: [Qemu-devel] [PATCH v2 0/6] x86: Physical address limit patches, Michael S. Tsirkin, 2016/07/04