changeset 9f456b5cc474 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=9f456b5cc474
description:
        config, kvm: Enabling KvmCPU in SE mode
        This patch modifies se.py such that it can now use kvm cpu model.

diffstat:

 configs/example/se.py |  16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diffs (33 lines):

diff -r fe2e2f06a7c8 -r 9f456b5cc474 configs/example/se.py
--- a/configs/example/se.py     Sun Nov 23 18:01:08 2014 -0800
+++ b/configs/example/se.py     Sun Nov 23 18:01:08 2014 -0800
@@ -62,6 +62,13 @@
 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 @@
 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:
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to