summaryrefslogtreecommitdiff
path: root/tests/configs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/configs')
-rw-r--r--tests/configs/base_config.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/configs/base_config.py b/tests/configs/base_config.py
index 370b76c46..b4c400a45 100644
--- a/tests/configs/base_config.py
+++ b/tests/configs/base_config.py
@@ -43,6 +43,8 @@ m5.util.addToPath('../configs/common')
import FSConfig
from Caches import *
+_have_kvm_support = 'BaseKvmCPU' in globals()
+
class BaseSystem(object):
"""Base system builder.
@@ -111,6 +113,14 @@ class BaseSystem(object):
"""
cpu.createInterruptController()
+ def init_kvm(self, system):
+ """Do KVM-specific system initialization.
+
+ Arguments:
+ system -- System to work on.
+ """
+ system.vm = KvmVM()
+
def init_system(self, system):
"""Initialize a system.
@@ -119,6 +129,10 @@ class BaseSystem(object):
"""
system.cpu = self.create_cpus()
+ if _have_kvm_support and \
+ any([isinstance(c, BaseKvmCPU) for c in system.cpu]):
+ self.init_kvm(system)
+
sha_bus = self.create_caches_shared(system)
for cpu in system.cpu:
if not cpu.switched_out: