summaryrefslogtreecommitdiff
path: root/target-i386/op_helper.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-30 20:48:25 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2008-05-30 20:48:25 +0000
commitda260249a4109b1ac82016b27973c50f0a74311a (patch)
tree8eee1bfd192fb400174a4a9207349e57e649817b /target-i386/op_helper.c
parentda94d26390b292f2b9d90aee2936d8545364d5a2 (diff)
downloadqemu-da260249a4109b1ac82016b27973c50f0a74311a.tar.gz
kqemu API change - allow use of kqemu with 32 bit QEMU on a 64 bit host
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4628 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'target-i386/op_helper.c')
-rw-r--r--target-i386/op_helper.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/target-i386/op_helper.c b/target-i386/op_helper.c
index bb7661877a..5e78494917 100644
--- a/target-i386/op_helper.c
+++ b/target-i386/op_helper.c
@@ -1950,20 +1950,21 @@ void helper_cpuid(void)
case 0x80000008:
/* virtual & phys address size in low 2 bytes. */
/* XXX: This value must match the one used in the MMU code. */
-#if defined(TARGET_X86_64)
-# if defined(USE_KQEMU)
- EAX = 0x00003020; /* 48 bits virtual, 32 bits physical */
-# else
+ if (env->cpuid_ext2_features & CPUID_EXT2_LM) {
+ /* 64 bit processor */
+#if defined(USE_KQEMU)
+ EAX = 0x00003020; /* 48 bits virtual, 32 bits physical */
+#else
/* XXX: The physical address space is limited to 42 bits in exec.c. */
- EAX = 0x00003028; /* 48 bits virtual, 40 bits physical */
-# endif
+ EAX = 0x00003028; /* 48 bits virtual, 40 bits physical */
+#endif
+ } else {
+#if defined(USE_KQEMU)
+ EAX = 0x00000020; /* 32 bits physical */
#else
-# if defined(USE_KQEMU)
- EAX = 0x00000020; /* 32 bits physical */
-# else
- EAX = 0x00000024; /* 36 bits physical */
-# endif
+ EAX = 0x00000024; /* 36 bits physical */
#endif
+ }
EBX = 0;
ECX = 0;
EDX = 0;
@@ -3158,6 +3159,15 @@ void helper_rdmsr(void)
val = env->kernelgsbase;
break;
#endif
+#ifdef USE_KQEMU
+ case MSR_QPI_COMMBASE:
+ if (env->kqemu_enabled) {
+ val = kqemu_comm_base;
+ } else {
+ val = 0;
+ }
+ break;
+#endif
default:
/* XXX: exception ? */
val = 0;