summaryrefslogtreecommitdiff
path: root/src/sim
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
commitf743bdcb6994a4e0e413e1a3499f7424b5ec2efa (patch)
tree86f81f804d3a17f4c1b4530e040e144fcf21389b /src/sim
parentadbaa4dfde96d5aaf84adf0ae4989ef880aad726 (diff)
downloadgem5-f743bdcb6994a4e0e413e1a3499f7424b5ec2efa.tar.xz
x86: Segment initialization to support KvmCPU in SE
This patch sets up low and high privilege code and data segments and places them in the following order: cs low, ds low, ds, cs, in the GDT. Additionally, a syscall and page fault handler for KvmCPU in SE mode are defined. The order of the segment selectors in GDT is required in this manner for interrupt handling to work properly. Segment initialization is done for all the thread contexts.
Diffstat (limited to 'src/sim')
-rw-r--r--src/sim/Process.py1
-rw-r--r--src/sim/process.cc1
-rw-r--r--src/sim/process.hh3
3 files changed, 5 insertions, 0 deletions
diff --git a/src/sim/Process.py b/src/sim/Process.py
index 7e5f75363..f64ab0883 100644
--- a/src/sim/Process.py
+++ b/src/sim/Process.py
@@ -40,6 +40,7 @@ class Process(SimObject):
system = Param.System(Parent.any, "system process will run on")
useArchPT = Param.Bool('false', 'maintain an in-memory version of the page\
table in an architecture-specific format')
+ kvmInSE = Param.Bool('false', 'initialize the process for KvmCPU in SE')
max_stack_size = Param.MemorySize('64MB', 'maximum size of the stack')
@classmethod
diff --git a/src/sim/process.cc b/src/sim/process.cc
index d1fb22029..f53c6b850 100644
--- a/src/sim/process.cc
+++ b/src/sim/process.cc
@@ -107,6 +107,7 @@ Process::Process(ProcessParams * params)
max_stack_size(params->max_stack_size),
M5_pid(system->allocatePID()),
useArchPT(params->useArchPT),
+ kvmInSE(params->kvmInSE),
pTable(useArchPT ?
static_cast<PageTableBase *>(new ArchPageTable(name(), M5_pid, system)) :
static_cast<PageTableBase *>(new FuncPageTable(name(), M5_pid)) ),
diff --git a/src/sim/process.hh b/src/sim/process.hh
index 6e26bb8bd..d0865f990 100644
--- a/src/sim/process.hh
+++ b/src/sim/process.hh
@@ -128,6 +128,9 @@ class Process : public SimObject
// flag for using architecture specific page table
bool useArchPT;
+ // running KvmCPU in SE mode requires special initialization
+ bool kvmInSE;
+
PageTableBase* pTable;
class FdMap