summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Dutu <alexandru.dutu@amd.com>2014-11-23 18:01:08 -0800
committerAlexandru Dutu <alexandru.dutu@amd.com>2014-11-23 18:01:08 -0800
commita19cf6943b58d9d76dd7256705394e002500a464 (patch)
tree93ebfd983b40c28bc7c317ccdc9f1fef86f06021
parentf743bdcb6994a4e0e413e1a3499f7424b5ec2efa (diff)
downloadgem5-a19cf6943b58d9d76dd7256705394e002500a464.tar.xz
config, kvm: Enabling KvmCPU in SE mode
This patch modifies se.py such that it can now use kvm cpu model.
-rw-r--r--configs/example/se.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/configs/example/se.py b/configs/example/se.py
index 83eabdc83..eb8448270 100644
--- a/configs/example/se.py
+++ b/configs/example/se.py
@@ -62,6 +62,13 @@ import MemConfig
from Caches import *
from cpu2000 import *
+# Check if KVM support has been enabled, we might need to do VM
+# configuration if that's the case.
+have_kvm_support = 'BaseKvmCPU' in globals()
+def is_kvm_cpu(cpu_class):
+ return have_kvm_support and cpu_class != None and \
+ issubclass(cpu_class, BaseKvmCPU)
+
def get_processes(options):
"""Interprets provided options and returns a list of processes"""
@@ -187,6 +194,15 @@ system.cpu_clk_domain = SrcClockDomain(clock = options.cpu_clock,
for cpu in system.cpu:
cpu.clk_domain = system.cpu_clk_domain
+if is_kvm_cpu(CPUClass) or is_kvm_cpu(FutureClass):
+ if buildEnv['TARGET_ISA'] == 'x86':
+ system.vm = KvmVM()
+ for process in multiprocesses:
+ process.useArchPT = True
+ process.kvmInSE = True
+ else:
+ fatal("KvmCPU can only be used in SE mode with x86")
+
# Sanity check
if options.fastmem:
if CPUClass != AtomicSimpleCPU: