[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/10] mips/kvm: Init EBase to correct KSEG0
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 01/10] mips/kvm: Init EBase to correct KSEG0 |
Date: |
Wed, 9 Jul 2014 17:59:28 +0200 |
From: James Hogan <address@hidden>
The EBase CP0 register is initialised to 0x80000000, however with KVM
the guest's KSEG0 is at 0x40000000. The incorrect value doesn't get
passed to KVM yet as KVM doesn't implement the EBase register, however
we should set it correctly now so as not to break migration/loadvm to a
future version of QEMU that does support EBase.
Cc: Aurelien Jarno <address@hidden>
Cc: Paolo Bonzini <address@hidden>
Signed-off-by: James Hogan <address@hidden>
Reviewed-by: Aurelien Jarno <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
target-mips/translate.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/target-mips/translate.c b/target-mips/translate.c
index 2f91959..d7b8c4d 100644
--- a/target-mips/translate.c
+++ b/target-mips/translate.c
@@ -28,6 +28,7 @@
#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
+#include "sysemu/kvm.h"
#define MIPS_DEBUG_DISAS 0
//#define MIPS_DEBUG_SIGN_EXTENSIONS
@@ -16076,7 +16077,12 @@ void cpu_state_reset(CPUMIPSState *env)
env->CP0_Random = env->tlb->nb_tlb - 1;
env->tlb->tlb_in_use = env->tlb->nb_tlb;
env->CP0_Wired = 0;
- env->CP0_EBase = 0x80000000 | (cs->cpu_index & 0x3FF);
+ env->CP0_EBase = (cs->cpu_index & 0x3FF);
+ if (kvm_enabled()) {
+ env->CP0_EBase |= 0x40000000;
+ } else {
+ env->CP0_EBase |= 0x80000000;
+ }
env->CP0_Status = (1 << CP0St_BEV) | (1 << CP0St_ERL);
/* vectored interrupts not implemented, timer on int 7,
no performance counters. */
--
1.8.3.1
- [Qemu-devel] [PULL for-2.1 00/10] KVM changes (+ misc small fixes) for 2.1, Paolo Bonzini, 2014/07/09
- [Qemu-devel] [PULL 01/10] mips/kvm: Init EBase to correct KSEG0,
Paolo Bonzini <=
- [Qemu-devel] [PULL 03/10] mips_malta: Remove incorrect KVM T&E references, Paolo Bonzini, 2014/07/09
- [Qemu-devel] [PULL 02/10] mips_malta: Change default KVM cpu to 24Kc (no FP), Paolo Bonzini, 2014/07/09
- [Qemu-devel] [PULL 04/10] mips_malta: Catch kernels linked at wrong address, Paolo Bonzini, 2014/07/09
- [Qemu-devel] [PULL 06/10] Enforce stack protector usage, Paolo Bonzini, 2014/07/09
- Re: [Qemu-devel] [PULL for-2.1 00/10] KVM changes (+ misc small fixes) for 2.1, Paolo Bonzini, 2014/07/09
- [Qemu-devel] [PULL 10/10] qtest: fix vhost-user-test compilation with old GLib, Paolo Bonzini, 2014/07/09
- [Qemu-devel] [PULL 09/10] mc146818rtc: register the clock reset notifier on the right clock, Paolo Bonzini, 2014/07/09
- [Qemu-devel] [PULL 05/10] watchdog: fix deadlock with -watchdog-action pause, Paolo Bonzini, 2014/07/09
- [Qemu-devel] [PULL 08/10] oslib-posix: Fix new compiler error with -Wclobbered, Paolo Bonzini, 2014/07/10
- [Qemu-devel] [PULL 07/10] target-i386: Add "kvmclock-stable-bit" feature bit name, Paolo Bonzini, 2014/07/10