aboutsummaryrefslogtreecommitdiff
path: root/target/mips/helper.c
diff options
context:
space:
mode:
authorJames Hogan <james.hogan@imgtec.com>2017-07-31 14:09:13 +0100
committerYongbok Kim <yongbok.kim@imgtec.com>2017-08-02 22:18:06 +0100
commitd3d93c6c1eb0d94d2f203ac272629e6ebfc468a7 (patch)
tree83d3af6e6b6e4805be622337ebf354b3681b95a5 /target/mips/helper.c
parent6743334568933199927af4992a04bfb3c30610f5 (diff)
mips: Add KVM T&E segment support for TCG
MIPS KVM trap & emulate guest kernels have a different segment layout compared with traditional MIPS kernels, to allow both the user and kernel code to run from the user address segment without repeatedly trapping to KVM. QEMU currently supports this layout only for KVM, but its sometimes useful to be able to run these kernels in QEMU on a PC, so enable it for TCG too. This also paves the way for MIPS KVM VZ support (which uses the normal virtual memory layout) by abstracting whether user mode kernel segments are in use. Suggested-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: James Hogan <james.hogan@imgtec.com> Cc: Yongbok Kim <yongbok.kim@imgtec.com> Cc: Aurelien Jarno <aurelien@aurel32.net> Cc: Paolo Bonzini <pbonzini@redhat.com> Cc: kvm@vger.kernel.org Reviewed-by: Richard Henderson <rth@twiddle.net> [Yongbok Kim: minor change] Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com>
Diffstat (limited to 'target/mips/helper.c')
-rw-r--r--target/mips/helper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/target/mips/helper.c b/target/mips/helper.c
index 05883b9f42..ca39aca08a 100644
--- a/target/mips/helper.c
+++ b/target/mips/helper.c
@@ -19,10 +19,10 @@
#include "qemu/osdep.h"
#include "cpu.h"
-#include "sysemu/kvm.h"
#include "exec/exec-all.h"
#include "exec/cpu_ldst.h"
#include "exec/log.h"
+#include "hw/mips/cpudevs.h"
enum {
TLBRET_XI = -6,
@@ -225,7 +225,7 @@ static int get_physical_address (CPUMIPSState *env, hwaddr *physical,
#define KVM_KSEG0_BASE ((target_ulong)(int32_t)0x40000000UL)
#define KVM_KSEG2_BASE ((target_ulong)(int32_t)0x60000000UL)
- if (kvm_enabled()) {
+ if (mips_um_ksegs_enabled()) {
/* KVM T&E adds guest kernel segments in useg */
if (real_address >= KVM_KSEG0_BASE) {
if (real_address < KVM_KSEG2_BASE) {